To use novaPDF COM in your application you need to follow next steps:
1. Create an instance of INovaPdfOptions interface
Create the object when the application starts and use it while printing to novaPDF SDK printer
2. Call the Initialize method
Initialize method has one parameter, the name of the printer (for example "novaPDF SDK", or when on the network "\\server name\novaPDF SDK")
3. Set novaPDF SDK options by calling SetOptionString or SetOptionLong (...) methods.
This step is optional. If you use the default options or if you already configured the desired options, you can skip it.
4. Register your application to receive Windows messages
novaPDF printer sends messages (StartDoc, StartPage, EndPage, EndDoc, FileSent, Print Error) while printing a document. You can register to receive Windows messages using the RegisterEventWindow
method. You also need to implement message handlers for the registered messages. See MFC Scribble
or MFC Converter
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
The object should be released only when all print jobs are finished.