Buy Now

novaPDF Professional
$62.44 $49.95

novaPDF Standard
$53.27 $39.95

novaPDF Lite
$24.94 $19.95

Awards & Reviews

  • 1_ico
  • 2_ico
  • 3_ico
  • 4_ico

Lockergnome feature

novaPDF is really neat

"novaPDF – Print To PDF Without Breaking The Bank. After downloading and installing the program (which takes all of one minute) you’re ready to print to a PDF. Any program that can print via the standard Windows printer interface can print to PDF (i.e. convert a file to PDF), including text, Word, Excel, […] , novaPDF will convert your files into PDF format without making your wallet cry."

Editor’s Review

This application is great

"[...] Pluses: novaPDF supports multiple profiles. This means that all your settings can be easily saved or loaded. Another great feature is the program’s ability to put bookmarks into the PDF document it creates. Drawbacks/flaws: [none] In conclusion: This application is great for generating PDF documents out of any type of printable data."

Indezine Review

Provides a good balance

"[...] novaPDF provides a good balance between price and performance -- it's a very usable option between free and highly priced PDF creators so that you can provide PDF output capabilities to a large number of users at a reasonable cost."

AC Review

Extremely easy to use

"[...]I highly recommend NovaPDF as a great and very simple way to create standard PDF documents that are fully compatible with Adobe Acrobat Reader. Nova PDF creator is an extremely easy to use and simple PDF creator"

Latest News

April 12, 2010

novaPDF 7.1 was released.

Changes in version 7.1:
  • Added visibility layers for watermarks
  • Added Document Creator option
  • Added Page Scaling options
  • Added option to remove PDF after emailing
  • Added Lithuanian language

You can download version 7 here: Download novaPDF 7.1

Stay Updated

To join, simply enter your email address below and click on Subscribe.

About Us

Softland, the company that develops novaPDF, achieved the Microsoft Certified Partner status with an ISV/Software Solutions Competency. Microsoft Certified Partner
Share
Add comment
Votes: 0
Comments: 0
Note: To be able to use the samples you must install novaPDF SDK as samples work only with it. Download it here: nova PDF SDK.

Hello World sample is a simple Windows console application that prints one page with the "Hello World" text to the novaPDF Printer. It demonstrates the basic use of the INovaPDFOptions interface. The printing job is made with Windows API calls OpenPrinter, StartDoc,…
It generates a "Hello World.pdf" file in the working folder.

Notice If you do not use Windows API calls to print to novaPDF Printer, but you perform a print job by calling other controls "Print()" method, or if you print an existing document using "ShellExecute()" function, you should check the MFC Converter sample instead.


Sample Code:

// HelloWorld.cpp
#include "stdafx.h" 

//Include novaPDF headers
#include "..\..\include\novaOptions.h"
#include "..\..\include\novapi.h"

//name of novaPDF Printer
#define PRINTER_NAME    L"novaPDF Pro v6"

//text to be written in the PDF file
#define PDF_TEXT        L"Hello world!"

//PDF file name
#define PDF_FILE_NAME   L"HelloWorld.pdf"

//Print profile name
#define PROFILE_NAME       L"HelloWorld Profile"
#define PROFILE_IS_PUBLIC  0

//entry point for the console application
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr = S_OK;

//initialize COM
hr = CoInitialize(NULL);
if (FAILED (hr))
{
  MessageBox(NULL, L"Failed to initialize COM", L"novaPDF", MB_OK);
  return hr;
}

//create one NovaPdfOptions instance
INovaPdfOptions *pNova = 0;
hr = CoCreateInstance(__uuidof(NovaPdfOptions), NULL, CLSCTX_INPROC_SERVER, __uuidof(INovaPdfOptions), (LPVOID*) &pNova);
if (FAILED(hr))
{
  MessageBox(NULL, L"Failed to create novaPDF COM object", L"novaPDF", MB_OK);
  return hr;
}

//initialize NovaPdfOptions and pass printer name
//if you have an application license for novaPDF SDK,
//pass both the registration name and the license key to the Initialize() function
//hr = pNova->Initialize(PRINTER_NAME, L"<registration name>", L"<license key>");
hr = pNova->Initialize(PRINTER_NAME, L"", L""), L"";

