How to use the COM

Top  Previous  Next

To use novaPDF COM in your application you need to follow next steps:

 

1. Create an instance of INovaPdfOptions interface

2. Call the Initialize method with the following parameters

name of the printer (for example "novaPDF Pro v5", or when on the network "\\server name\novaPDF Server Pro v5")
name of the registered user (can be empty when not registered)
license key (can be empty when not registered)

 

3. Set novaPDF Printer options by calling SetOptionString or SetOptionLong methods.

You can also manage profiles with AddProfile, CopyProfile, RenameProfile, DeleteProfile, GetFirstProfile, GetNextProfile, GetActiveProfile, SetActiveProfile methods. A good sample for how to use this methods is the MFC Converter sample.

This step is optional. If you use the default options or if you already configured the desired options, you can skip it.

 

4. Register for novaPDF Printer Windows messages (StartDoc, StartPage, EndPage, EndDoc, FileSent, Print Error) using the RegisterEventWindow method. You also need to implement message handlers for the registered messages. See MFC Scribble or MFC Converter samples.

This step is also optional. If you do not need to implement this event handlers you can skip it.

 

5. Start a print job. You can do it as follows:

use Win32 API functions: OpenPrinter, DocumentProperties, CreateDC, StartDoc, StartPage,... See the Hello World sample.
print a file using the ShellExecute function. For a sample see MFC Converter.
use MFC document/view architecture. For more information look at the MFC Scribble sample.

 

6. Release the INovaPdfOptions instance.