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

November 24, 2009

novaPDF 7 was released.

Changes in version 7:
  • Added option to digitally sign PDF files
  • Type1 fonts are now supported
  • novaPDF now includes add-ins for Microsoft Office (Word and Excel)
  • Added a start page to allow quick access to create PDFs
  • Fully compatible with Windows 7

You can download version 7 here: Download novaPDF 7

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
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.

The CSharp Converter sample demonstrates how to convert an existing file by printing it to novaPDF Printer using the ShellExecute function. It also demonstrates how to set different options and manage profiles.
The same approach should be taken if you print using a "Print()" method from another object (like an internet browser or a report control). Just replace the ShellExecute call with the call of your Print method.

When the application starts, it creates a few profiles and makes different settings in the profiles. Then it shows a dialog from where the user can select the active profile and change its settings using the controls from the dialog. After that a document can be selected from the harddisk and printed to novaPDF Printer using the ShellExecute function call.

When using this technique to convert a file to PDF, you have to consider the fact that ShellExecute prints to the default printer. This function returns immediately and does not wait until the print is finished (it may return before the printing is actually started). Therefore you have to set the default printer to novaPDF Printer before calling ShellExecute (using the SetDefaultPrinter method), wait the process to be started (using WaitForExit()) and restore the default printer (with the RestoreDefaultPrinter method). This way you make sure that the default printer was restored and your document is printed to novaPDF Printer.

Source Code Snippets

1. Declare INovaPdfOptions variable 

private NovaPdfOptionsClass mobjNovaOptios; 

2. Initialize INovaPdfOptions 

mobjNovaOptios = new NovaPdfOptionsClass(); 

// initialize the NovaPdfOptions object
// if you have an application license for novaPDF SDK,
// pass both the registration name and the license key to the Initialize() function
// mobjNovaOptios.Initialize(PRINTER_NAME, "<registration name>", "<license key>");mobjNovaOptios.Initialize(PRINTER_NAME, "", "", ""); 

AddSmallProfile();
AddFullProfile(); 

3. Set novaPDF Printer Options 

try
{
  mobjNovaOptios.AddProfile2(SMALL_SIZE_PROFILE);
  // Set some options to this profile
  // disable the "Save PDF file as" prompt
  mobjNovaOptios.SetOptionLong2(NovaOptions.NOVAPDF_SAVE_PROMPT, 0, SMALL_SIZE_PROFILE, PROFILE_IS_PUBLIC);
  // set generated Pdf files destination folder  "c:\"
  mobjNovaOptios.SetOptionString2(NovaOptions.NOVAPDF_SAVE_FOLDER, "c:\\", SMALL_SIZE_PROFILE, PROFILE_IS_PUBLIC); 

  // ..... 

}
catch(System.Runtime.InteropServices.COMException ComException)
{
  if (((~ComException.ErrorCode ^ NovaErrors.NV_PROFILE_EXISTS) ^ 0xFFFFFFFF)==0)
  {
    System.Diagnostics.Debug.WriteLine("Profile \"Small Size Profile\" exists");
  }
  else
  {
    MessageBox.Show("Error creating Small Size Profile:\r\n" + ComException.Message);
    System.Diagnostics.Debug.WriteLine(ComException.Message);
  }
} 

4. Start a print job 

private void btnStartPrinting_Click(object sender, System.EventArgs e)
{
UpdateProfileFromDialog();
mobjNovaOptios.SetActiveProfile2((string)(cmbProfiles.SelectedItem));
mobjNovaOptios.SetDefaultPrinter(); 

mobjNovaOptios.LicenseShellExecuteFile(txtFileToConvert.Text); 

Process myProcess = new Process();
try
{
  myProcess.StartInfo.FileName = txtFileToConvert.Text;
  myProcess.StartInfo.Verb = "Print";
  myProcess.StartInfo.CreateNoWindow = true;
  myProcess.Start();
}
catch (Win32Exception ex)
{
  if(ex.NativeErrorCode == ERROR_FILE_NOT_FOUND)
  {
    Console.WriteLine(ex.Message + ". Check the path and filename");
  }
  else if (ex.NativeErrorCode == ERROR_ACCESS_DENIED)
  {
    // Note that if your word processor might generate exceptions
    // such as this, which are handled first.
    Console.WriteLine(ex.Message + ". You do not have permission to print this file.");
  }
}
myProcess.WaitForExit(10000);
myProcess.Close();
mobjNovaOptios.RestoreDefaultPrinter();
}
Add comment
Name:
Email:
* Comment:
(Use BBcode - No HTML)


Others in this Category
document Word OLE CSharp - SDK sample
document Delphi PDF - Hello World sample
document [novaPDF SDK] - If I set an option value via COM, will that be persistent, or will the option be reverted when the program terminates?
document VBNet Converter - SDK sample
document Word OLE VBNet - SDK sample
» More articles
RSS

Legal Notices Terms of Use

Copyright Softland 2009. All rights reserved.