if (SUCCEEDED(hr)) { 

  pNova->SetDefaultPrinter();
  // set optional PDF settings
  // create a temporary profile for the current print job,
  // in order to not modify the default profile settings
  pNova->AddProfile(PROFILE_NAME, PROFILE_IS_PUBLIC);
  // set PDF document Title
  pNova->SetOptionString(NOVAPDF_INFO_TITLE, L"Hello World Sample",
                         PROFILE_NAME, PROFILE_IS_PUBLIC);
  // set resulting file name
  pNova->SetOptionString(NOVAPDF_SAVE_FOLDER, L"",
                         PROFILE_NAME, PROFILE_IS_PUBLIC);
  pNova->SetOptionString(NOVAPDF_SAVE_FILE, PDF_FILE_NAME,
                         PROFILE_NAME, PROFILE_IS_PUBLIC);
  //do not show prompt dialog
  pNova->SetOptionLong(NOVAPDF_SAVE_PROMPT, 0,
                       PROFILE_NAME, PROFILE_IS_PUBLIC);
  //if file exists, override
  pNova->SetOptionLong(NOVAPDF_SAVE_CONFLICT_STRATEGY,
                       FILE_CONFLICT_STRATEGY_OVERWRITE,
                       PROFILE_NAME, PROFILE_IS_PUBLIC);
  // set active profile
  LPWSTR wsDefaultProfile = NULL;
   int    nDefProfilePublic = 0;
  pNova->GetActiveProfile(&wsDefaultProfile, &nDefProfilePublic);
  pNova->SetActiveProfile(PROFILE_NAME, PROFILE_IS_PUBLIC);

  HANDLE     hPrinter;
  PDEVMODEW  pDevmode = NULL;
  PRINTER_DEFAULTS pd = { NULL, NULL, PRINTER_ACCESS_USE };

  //start print job
  if (OpenPrinter(PRINTER_NAME, &hPrinter, &pd))
  {
    //get default printer DEVMODE    
    int nSize = DocumentProperties(NULL, hPrinter, PRINTER_NAME, NULL, NULL, 0);
    pDevmode = (PDEVMODEW)LocalAlloc(LPTR, nSize);
    DocumentProperties(NULL, hPrinter, PRINTER_NAME, pDevmode, NULL, DM_OUT_DEFAULT);

    //Print a page
    HDC hDC = CreateDC(L"", PRINTER_NAME, NULL, pDevmode);
    DOCINFO docInfo = {sizeof(DOCINFO)};
    // PDF document name and path
    docInfo.lpszDocName = PDF_FILE_NAME;
    StartDoc(hDC,&docInfo);
    StartPage(hDC);
    // Draw text on page
    TextOut(hDC, 100, 80, PDF_TEXT, (int) wcslen(PDF_TEXT));
    EndPage(hDC);
    EndDoc(hDC);
    DeleteDC(hDC); 

    //print job sent to printer
    MessageBox(NULL, L"Print job finished", L"novaPDF", MB_OK); 

    LocalFree(pDevmode);
    ClosePrinter(hPrinter);
  }
  else
  {
    WCHAR wsMessage[255];
    wsprintf(wsMessage, L"OpenPrinter failed, error = %d", GetLastError());
    MessageBox(NULL, wsMessage, L"novaPDF", MB_OK);
  }
  //restore default profile
  pNova->SetActiveProfile(wsDefaultProfile, nDefProfilePublic);
  pNova->DeleteProfile(PROFILE_NAME, PROFILE_IS_PUBLIC);
  CoTaskMemFree(wsDefaultProfile);
  //restore default printer
  pNova->RestoreDefaultPrinter();
}
else{
  MessageBox(NULL, L"Failed to initialize novaPDF Printer", L"novaPDF", MB_OK);
}

//release NovaPdfOptions
pNova->Release();
CoUninitialize();
return 0;
}

Add comment
Name:
Email:
* Comment:
(Use BBcode - No HTML)


Others in this Category
document CSharp Converter - SDK sample
document VCL Converter (Delphi PDF) - SDK sample
document PDF Reports - SDK sample
document VBNet Converter - SDK sample
document Word OLE CSharp - SDK sample
» More articles
RSS

Legal Notices Terms of Use

Copyright Softland 2010. All rights reserved.