Home

novaPDF SDK User Manual

image

Contents

1. MB_OK return hr set PDF document Title m_pNova gt SetOptionString NOVAPDF_DOCINFO_TITLE L MFC Scribble Sample set resulting file name m_pNova gt SetOptionLong NOVAPDF_SAVE_FOLDER_TYPE SAVEFOLDER_CUSTOM m_pNova gt SetOptionLong NOVAPDF_SAVE_LOCATION LOCATION_TYPE_LOCAL m_pNova gt SetOptionLong NOVAPDF_SAVE_FOLDER_TYPE SAVEFOLDER_ CUSTOM m_pNova gt SetOptionString NOVAPDF_SAVE_FOLDER L C temp m_pNova gt SetOptionString NOVAPDF_SAVE_FILE_NAME PDF_FILE_NAME do not show prompt dialog m_pNova gt SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_NONE 7 f1 file exists override m_pNova gt SetOptionLong NOVAPDF_SAVE_FILEEXIST_ACTION FILE _CONFLICT_STRATEGY_OVERWRITE save profile cha hr m_pNova gt Save set as active profile m_pNova gt SetActive register window to receiv m_pNova gt Register laos nges Profile for printer Profile m_wsNewProfile 5 Restore options when printing finished messages from novaPDF printer EventWindow LONG m_hWnd novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 175 void CScribbleView OnEndPrinting CDC pDC CPrintInfo pInfo if m_pNova unregister events m_pNova gt UnRegisterEventWindow restore default profile if m_w
2. mobjNovaOptios SetActiveProfile CType cmbProfiles SelectedItem String mobjNovaOptios SetDefaultPrinter mob jNovaOptios LicenseShellExecuteFile txtFileToConvert Text Dim myProcess As Process New Process Try myProcess StartInfo FileName txtFileToConvert Text myProcess StartInfo Verb Print myProcess StartInfo CreateNoWindow True myProcess StartInfo WindowStyle ProcessWindowStyle Hidden myProcess Start Catch ex As Win32Exception If ex NativeErrorCode ERROR_FILE_NOT_FOUND Then Console WriteLine ex Message Check the path and filename Else Note that if your word processor might generate exceptions such as this which are handled first If ex NativeErrorCode ERROR_ACCESS_DENIED Then Console WriteLine ex Message You do not have permission to print this file End If End If End Try myProcess WaitForExit 10000 myProcess Close mob jNovaOptios RestoreDefaultPrinter End Sub Word OLE VBNet The Word OLE VBNet sample is a simple Windows console application that converts a MS Word document C Test doc to PDF using Word OLE automation Source code Imports System Imports System Drawing novaPDF SDK 8 User Manual Copyright 2015 Softland 204 novaPDF SDK 8 Imports System Drawing Printing Imports System Windows Forms Imports novapiLib80 Module Modulel i lt summary gt j The main entry point for the application 1 lt summary
3. in string LPWSTR p_pwsLayoutld in LONG p_nOption out FLOAT p_pfValue i Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout p_nOption in option constant p_pfValue out will contain the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaPDF SDK 8 User Manual Copyright 2015 Softland 84 novaPDF SDK 8 novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 68 GetLayoutOptionFloat2 The GetLayoutOptionFloat2 method retrieves an option of float type for a layout object HRE SULT GetLayoutOptionFloat2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption out FLOAT p_pfValue i Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsL
4. 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 if txtFileToConvert Text Trim MessageBox Show No file to convert return mob jNovaOptios SetActiveProfile string cmbProfiles SelectedItem ToString mob jNovaOptios SetDefaultPrinter mob jNovaOptios LicenseShellExecuteFile txtFileToConvert Text Process myProcess new Process LEY myProcess StartInfo FileName txtFileToConvert Text myProcess StartInfo Verb Print myProcess StartInfo CreateNoWindow true myProcess StartInfo WindowStyle ProcessWindowStyle Hidden 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 WritelLine ex Message You do not have permission to print this file myProcess WaitForExit 10000 myProcess Close mob jNovaOptios RestoreDefaultPrinter novaPDF SDK 8 User Manual Copyright 2015 Softland
5. do not show prompt dialog pNova gt SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_NONE FILE _CONFLICT_STRATEGY_AUTONUMBER_NEW FALSE amp pd LE ELIS exists override pNova gt SetOptionLong NOVAPDF_SAVE_FIL T EXIST_ACTION do not open pNova gt SetOptionBool NOVAPDF_ACTION_DEFAULT_VIEWER save profile changes hr pNova gt SaveProfile set as active profile for printer pNova gt SetActiveProfile pwsNewProfilelD HANDLE hPrinter BOOL bTimeout PDEVMODEW pDevmode NULL PRINTER_DEFAULTS pd NULL NULL PRINTER_ACCESS_USE for int i 1 i lt 10 itt start print job if OpenPrinter pParams gt wsPrinterName amp hPrinter register to wait for a nova event walt until PDf is finished pNova gt RegisterNovaEvent L NOVAPDF_EV ENT_START_DOC hPrinter p nSize pParams gt wsPrinterName pDevmode NULL DM_OUT_BUFFER get default printer DEVMODE int nSize DocumentProperties NULL Params gt wsPrinterName NULL NULL 0 pDevmode PDEVMODEW LocalAlloc LPTR DocumentProperties NULL hPrinter el set page size in DEVMOD pDevmode gt dmPaperSize DMPAPER_USER novaPDF SDK 8 User Manual Copyright O 2015 Softland
6. Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 104 GetWatermarkTextOptionLong The GetWatermarkTextOptionLong method retrieves a watermark text option of long int type HRESULT GetWatermarkTextOptionLong in string LPWSTR p_pwsWatermarkId in LONG p_nOption out LONG p_plValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText p_nOption in option constant p_plValue out pointer to a pointer to a null terminated Unicode string that will contal Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 105 GetWatermarkTextOptionLong2 The GetWatermarkTextOptionLong2 method retrieves a watermark text option
7. out layouts count Return values S_OK on success or COM error code novaPDF SDK 8 User Manual Copyright O 2015 Softland 82 novaPDF SDK 8 NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong object id 2 4 10 4 65 GetLayoutOptionBool The GetLayoutOptionBool method retrieves an option of boolean type for a layout object HRE SULT GetLayoutOptionBool in string LPWSTR p_pwsObjectld in string LPWSTR p_pwsLayoutld in LONG p_nOption out BOOL p_pbValue i Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pwsLayoutlId in layout id obtained with GetLayout p_nOption in option constant p_pbValue out will contain the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2
8. string str novaPDF says Hello World from ASP NET Font font new Font Arial 16 Brush brush new SolidBrush Color Black ev Graphics DrawString str font brush 20 0f 20 0f ev HasMorePages false Delphi VCL Converter The VCL Converter sample demonstrates how to convert an existing file by printing it to novaPDF SDK 8 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 SDK 8 using the ShellExecute function call When using this technique to convert a file to PDF you have to take care of 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 SDK 8 before calling ShellExecute using the SetDefaultPrinter method register Filesaved message or any other
9. 182 novaPDF SDK 8 pDevmode gt dmPaperLength 2970 5940 pDevmode gt dmPaperWidth 2100 4200 pDevmode gt dmFields DM_PAPERLENGTH DM_PAPERWIDTH DM_PAPERSIZE DocumentProperties NULL hPrinter pParams gt wsPrinterName pDevmode pDevmode DM_IN_BUFFER DM_OUT_BUFFER Print a HDC hDC pParams gt wsPrinterName NULL pDevmode page CreateDC DOCINFO docInfo PDF document name and path docInfo lpszDocName PDF_FILE_NAME StartDoc StartPage hDC LS sizeof DOCINFO hDC docInfo Draw text on page TextOut hDC 100 80 PDF_TEXT int wcslen PDE_TEXT EndPage h DeleteDC LocalFree ClosePrin pNova gt WaitForNova delete profile DC EndDoc HDC hDC pDevmode ter hPrin i ter Event 1 amp bTimeout pNova gt DeleteProfile pwsNewProfilelD CoTaskMemF ree pwsNewProfilelD delete temporarry printer pNova gt DeleteNovaPrinter pParams gt wsPrinterName release NovaPdfOptions pNova gt Release return 0 2 5 7 Java 2 5 7 1 Hello World Hello World Java sample is a basic Java console application that generates using the novaPDF SDK 8 printer one PDF file containing the text Hello World from Java2 It demonstrates the basic use of the INovaPDFOptions interface with j Interop What this sample doe
10. LPVOID amp pNova if you have an application license for novaPDF SDK call the RegisterLicenseKey function hr pNova gt RegisterLicenseKey lt registration name gt lt license key gt lt application name gt if SUCCEEDED hr add temporary printer pNova gt AddNovaPrinter pParams gt wsPrinterName pParams gt wsPortName L nPdfSdk8_Softland L 8501 L set optional PDF settings LPWSTR pwsNewProfileID NULL create a new profile with default settings hr pNova gt AddProfile PROFILE_NAME PROFILE_IS_PUBLIC amp pwsNewProfilelID load the newly created profile if SUCCEEDED hr 88 pwsNewProfilelD hr pNova gt LoadProfile pwsNewProfilelID else novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 181 pNova gt Release return hr if SUCCEEDED hr amp amp pwsNewProfilelD set novaPDF options set resulting file name pNova gt SetOptionLong NOVAPDF_SAVE_FOLDER_TYPE SAVEFOLDER_CUSTOM LOCATION_TYPE_LOCAL pNova gt SetOptionLong NOVAPDF_SAVE_LOCATION T pNova gt SetOptionLong NOVAPDF_SAVE_FOLDER_TYPE SAVEFOLDER_CUSTOM C temp novaPDF pParams gt wsFileName pNova gt SetOptionString NOVAPDF_SAVE_FOLDER pNova gt SetOptionString NOVAPDF_SAVE_FILE_NAME
11. Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout2 p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland 128 novaPDF SDK 8 For layout options see Working with Layout objects 2 4 10 4 151 SetOptionBool The SetOptionBool method sets a printing option of boolean type HRESULT SetOptionLong in LONG p_nOption in LONG p_bValue y Parameters p_nOption in option constant p_bValue in long integer value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPT
12. Parameters p_wsPrinterName in printer name p_wsLicenseKey in license key Return values S_OK on success or COM error code NV_INVALID_PRINTER_NAME NV_NOT_A NOVAPDF_PRINT NV_INVALID_LICENSE NV_SI Cannot find printer with given printer name ER printer is not a novaPDF SDK 8 Cannot read license or not a SDK license ERVICE_ERROR cannot connect to novaPDF Server servic Remarks This method must be called prior to calling any method from the INovaPdfOptions interface 2 4 10 4 113 InitializeOLEUsage The InitializeOLEUsage method initializes the OLE server licensing HRESULT InitializeOLEUsage in BSTR p_pwstrOLEProgID Parameters p_pwstrOLEProgID in pointer to a Unicode string containing the ProgID for the OLE server that Return values S_OK on success or COM error code Remarks This method must be called prior to initializing the OLE object that will perform the print to the novaPDF SDK 8 2 4 10 4 114 InitializeSilent The InitializeSilent method initializes the INovaPdfOptions interface silently HRESULT InitializeSilent in LPCWSTR p_wsPrinterName in LPCWSTR p_wsLicenseKey novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 109 i Parameters p_wsPrinterName in pointer to a null terminated Unicode string containing the name of the pri p_wsLicenseKey in pointer to a nul
13. ecesceesesceeseceeeeeeeeaeceeeeeesaeeeneeseeeaeeseesaeeaesaeecaeseeecaeeeaeseaeeaeseaeeeeseaeeeas 105 GetWatermarkTextOptionStriNg2 ococonconnnncnncnnonncnnnononnnonennnnn nono cnn rn canon crec rra 106 GetWatermarkText x GetWatermarkText2ns anin an i a tis Sik Hea eit Aha teed GetWatermarkTextCOUNE once Oh a heal Wi Add aladdin N E 107 Initialize tetas pnoy a a ida aa aaae aeara eda edia 107 Mitalze2 orea aa R AAA nrg Ee E R Aten a R N N aaa 108 InitializeOLE Usage nti i eet a td 108 Miti lizeSilent ia er si a AA Get eA en ee ae 108 Initialize Silent cuotas Aid 109 Lic hseApplication ssi isviseece aera oi eve Sees igs ieee eae Da ee IEA 109 LiconseOlES V a A oll rade arte te ea 110 novaPDF SDK 8 User Manual Copyright 2015 Softland 6 novaPDF SDK 8 LicenseShellExecuteFile MoadProfile iria ais E NN ModifyBookmarkDetinition c2csi0a2 acest reiasa a id 111 ModifyBookmarkDefinition2 ce eeeeceeeeeseeeeeeeeceeeceeeaeeeeeaeeeeesaeesaeceeeeaeseaeeeesaeesaeseesaeseaeeeeeaeeesesieeeaeeanes 112 RegisterEVentWindOw cic iczecotiverenicas idad ads 113 RegisterNovaE Vent sesaria 2 ok ce Sees ieee AA casei anid ine Ge 114 RegisterNovaEVent2 vice iccincascacscvecesescucsteveseconsendcaecuceveavecusetesaccvecbedbdcneseacaschecabcvsdhaversavedteveesedduesndeneevees 114 RestoreDefaultPrinter 114 SaveProfile iia iO pl tits 115 SetActive Profile saista aa a da 115 SetActiv Pr
14. in LPWSTR p_wstrProfileld gt Parameters p_wstrProfileld in pointer to a null terminated Unicode string that contains the id of the pr Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE the profile specified by p_wstrProfileId does not exist NV_PUBLIC_PROFILE active profile cannot be change due to propagate active profile flag 2 4 10 4 129 SetActiveProfile2 The SetActiveProfile2 sets the active profile i e the profile that will be used for printing HRESULT SetActiveProfile2 in BSTR p_wstrProfileld i Parameters p_wstrProfileName in pointer to a BSTR that contains the id of the profile that is to be set as Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE the profile specified by p_wstrProfileId does not exist NV_PUBLIC_PROFILE active profile cannot be change due to propagate active profile flag novaPDF SDK 8 User Manual Copyright 2015 Softland 116 novaPDF SDK 8 2 4 10 4 130 SetDefaultPrinter The SetDefaultPrinter method sets the current printer the one specified in Initialize as default printer HRESULT SetDefaultPrinter void Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called Remarks After calling SetDefaultPrinter with an INovaPdfOptions o
15. 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 SDK 8 using the novaPDF SDK 8 User Manual Copyright 2015 Softland 170 novaPDF SDK 8 ShellExecute function call When using this technique to convert a file to PDF you have to take care of 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 SDK 8 before calling ShellExecute using the SetDefaultPrinter method register FileSaved message or any other novaPDF SDK 8 message to be sure that the print job was started In this message handler restore the default printer with the RestoreDefaultPrinter method This way you made sure that the default printer was restored and your document is printed to novaPDF SDK 8 Source code snippets 1 Declare INovaPdfOptions variable declare an INovaPdfOptions member variable private INovaPdfOptions m_novaOptions 2 Regi
16. novaPDF SDK 8 User Manual Copyright 2015 Softland Index 209 Index A Addbookmarkdefinition 49 Addbookmarkdefinition2 50 Addprofile 55 Addprofile2 56 AddWatermarklmage 56 AddWatermarklmage2 57 AddWatermarkText 57 AddWatermarkText2 58 asp 146 asp net 146 B batch convert 9 bulk convert 9 C Choose sample 143 Components 13 Copyprofile 58 Copyprofile2 59 CSharp converter 160 D Deletebookmarkdefinition 59 Deleteprofile 63 Deleteprofile2 64 DeleteWatermarklmage 64 DeleteWatermarklmage2 64 DeleteWatermarkText 65 DeleteWatermarkText2 65 Ge Getactiveprofile 65 Getactiveprofile2 66 Getbookmarkdefinition 66 Getbookmarkdefinition2 67 Getbookmarkdefinitioncount 68 Getfirstprofile 78 Getfirstprofile2 78 Getnextprofile 87 Getnextprofile2 87 Getoptionlong 89 Getoptionstring 90 Getoptionstring2 91 Getpdffilename 92 GetWatermarklmage 94 GetWatermarklmage2 95 GetWatermarklmageCount 95 GetWatermarkText 106 GetWatermarkText2 107 GetWatermarkTextCount 107 H hello world 146 165 182 Hello World CSharp 158 Hello World Delphi 153 Hello World VB 193 Hellow World network 168 Hellow World VBNet 199 Initialize 107 Initialize2 108 Initializeoleusage 108 InitializeSilent 108 InitializeSilent2 109 INovaPdfOptions 45 Install Command line 12 Network 12 Integrate 16 ade java 182 187 java sample 182 187 Ss LicenseApplication 109 Licenseoleserver 110 novaPDF SD
17. LSCTX_INPROC_SERVER IID_INovaPdfOptions80 pNova if FAILED hr then begin System Writeln Failed to create novaPDF COM object exit end initialize NovaPdfOptions and pass printer name pNova Initialize2 PRINTER_NAME pNova SetDefaultPrinter now the default printer is novaPDF printer but the Printer object is not updated here is a workaround to update the Printer object with the default printer you only need this code if you check later on the Printer PrinterIndex to find out the default printer Printer GetPrinter Device Driver Port DevMode Printer SetPrinter PRINTER_NAME Driver Port 0 novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 157 create a new profile with default settings pNova AddProfile2 PROFILE _NAME PROFILE _IS_ PUBLIC strNewProfilelD load the newly created profile if Length strNewProfileID gt 0 then begin pNova LoadProfile2 strNewProfilelD end else begin System Writeln Failed to create profile exit end set PDF document Title pNova SetOptionString2 NOVAPDF_DOCINFO_TITLE Hello World Delphi Sample set resulting file name Nova SetOptionString2 NOVAPDF_SAVE_FOLDER C do not show prompt dialog Nova SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_NONE if file exists override Nova SetOptionLong NOVAPDF_SAVE_FILEEXIST_ACTION E_CONFLICT_STRATEGY_OVERWRITE do n
18. ap 1 getObjectAsString getString catch JIException except novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 185 System out println GetActiveProfile2 except printStackTrace ADD A NEW PROFILE String activeProfile try JIVariant ap pNovaDispatch callMethodA AddProfile2 new Object new JIString PROFILE_NAME PROFILE_IS_PUBLIC new JIVariant true activeProfile ap 1 getObjectAsString getString catch JIException except System out println AddProfile2 except printstackTrace LOAD PROFILE try pNovaDispatch callMethod LoadProfile2 new Object new JIString activeProfile catch JIException except System out println LoadProfile2 except printStackTrace CHANGE SOME OPTIONS try and set some options pNovaDispatch callMethod SetOptionString2 new Object NOVAPDF_DOCINFO_SUBJECT new JIString NOVAPDF_INFO_SUBJECT pNovaDispatch callMethod SetOptionString2 new Object NOVAPDF_SAVE_FILE_NAME new JIString novaPDFJavaDocument pNovaDispatch callMethod SetOptionLong new Object NOVAPDF_SAVE_FILEEXIST_ACTION FILE _CONFLICT_STRATEGY_AUTONUMBER_NEW pNovaDispatch callMethod SetOptionBool new Object NOVAPDF_INFO_VIEWER_ENABLE 1 pNovaDispatch ca
19. nova NovaTools AddGraphicsOptions pNova nova NovaTools AddSecurityOptions pNova nova NovaTools AddSaveOptions pNova nova NovaTools AddAfterSaveActions pNova nova NovaTools AddEmailOptions pNova nova NovaTools AddWatermarkImage pNova nova NovaTools AddWatermarkText pNova nova NovaTools AddPageContentOptions pNova nova NovaTools AddOverlayOptions pNova nova NovaTools AddSignatureOptions pNova novaPDF SDK 8 User Manual Copyright 2015 Softland 160 novaPDF SDK 8 nova NovaTools AddEmbedFontsOptions pNova nova NovaTools AddBookmarksDefinitions pNova save the new added profile pNova SaveProfile set the new profile as the active profile pNova SetActiveProfile _newProfilelD print a test page using the previously set active profile settings using PrintDocument pd new PrintDocument pd PrinterSettings PrinterName PRINTER_NAME pd PrintPage new PrintPageEventHandler PrintPageFunction pd DefaultPageSettings PaperSize new System Drawing Printing PaperSize PaperA4 826 1169 pd Print if isActiveProfile pNova SetActiveProfile activeProfile pNova DeleteProfile _newProfilelD catch System Runtime InteropServices COMException e MessageBox Show e Message catch Exception e MessageBox Show e Message and finally the function that actually p
20. novaPDF SDK 117 in string BSTR p_pwsEmailld in LONG p_nOption in BOOL p_bValue i Parameters p_pwsEmaillid in email id obtained with GetEmail2 or AddEmail2 p_wsOption in option constant p_bValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 133 SetEmailOptionEncryptedString The SetEmailOptionEncryptedString method sets an option of encrypted string type for an email HRESULT SetEmailOptionEncryptedString in string LPWSTR p_pwsEmailld in LONG p_nOption in LPCWSTR p_wsValue Parameters p_pwsEmailld in email id obtained with GetEmail or AddEmail p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFI
21. pNova DeleteProfile _newProfilelD restore default printer pNova RestoreDefaultPrinter C Hello World Hello World sample is a simple Windows console application that prints one page with the Hello World text to the novaPDF SDK 8 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 SDK 8 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 Source code HelloWorld cpp include stdafx h Include novaPDF headers include include novaOptions h include include novapi h name of novaPDF SDK 8 define PRINTER NAME novaPDF SDK 8 text to be written in the PDF file define PDF_TEXT Hello world PDF file name define PDF_FILE_ NAMI T E HelloWorld paf novaPDF SDK 8 User Manual Copyright O 2015 Softland 166 novaPDF SDK 8 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
22. sing System Drawing Printing u us us us us u the novapiLib package must be added as a COM reference using novapiLib using System Diagnostics public partial class _Default System Web UI Page protected void Button1l_Click object sender EventArgs e try create the NovaPdfOptions object NovaPdfOptions8 pNova new NovaPdfOptions8 initialize the NovaPdfOptions object pNova InitializeSilent PRINTER_NAME get the active profile string activeProfile null string newProfileld null novaPDF SDK 8 User Manual Copyright 2015 Softland 148 novaPDF SDK 8 pNova GetActiveProfile out activeProfile create new profile pNova AddProfile PROFILE_NAME PROFILE_IS PUBLIC out newProfileld pNova LoadProfile newProfileld and set some options pNova SetOptionString2 NovaOptions NOVAPDF_DOCINFO_SUBJECT ASP NET Hello document pNova SetOptionString NovaOptions NOVAPDF_SAVE_FILE_NAME novaPDFDocument pNova SetOptionLong NovaOptions NOVAPDF_SAVE_FOLDER_TYPE int SaveFolder SAVEFOLDER_CUSTOM pNova SetOptionString NovaOptions NOVAPDF_SAVE_FOLDER Server MapPath upload pNova SetOptionLong NovaOptions NOVAPDF_SAVE_FILEEXIST_ACTION int SaveFileConflictType FILE_CONFLICT_STRATEGY_AUTONUMBER_NEW pNova SetOptionBool NovaOptions NOVAPDF_INFO_VIEWER_ENABLE 1 pNova SetOptionLong NovaOptions NOVAPDF_SAVE_PROMPT_TYPE int Save
23. 2015 Softland 68 novaPDF SDK 8 out BOOL p_pbDispAsBold out BOOL p_pbDispAsItalic out LONG p_pnDispColor y Parameters p_nDefinition in definition index p_pnHeading out heading index p_pbEnabled out definition is enabled p_pbDetFont out detect font flag p_pwsDetFont out font name p_pbDetStyle out detect font style p_pbDetBold out bold font p_pbDetItalic out italic font p_pbDetSize out detect font size p_pnDetSizeVal ou font size p_pnDetSizePt ou font size rounding p_pbDetColor out detect font color p_pnDetColor out font color RGB value p_pbDispAsBold out display bookmark font bold p_pbDispAsItalic out display bookmark font italic p_pnDispColor out display bookmark font color tt erter etree ett oy Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_BOOKMARK_DEF wrong bookmark definition index 2 4 10 4 39 GetBookmarkDefinitionCount The GetBookmarkDefinitionCount method retrieves the number of bookmark definitions in a bookmark heading HRESULT GetBookmarkDefinitionCount out SHORT p_pnCount i Parameters p_pnCount novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 69 out count of bookmark headings Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initial
24. C temp test docx create Word document object Microsoft Office Interop Word Document WordDoc WordApp Documents Open ref strFile ref objFalse ref objTrue objMissing objMissing ref objMissi ref objMissi refRange objMissing obj obj obj obj Missing Missing False False ref objMissi ref objMissi ref objMissing ref objMissing ref ng ref objMissing ref objMissing ref objMissing ref objMissing ref ng ref objMissing ref objMissing ref ob jMissing print document ordApp ActivePrinter PRINTER_NAME ordDoc PrintOutOld ref objFalse ref objFalse ref objMissing ref objMissing ref objMissing ref ng ref objMissing ref objMissing ref objFalse ref objMissing ref ng close Word objects WordDoc Close ref objFalse ref objMissing ref WordApp Quit ref objFalse ref objMissing ref WordApp null Nova AddProfile PROFILE_NAME PROFILE_IS_PUBLIC icrosoft Office Interop Word _ Application WordApp ref novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 165 2 5 6 2 5 6 1 catch System Runtime InteropServices COMException e MessageBox Show e Message catch Exception e MessageBox Show e Message restore active profile if activeProfile Length gt 0 amp amp activeProfile CompareTo PROFILE_NAME 0 pNova SetActiveProfile activeProfile
25. lons LicenseShell PChar so it will converted with Shell le2 strProfileld indow self Handle PChar print Exec lt 32 then begin failed to FALSE EDURE restore original default TForml WndProc var Messag 7 Restore default printer when printing finished Xecut printer m_novaOptions UnRegisterEventWindow m_novaOptions RestoreDefaultPrinter m_bP rintJobPending end else if Message Msg mtWarning end ERROR_MSG_LIC_INFO 0 case en ER en R E en end ERROR_MSG_T Message WParam EMP_FILE MessageDlg Error mbOK 0 Error MessageDlg d ROR_MSG_SAVE MessageDlg d PDF rror F ED FALSE WM_NOVAPDF2_PRINTI of begin TMessage WM_NOVAPDF2_FILESAVED then begin he active profile to be used for printing ions SetActiveProfil Execute ExecuteFile efFileToConvert Text program SW_HID er our window to receive messages from the printer ions RegisterEventW be used by ShellExecute PChar E ERROR then begin saving temporary file on printer server begin reading license information begin saving PDF file MessageDlg Print d ROR_MSG_JOB_CANCEL begin job was canceled mtWarning mbOK mtWarning mbOK 0
26. novaPDF SDK 163 2 5 5 3 Word OLE CSharp The Word OLE CSharp sample is a simple Windows console applicatio document C Test doc to PDF using Word OLE automation Source code using System using System Drawing using System Drawing Printing using System Windows Forms the novapiLib package must be added as a using novapiLib80 COM namespace Hello_World_CSharp class lt summary gt Summary lt summary gt Classl description for Classi 117 aes publ publ publ publ publ publ lt summary gt The main entry point for the app lt summary gt static string PRINT static int NOVAPDF_INFO_SUBJ static string PROFILE_NAME static int PROFILE_IS_PUB static uint NV_PROFILE_EXISTS static uint NV_NO_ACTIVE_PROFIL G nov EC LIS lic liS lic ie lic R_NAME es LIC 0 0 ay Py T Ea E E STAThread static void Main string args create the NovaPdfOptions8080 o NovaPdfOptions80 pNova new NovaP get the active profile string activeProfile ae string _newProfileID r String Empt try initialize the NovaPdfOpt if you have an applicatio SDK n that converts a MS Word reference Ii Gat LON aPDF SDK 8 68 t C OLE xD5DA0006 OxD5DA0028 bject dfOptions80 Yi ions8080 object n license for no
27. 4 10 4 66 GetLayoutOptionBool2 The GetLayoutOptionBool2 method retrieves an option of string type for a layout object HRE SULT GetLayoutOptionBool2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption out BOOL p_pbValue i Parameters p_pwsObjectId novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 83 in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout2 p_nOption in option constant p_pbValue out will contain the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 67 GetLayoutOptionFloat The GetLayoutOptionFloat method retrieves an option of float type for a layout object HRE SULT GetLayoutOptionFloat in string LPWSTR p_pwsObjectld
28. AAA KARA ARA Set save options If optSaveOptions Then objJPDF SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAV Else objPDF SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_NON End If obj JPDF SetOptionLong NOVAPDF_SAVE_FOLD objPDF SetOptionString2 NOVAPDF_SAVE_F obj JPDF SetOptionString2 NOVAPDF_SAVE_F objPDF SetOptionLong NOVAPDF_SAVE_FILE After Save Action E EXTENDED E ER_TYPE SAVEFOLDER_CUSTOM ER txtSaveFolder NAME txtFilename EEXIST_ACTION cboWhenFileExists HO m4 HO obj JPDF SetOptionBool NOVAPDF_ACTION_DEFAULT_VIEWER chkOpenViewer other options save options objPDF SaveProfile Set the PDF print driver objPDF SetActiveProfile2 strNewProfileld Set the Default printer Set Application Printer Application Printers strPDFDriver novaPDF SDK 8 User Manual Copyright O 2015 Softland 146 novaPDF SDK 8 2 5 3 2 5 3 1 Ri Pha aaTantad PARE a araata a Run the selected report and create a DoCmd OpenReport rptSMZipCode Return to previous settings Obj PDF SetActiveProfile2 strActiveProfileld obj PDF DeleteProfile2 strNewProfileld Restore the Defe cinter fault Pri Set Application Pri nter Application Printers strDefaultPrinter End With Exit_cmdCreatePDF_Click Set objPDF Nothing Exit Sub Error_cmdCreatePDF
29. AS 240 241 242 243 244 245 246 247 48 novaPDF SDK 8 User Manual Copyright O 2015 Softland 40 novaPDF SDK 8 NOVAPDF_WTM_TXT_OPACITY 1 100 BOOKMARKS SAVE NOVAPDF_SAVE_PROMPT_TYPE 101 long O standard dialog 1 no dialog 2 simple OS dialog NOVAPDF_SAVE_FOLDER_TYPE 260 long 1 Printing applications s current folder 2 last folder 3 custom folder 4 User s My Documents folder NOVAPDF_SAVE_USER_PASSWORD string network user encrypte password d NOVAPDF_SAVE_FILE_NAME 104 string save file name or a valid macro NOVAPDF_SAVE_FILEEXIST_ACTION 108 O prompt save as dialog 1 autonumber new 2 append date time 3 overwrite 4 auto number existing files 5 append to existing PDF file 6 insert before existing PDF file 7 don t save file novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 41 NOVAPDF_SAVE_APPEND_PASSWORD string password for existing encrypte PDF file if encrypted d NOVAPDE_ACTION_RUN APPLICATION 42 bool false ore ide eel i A ne NOVAPDE_ACTION APPLICATION 43 string NOVAPDF_ACTION_USER_NAME p45 sting gt o NOVAPDF_ACTION_USER_PASSWORD encrypte NOVAPDF_ACTION_CMDLINE_PARAMETERS 47 LAYOUT NOVAPDF_LAYOUT_LEFTANCHOR_USED NOVAPDF_LAYOUT_LEFTANCHOR_OFFSET NOVAPDF_LAYOUT_LEFTANCHOR_USE_PER CENT Type Possible values Default value false false flo
30. Else more serious error propagate it Throw ex End Tf TEY newProfileID As String TEY 1 and make pNova AddProfile PROFI a copy of it A NAME PROFILE __IS_PUBLIC r Catch e As System Runtime InteropServices COM ignore profile exists error Exception If NV_PROFILE_EXISTS e ErrorCode Then System Console WriteLine Profile already Else more serious error propagate it Throw e End If novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 201 End Try load the new profile pNova LoadProfile newProfilelD nova NovaTools and set some uncomment the AddProfileOptions pNova options function calls for the options you wish to set change the options in the nova cs unit NovaTools NovaTools NovaTools NovaTools NovaTools NovaTools Nova Ms ROVA nova HOVA NOVA nova nova nova NOVA HOVA nova NOVA NOVA NOVA nova NOVa HOVA nova Too NovaTools NovaTools NovaTools NovaTools NovaTools NovaTools NovaTools NovaTools NovaTools NovaTools save pNova set pNova the copy print a test profile settings Dim pd As PrintDocument pd PrinterSettings PrinterName AddHandler pd PrintPage AddProfileOptions pNova AddDocument Information pNova AddViewerOptions pNova AddLinksOptions pNova AddAdvancedOptions pNova AddGrap
31. Manual Copyright 2015 Softland 130 novaPDF SDK 8 novaOptions h novaOptions pas Globals bas 2 4 10 4 155 SetOptionString The SetOptionString method sets a printing option of string type HRESULT SetOptionString in LONG p_nOption in LPCWSTR p_wsValue Parameters p_wsOption in option constant p_wsValue in pointer to a null terminated Unicode string containing the value of the of Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 156 SetOptionString2 The SetOptionString2 method sets a printing option of string type HRESULT SetOptionString2 in LONG p_nOption in BSTR p_wsValue i Parameters p_wsOption in option constant p_wsValue in pointer to a null terminated Unicode string containing the value of the of Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_O
32. NV_INVALID_EMAIL email not found NV_INVALID_RECIPIENT recipient not found 2 4 10 4 23 DeleteLayout The DeleteLayout method deletes an existing layout for the specified object HRESULT DeleteLayout in LPCWSTR p_wsObjectId in LPCWSTR p_wsLayoutId i Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_LAYOUT layout not found for specified object novaPDF SDK 8 User Manual Copyright 2015 Softland 62 novaPDF SDK 8 2 4 10 4 24 DeleteLayout2 The DeleteLayout2 method deletes an existing layout for the specified object HRESULT DeleteLayout2 in BSTR p_wsObjectId in BSTR p_wsLayoutId i Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout2 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_LAYOUT layout not found for specified object 2 4 10 4 25 DeleteNovaPrinter The DeleteNovaPrinter method adds a temporary novaPDF printer in the system HRESULT DeleteNovaPrinter in LP
33. O 2015 Softland novaPDF SDK 13 2 2 2 2 2 3 Uninstall You can uninstall the application using the Add Remove Programs icon from the Control Panel System requirements To install novaPDF 8 SDK Developer you need one of the following operating systems e Windows 8 e Windows 8 64 bit e Windows 2012 Server 64 bit e Windows 7 Windows 7 64 bit Windows 2008 Server Windows 2008 Server 64 bit e Windows Vista Windows Vista 64 bit Windows 2003 Server Windows 2003 Server 64 bit e Windows XP Windows XP 64 bit novaPDF 8 SDK Developer requires Microsoft NET Framework 4 If not already installed it will be downloaded and installed by novaPDF 8 SDK Developer setup It needs approximately 160MB of free space Components novaPDF 8 SDK Developer installs files in two folders In C Program Files Softland novaPDF 8 the installer will create the following folder structure Driver Contains printer driver files and some tools like Printer Manager Editor Contains Profile Manager files Server Contains the novaPDF Server service files that works with the profile database SDK Doc Contains the help files and the license files SDK Installer novaPDF SDK 8 User Manual Copyright 2015 Softland 14 novaPDF SDK 8 Contains the msi files that will be injected with your application and license information t be distributed with your application novaPDF8PrinterDriver x64 msi n
34. The GetOptionLong method retrieves a printing option of long int type HRESULT GetOptionLong a LONG p_nOption out LONG p_plValue i novaPDF SDK 8 User Manual Copyright 2015 Softland 90 novaPDF SDK 8 Parameters p_nOption in option constant p_plValue out pointer to a long integer that will contain the value of the retrieved of Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 79 GetOptionString The GetOptionString method retrieves a printing option of string type for a given profile HRESULT GetOptionString in LONG p_nOption out LPWSTR p_pwsValue i Parameters p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant N
35. Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland 106 novaPDF SDK 8 2 4 10 4 107 GetWatermarkTextOptionString2 The GetWatermarkTextOptionString2 method retrieves a watermark text option of string type HRESULT GetWatermarkTextOptionString2 in string BSTR p_pwsWatermarkld in LONG p_nOption out BSTR p_pwsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 p_nOption in option constant p_pwsValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTI
36. a PDF file meaning the client won t see novaPDF in the list of printers e You can integrate it without ordering and purchase a license only after you have fully tested it e The licensed novaPDF SDK COM object lets users create PDFs without the watermark only from your application not by printing directly to the printer Registering the COM object does not register the novaPDF for SDK printer e If you purchase a license you get free priority support Restrictions You are not allowed to create a PDF printer driver using novaPDF SDK or another application similar to a PDF printer driver whose main purpose is to create PDF files You can integrate and distribute novaPDF SDK with your application as long as your application does some mandatory pre processing operations to the resulting PDF files 2 2 Overview 2 2 1 Installation Install To install novaPDF 8 SDK on a computer you need to have administrative rights The installation process does not take much time All you need to do is to follow the instructions of the novaPDF 8 SDK Developer Setup wizard There is no need to reboot at the end of the setup you can run the program right after it is installed on your machine If you have already installed an older version of novaPDF SDK you can install the new version on top of the older one without uninstalling it Your existing option profiles will be preserved when installing a new version novaPDF SDK 8 User Manual Copyright
37. and test it See What sample to choose topic for directions how to choose the best sample for your situation 3 Copy relevant code from the sample in your application Be sure you include all next steps from samples e customize novaPDF SDK 8 settings using INovaPdfOptions80 COM interface for instance set the output file name and folder document info See Profile options topic for a list of all option constants There are global definition files for all supported programming languages e start a print job and write to the printer device context using functions like CreateDC StartDoc StartPage TextOut Or open a file and print it with other methods like calling ShellExecute 4 Test how your application prints to novaPDF SDK 8 When you print to novaPDF SDK 8 the generated PDF files have an unlicensed notice on the bottom of the PDF pages To remove this text please read the How to make the release build topic How to make the release build After you succeeded to integrate novaPDF 8 SDK Developer in your application see How to integrate topic you have to follow next steps 1 Purchase a novaPDF 8 SDK Developer license If you want to remove the novaPDF notice from the generated PDF files you have to purchase a license There are two types of application licenses 1 Software application license this type of license allows you to to develop market and distribute ONE program or ONE software product that integrates the nova
38. can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 169 SetWatermarklmageOptionLong2 The SetWatermarklmageOptionLong2 method sets a watermark image option of long int type HRESULT SetWatermarkImageOptionLong2 in string BSTR p_pwsWatermarkld in LONG p_nOption in LONG p_lValue y Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_lValue in long integer value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 170 SetWatermarklmageOptionString The SetWatermarklmageOptionString method sets a watermark image option of string type HRESULT SetWatermarkImageOptionString in strin
39. error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 77 GetOptionEncryptedString2 The GetOptionEncryptedString method retrieves an option of type encrypted string HRESULT GetOptionEncryptedString in LONG p_nOption out BSTR p_pwsValue i Parameters p_nOption in option constant p_pwsValue out pointer to a pointer to a BSTR string that will contain the value of the Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 78 GetOptionLong
40. 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 CoCreatelnstance __uuidof NovaPdfOptions80 NULL CLSCTX_INPROC_SERVER if FAILED hr MessageBox NULL L Failed to create novaPDF COM object L novaPDF B_OK return hr initialize the NovaPdfOptions object to use with a printer licensed for SDK hr pNova gt Initialize PRINTER_NAME L if SUCCEEDED hr LPWSTR pwsOldActiveProfileID NULL LPWSTR pwsNewProfileID NULL hr pNova gt GetActiveProfile amp pwsOldActiveProfileID create a new profile with default settings hr pNova gt AddProfile PROFILE_NAME PROFILE_IS PUBLIC amp pwsNewProfileID load the newly created profile if SUCCEEDED hr 88 pwsNewProfileID else hr pNova gt LoadProfile pwsNewProfileID MessageBox NULL L Failed to create profile L novaPDF MB_OK return hr set PDF document Title pNova gt SetOptionString NOVAPDF_DOCINFO_TITLE L My Doc Title what type of save dialog to be shown none simple or extended novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 167 pNova gt SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT _SAVE_SIMPLE you may choose a predefined folder like
41. jNovaOptios As NovaPdfOptions80Class 2 Initialize INovaPdfOptions mobjNovaOptios New NovaPdfOptions80Class initialize the NovaPdfOptions object mob jNovaOptios Initialize PRINTER_NAME AddSmallProfile AddFullProfile 3 Set novaPDF SDK 8 Options Ley Dim newSmallSizeProfilelId As String add new profile mob jNovaOptios AddProfile SMALL_SIZE_PROFILE PROFILE_IS_PUBLIC newSmallSizeProfileld load the new profile mob jNovaOptios LoadProfile newSmallSizeProfileld Set some options to this profile disable the Save PDF file as prompt novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 203 2 5 9 3 mob jNovaOptios SetOptionLong NovaOptions NOVAPDF_SAVE_PROMPT_TYP set generated Pdf files destination folder c El 0 mob jNovaOptios SetOptionString NovaOptions NOVAPDF_SAV T FOLDER c PI reksa Catch ComException As System Runtime InteropServices COMException MessageBox Show Error creating Small Size Profile Microsoft VisualBasic Chr 13 T amp Microsoft VisualBasic Chr 10 ComException Message System Diagnostics Debug WriteLine ComException Message End Try 4 Start a Print job Private Sub btnStartPrinting_Click ByVal sender As System Object ByVal e As System EventArgs Handles btnStartPrinting Click
42. method or if you print an existing document using ShellExecute function you should check the MFC Converter sample 2 If you create a printer job using Windows API calls like OpenPrinter StartDoc you should check the Hello World sample 3 If your application runs on a network check the Hello World network sample 4 If you have a document view MFC architecture check the MFC Scribble sample 5 If you have an ASP NET application that prints using the package System Drawing Printing check the Hello World ASPNET sample 6 If you have a Delphi application and you print using the Printer object provided by Delphi novaPDF SDK 8 User Manual Copyright O 2015 Softland 144 novaPDF SDK 8 2 5 2 2 5 2 1 check the Hello World Delphi sample 7 If you have a Delphi application and you print using ShellExecute or you want to handle printing events check the VCLConverter sample 8 If you have a C application that prints using the package System Drawing Printing check the Hello World CSharp sample 9 If you have a C application and intend to convert existing files to PDF see the CSharp Converter sample 10 If you have an Java application that prints using the package System Drawing Printing check the Hello World Java sample 11 If you have a VB application and you print using the Printer object provided by VB check the Hello World VB sample 12 If you have a VB application and you print usi
43. no profile loaded 2 4 10 4 16 CopyProfile The CopyProfile method copies an existing profile to a new profile HRESULT CopyProfile in string LPCWSTR p_wsNewProfileName in BOOL p_bPublicProfile in string LPCWSTR p_wsOldProfileld out LPWSTR p pwsNewProfileld novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 59 i Parameters p_wsNewProfileName in name of the new profile p_bPublicProfile in Flag if the profile is a public or a private profile p_wsOldProfileld in id for the profile to be copied p_pwsNewProfileld out the new profile id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_PROFILE_SAVE_ERROR cannot save new profile 2 4 10 4 17 CopyProfile2 The CopyProfile2 method copies an existing profile to a new profile HRESULT CopyProfile2 in string BSTR p_wsNewProfileName in BOOL p_bPublicProfile in string BSTR p_wsOldProfileld out LPWSTR p_pwsNewProfileld Parameters p_wsNewProfileName in name of the new profile p_bPublicProfile in Flag if the profile is a public or a private profile p_wsOldProfileld in id for the profile to be copied p_pwsNewProfileld out the new profile id Return values S_OK on success or COM error
44. no profile loaded NV_INVALID_WATERMARK_IMG wrong image watermark index 2 4 10 4 89 GetWatermarklmageCount The GetWatermarklmageCount method retrieves the number of image watermarks HRESULT GetWatermarkImageCount out SHORT p_pnCount i Parameters p_pnCount out count of image watermarks Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded 2 4 10 4 90 GetWatermarklmageOptionBool The GetWatermarklmageOptionBool method retrieves a watermark image option of boolean type HRESULT GetWatermarkImageOptionBool in string LPWSTR p_pwsWatermarkId in LONG p_nOption novaPDF SDK 8 User Manual Copyright 2015 Softland 96 novaPDF SDK 8 out BOOL p_pbValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_nOption in option constant p_plValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings
45. option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects novaPDF SDK 8 User Manual Copyright 2015 Softland 86 novaPDF SDK 8 2 4 10 4 71 GetLayoutOptionString The GetLayoutOptionString method retrieves an option of string type for a layout object HRE SULT GetLayoutOptionString in string LPWSTR p_pwsObjectld in string LPWSTR p_pwsLayoutld in LONG p_nOption out LPWSTR p_pwsValue gt Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaO
46. or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded Remarks novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 57 The newly created watermark contains default settings Use the watermark id and layout id as parameters for set watermark and layout options functions For layout options see Working with Layout objects 2 4 10 4 12 AddWatermarklmage2 The AddWatermarklmage2 method adds a new image watermark HRESULT AddWatermarkImage2 out string BSTR p_pwsNewWatermarkId out string BSTR p_pwsNewLayoutId i Parameters p_pwsNewWatermarkld out string return new watermark id p_pwsNewLayoutld in string return layout id for the new watermark Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded Remarks The newly created watermark contains default settings Use the watermark id and layout id as parameters for set watermark and layout options functions For layout options see Working with Layout objects 2 4 10 4 13 AddWatermarkText The AddWatermarktext method adds a new text watermark HRESULT AddWatermarkText out string LPWSTR p_pwsNewWatermarkId out string LPWSTR p_pwsNewLayoutld i Parameters p_pwsNewWatermarkld out string return new watermark id p_pwsNewLayoutld in string return layout id fo
47. our nova options object if m_novaOptions m_novaOptions gt Release uninitialize COM libraries CoUninitialize les 5 Set novaPDF SDK 8 Options BOOL CnovaPrintDlg OnInitDialog Add a profile called Small size If profile L Small size exists this will fail hr m_novaO0ptions gt AddProfile SMALL SIZE_PROFIL m_wsProfileSmall E r load the newly created profile if SUCCEEDED hr amp amp m_wsProfileSmall load profile m_novaOptions gt LoadProfile m_wsProfileSmall SS disable the Save PDF file as prompt NE set generated Pdf files destination folder PROMPT_SAVE 3 N23 0 LOCATION_TYP E LOCAL PROFIL novaOptions gt SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE T EIS PUBLIC Mos novaOptions gt SetOptionLong NOVAPDF_SAVE_LOCATION 3 nova0ptions gt SetOptionLong NOVAPDF_SAVE_FOLD ER_TYPE SAVEFOLDER_CUSTOM m_novaOptions gt SetOptionString NOVAPDF_SAVE_FOLDER szExeDirectory set output file name m_novaOptions gt SetOptionString NOVAPDF_SAVE_FILI E NAME L PDF Converter small size pdf if file exists in the destination folder to the end of the file name append a counter T m_novaOptions gt SetOptionLong NOVAPDF_SAVE_FIL FI
48. out string BSTR out string BSTR y Parameters p_nIndex in recipient index p_nIndex p_pwsEmailld p_pwsRecipientld p_pwsF rom p_pwsTo p_pwsCC p_pwsBCC novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 77 p_pwsEmailld in email id p_pwsRecipientld out recipient id p_pwsF rom out From address p_pwsTo out To address p_pwsCcC out CC address p_pwsBCC out BCC address Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL email not found NV_INVALID_RECIPIENT no recipient for the given index 2 4 10 4 55 GetEmailRecipientCount The GetEmailRecipientCount method retrieves the count of recipients in the specified email HRESULT GetEmailRecipientCount in string LPWSTR p_pwsEmailld out LONG p_pnCount i Parameters p_pwsEmaillid in email id obtained with GetEmail or AddEmail p_pnCount out email recipients count Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMATL email not found 2 4 10 4 56 GetEmailRecipientCount2 The GetEmailRecipientCount method retrieves the count of recipients in the specified email HRESULT GetEmailRecipientCount in string BST
49. profile makes a copy of it into a profile called Test CH sets the new profile as active sets the subject of the generated PDF document prints a page and restores original printer settings The location of the generated document depends on whatever the settings are for the current active profile Notice Because of the specific exception based error handling in NET all calls to methods in the INovaPDFOptions interface must be nested within a try catch block Consider for example that we want to add a profile called test but the profile test already exists Then the call pNova AddProfile test will throw an System Runtime InteropServices COMException with the ErrorCode property set to NV_PROFILE_EXISTS 0xD5DA0006 Source code using System using System Drawing using System Drawing Printing using System Windows Forms the novapiLib package must be added as a COM refference using novapiLib80 using Globals namespace Hello_World_CSharp lt summary gt Summary description for Classi lt summary gt class Classl lt summary gt The main entry point for the application lt summary gt public static string PRINTER_NAME novaPDF SDK 8 public static string PROFILE_NAME HelloWorld public static int PROFILE IS PUBLIC 0 public static string PDF_TEXT Hello World public static string PDF_FILE_NAME HelloWorld pdf ST
50. string in LONG in LONG Parameters p_pwsEmaillid in email id p_wsOption BSTR p_pwsEmailld p_nOption p_lValue obtained with GetEmail2 or AddEmail2 in option constant p_lValue in the value of the option to set Return values S_OK on success or NV_NOT_INITIALIZED NV_UNKNOWN_PROFILE NV_INVALID_EMAIL COM error code Initialize was not called no profile loaded wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 137 SetEmailOptionString The SetEmailOptionString method sets an option of string type for an email HRESULT SetEmailOptionString Lin String in LONG LPWSTR p_pwsEmailld p_n Option in LPCWSTR p_wsValue Parameters p_pwsEmaillid in email id obtained with GetEmail or AddEmail novaPDF SDK 8 User Manual Copyright 2015 Softland 120 novaPDF SDK 8 p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error c
51. user interaction and the print job is completed on the printer server You can configure private or public profiles on the printer server Public profiles will be visible on all client computers and all users Private profiles are visible only for the user that created them See Private and public profiles for more details The COM has to be installed and registered on every computer that uses it see here How to register COM An alternative solution is to use the reg free registration free COM technology that enables your application to use the COM without registering it You just have to import the COM manifest in your application and copy the COM dll in the same folder with your application executable you need the novapi80 dll and novasv8 dll novaPDF SDK 8 User Manual Copyright O 2015 Softland 16 novaPDF SDK 8 2 2 5 2 3 2 3 1 Multiple printers There can be added several printers each of them using a different active profile In this way the users will decide to which printer to print instead of using the same printer and changing its active profile novaPDF printers can be added manually from the Printer Manager tool On the first page there can be added deleted printers and on the second page there can be set which public profiles to be used with each printer This can be also configured by running some command line tools if you wish to include in your setup To add a printer call the PrinterMa
52. var BuildNumber Cache yes Cacheld DriverPackageldx86 var MajorVersion var MinorVersion f var BuildNumber DisplayInternalUI no EnableFeatureSelection yes ForcePerMachine yes Compressed yes SourceFile var DriverKit86 Visible yes Vital yes InstallCondition NOT VersionNT64 gt lt MsiPackage gt lt MsiPackage Id DriverPackagex64 var MajorVersion f var MinorVersion var BuildNumber Cache yes Cacheld DriverPackageldx64 var MajorVersion var MinorVersion f var BuildNumber DisplayInternalUI no EnableFeatureSelection yes ForcePerMachine yes Compressed yes SourceFile var DriverKit64 Visible yes Vital yes InstallCondition VersionNT64 gt lt MsiPackage gt lt oem product gt lt MsiPackage Id OemPackagex86 var MajorVersion var MinorVersion var BuildNumber Cache yes Cacheld OemPackageIdx86 var MajorVersion var MinorVersion var BuildNumber DisplayInternalUI no EnableFeatureSelection no ForcePerMachine yes Compressed yes SourceFile var OemKit86 Visible no Vital yes InstallCondition NOT VersionNT64 gt lt MsiPackage gt lt MsiPackage Id OemPackagex64 var MajorVersion var MinorVersion f var BuildNumber Cache yes Cacheld OemPackageIdx64 var MajorVersion var MinorVersion var BuildNumber DisplayInternalUI no EnableFeatureSelection no ForcePerMachine yes Compressed yes S
53. 5 Softland novaPDF SDK 177 SAVEFOLDER_MYDOCUMENTS set a macro for the file name pNova gt SetOptionString NOVAPDF_SAVE_FILE_NAME L test_ N in case a file with the same name exists in the selected folder choose what to do pNova gt SetOptionLong NOVAPDF_SAVE_FILEEXIST_ACTION FILE_CONFLICT_STRATEGY_AUTONUMBER_NEW save profile changes hr pNova gt SaveProfile set as active profile for printer pNova gt SetActiveProfile pwsNewProfilelD HANDLE hPrinter PDEVMODE pDevmode NULL PRINTER_DEFAULTS pd NULL NULL start print job if Open Printer PRINTER NAME get default printer DEVMODE amp hPrinter PRINTER_ACCESS_USE y amp pd int nSize DocumentProperties NULL hPrinter PRINTER_NAME NULL NULL 0 pDevmode PDEVMODEW LocalAlloc LPTR nSize DocumentProperties NULL hPrinter PRINTER_NAME pDevmode NULL DM_OUT_BUFFER set page size in DEVMODE pDevmode gt dmPaperSize DMPAPER_USER pDevmode gt dmPaperLength 2970 pDevmode gt dmPaperWidth 2100 pDevmode gt dmFields DM_PAPERSIZE DM_PAPERLENGTH DM_PAPERWIDTH DocumentProperties NULL hPrinter PRINTER_NAME pDevmode pDevmode DM_IN_BUFFER DM_OUT_BUFFER Print a p
54. 5 Softland novaPDF SDK 67 p_pnHeading out heading index p_pbEnabled out definition is enabled p_pbDetFont out detect font flag p_pwsDetFont out font name p_pbDet Style out detect font style p_pbDetBold ou bold font p_pbDetItalic out italic font p_pbDetSize out detect font size p_pnDetsizeVal ou font size p_pnDetSizePt ou font size rounding p_pbDetColor out detect font color p_pnDetColor out font color RGB value p_pbDispAsBold out display bookmark font bold p_pbDispAsItalic out display bookmark font italic p_pnDispColor out display bookmark font color Gh igh ct etch etch etch ca Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_BOOKMARK_DEF wrong bookmark definition index 2 4 10 4 38 GetBookmarkDefinition2 The GetBookmarkDefinition2 method retrieves an existing bookmark definition properties HRESULT GetBookmarkDefinition2 in SHORT p_nDefinition out SHORT p_pnHeading out BOOL p_pbEnabled out BOOL p_pbDetFont out string BSTR p_pwsDetFont out LONG p_pnDetFontType out BOOL p_pbDetStyle out BOOL p_pbDetBold out BOOL p_pbDetItalic out BOOL p_pbDetSize out INT p_pnDetSizeVal out FLOAT p_pnDetSizePt out BOOL p_pbDetColor out LONG p_pnDetColor novaPDF SDK 8 User Manual Copyright
55. 9 Working with Layout In the Profile Manger tool there is a page called Layout where different objects can be placed and arranged with anchors on the page There can be added image watermarks text watermarks overlay pdf document signature Also the printed page content itself can be arranged how to fit on the PDF page For each object there can be specified the anchors relative to the page left right top bottom center vertically or center horizontally The values can be absolute or in percentage relative to the page width and height When adding such an object from source code you have to specify all these settings that you can also find on the Layout page anchors flags and values size rotation keep aspect ratio flag Beside these settings there also have to be passed to novaPDF printer driver more detailed information about the object position You can see this information on the Layout tab when you open the Profile Manager tool from the SDK Printer Manager tool Select one object in the Layout list of objects and under the list beside the object name there is a button that opens a window showing all the information as it should be set in the profile options If you wish to add one of these objects in the profile configure first how it should appear on page using the Profile Manager tool then copy generated settings in the source code x 2 4 10 Reference 2 4 10 1 Profile option strings novaPDF SDK 8 settings are saved i
56. AThread static void Main string args LEY novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 159 nActivePublic e ErrorCode create the NovaPdfOptions object NovaPdfOptions80 pNova new NovaPdfOptions80 initialize the NovaPdfOptions object pNova Initialize PRINTER_NAME get the active profile string activeProfile null bool isActiveProfile true pNova GetActiveProfile out activeProfile out Ley pNova GetActiveProfile out activeProfile catch System Runtime InteropServices COMException e isActiveProfile false ignore profile exists error if NovaErrors NV_NO_ACTIVE_PROFILE uint System Console WriteLine The printer does not have an active profile _newProfilelD set else more serious error propagate it throw e string _newProfileID String Empty add a new profile pNova AddProfile PROFILE_NAME PROFILE_IS_ PUBLIC out load the new profile pNova LoadProfile _newProfilelD nova NovaTools AddProfileOptions pNova and set some options uncomment the function calls for the options you wish to change the options in the nova cs unit nova NovaTools AddProfileOptions pNova nova NovaTools AddDocument Information pNova nova NovaTools AddViewerOptions pNova nova NovaTools AddLinksOptions pNova nova NovaTools AddAdvancedOptions pNova
57. BOOL p_bEnabled in BOOL p_bDetFont in string LPCWSTR p_wsDetFont in BOOL p_bDetStyle in BOOL p_bDetBold in BOOL p_bDetItalic in BOOL p_bDetSize in FLOAT p_nDetSizeVal in FLOAT p_nDetSizePt in BOOL p_bDetColor in LONG p_nDetColor in BOOL p_bDispAsBold in BOOL p_bDispAsItalic in LONG p_nDispColor Parameters p_nDefinition in definition index p_nHeading in heading index p_bEnabled in definition is enabled p_bDetFont in detect font flag novaPDF SDK 8 User Manual Copyright 2015 Softland 112 novaPDF SDK 8 p_wsDetFont in font name p_bDetStyle in detect font style p_bDetBold in bold font p_bDetItalic in italic font p_bDetSize in detect font size p_nDetSizeVal in font size p_nDetSizePt in font size rounding p_bDetColor in detect font color p_nDetColor in font color RGB value p_bDispAsBold in display bookmark font bold p_bDispAsItalic in display bookmark font italic p_nDispColor in display bookmark font color p_wsProfileName in pointer to a null terminated Unicode string containing the profile to modi p_bPublicProfile in Flag if the profile is a public or a private profile Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_BOOKMARK_DEF wrong bookmark defini
58. CWSTR p_wsPrinterName i Parameters p_wsPrinterName in pointer to a null terminated Unicode string containing the name of the pri Return values S_OK on success or COM error code NV_INVALID_PRINTER_NAME not a novaPDF printer NV_ERROR_DELETE_PRINTER there was an error when deleting the printer Remarks This method must be called for printers added with AddNovaPrinter method after finish printing documents It will delete the temporary printer from the system Use this method if you wish to work with temporary printers 2 4 10 4 26 DeleteNovaPrinter2 The DeleteNovaPrinter2 method adds a temporary novaPDF printer in the system HRESULT DeleteNovaPrinter2 in BSTR p_wsPrinterName i Parameters p_wsPrinterName in name of the printer to be deleted Return values S_OK on success or COM error code novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 63 NV_INVALID_PRINTER_NAME not a novaPDF printer NV_ERROR_DELETE_PRINTER there was an error when deleting the printer Remarks This method must be called for printers added with AddNovaPrinter method after finish printing documents It will delete the temporary printer from the system Use this method if you wish to work with temporary printers 2 4 10 4 27 DeletePrinterActivePublicProfile The DeletePrinterActivePublicProfile method removes the active public profile setting for a printe
59. D Develop PDFS8 AuthCertificate makecert signtool exe sign f lt your signature file gt p lt your signature password gt du lt your company site gt t http timestamp verisign com scripts timstamp dll C Users Public Documents novaPDF 8 OEM Samples OEMBundle OEMBundle bin Release tmp exe C Program Files x86 WiX Toolset v3 9 bin insignia exe ab C Users Public Documents novaPDF 8 OEM Samples OEMBundle OEMBundle bin Release tmp exe C Users Public Documents novaPDF 8 OEM Samples OEMBundle OEMBundle bin Release OEMBundle exe o C Users Public Documents novaPDF 8 OEM Samples OEMBundle OEMBundle bin Release OEMBundle exe Installation package bundle This is a sample on how to compress the msi installations packages in a bundle and generate an setup executable to install novaPDF 8 SDK Developer If you haven t already done so you will need to install the Wix Toolset to build this project The project contains two files 1 Variables wxi contains variables for application name company name version it s important to change the UpgradeCode to an unique new GUID for your application 2 Bundle wxs contains the msi files that need to be included and the execution order Net Framework 4 is required by novaPDF 8 SDK Developer and is set as prerequisite Variables wxi novaPDF SDK 8 User Manual Copyright 2015 Softland 22 novaPDF SDK 8 lt xml version 1 0 encoding utf 8 gt lt
60. DF SDK 8 options by calling SetOptionString or SetOptionLong methods You can also manage profiles with AddProfile CopyProfile DeleteProfile GetFirstProfile GetNextProfile GetActiveProfile SetActiveProfile methods A good sample for how to use this methods is the MFC Converter sample Also all Hello World samples have a nova unit where there are samples on how to set all options 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 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 e use Win32 API functions OpenPrinter DocumentProperties CreateDC StartDoc StartPage See the Hello World sample e print a file using the ShellExecute function For a sample see MFC Converter e 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 How to set printer opt
61. DlgType PROMPT_SAVE_SIMPLE save the new added profile pNova SaveProfile set the new profile as the active profile pNova SetActiveProfile newProfileld print a test page using the previously set active profile settings using PrintDocument pd new PrintDocument pd PrintController new StandardPrintController pd PrinterSettings PrinterName PRINTER_NAME pd PrintPage new PrintPageEventHandler PrintPageFunction pd Print if activeProfile Length gt amp amp activeProfile CompareTo PROFILE NAME pNova DeleteProfile newProfileld mark finish changing options so they are saved for the pNova SetActiveProfile activeProfile printer Label1 Text Success lt br gt You will find the new printed file in upload folder Button1 Visible false Link1 Visible true Link1 Attributes Add href upload Link1 Attributes Add target _ blank catch System Runtime InteropServices COMException come novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 149 2 5 4 2 5 4 1 Label1 Style Add color red Label1 Text COM Exception come Message catch Exception ee Label1 Style Add color red Label1 Text Exception ee Message return and finally the function that actually prints the page private static void PrintPageFunction object sender PrintPageEventArgs ev
62. Execute function for the given parameter This call assures that the document will be printed without the notice on bottom of pages even if the application that prints the document is already opened 2 4 10 4 119 LoadProfile The LoadProfile method loads an existing profile HRESULT LoadProfile in LPCWSTR p_wsProfileld i Parameters p_wsProfileld in pointer to a null terminated Unicode string containing the id of the profi novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 111 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR error connecting to novaPDF Server servic NV_PROFILE_ERROR error reading profiles 2 4 10 4 120 LoadProfile2 The LoadProfile2 method loads an existing profile HRESULT LoadProfile2 in BSTR p_wsProfileld i Parameters p_wsProfileld in id of the profile to load Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR error connecting to novaPDF Server servic NV_PROFILE_ ERROR error reading profiles 2 4 10 4 121 ModifyBookmarkDefinition The ModifyBookmarkDefinition method modifies an existing bookmark definition having the characteristics specified by the method parameters HRESULT ModifyBookmarkDefinition in SHORT p_nDefinition in SHORT p_nHeading in
63. Float2 GetWatermarkTextOptionString GetWatermarkTextOptionString2 GetWatermarkTextOptionLong GetWatermarkTextOptionLong2 GetWatermarkTextOptionBool GetWatermarkTextOptionBool2 GetWatermarkTextOptionFloat GetWatermarkTextOptionFloat2 Layout options SetLayoutOptionString SetLayoutOptionString2 SetLayoutOptionLong SetLayoutOptionLong2 SetLayoutOptionBool SetLayoutOptionBool2 SetLayoutOptionFloat SetLayoutOptionFloat2 GetLayoutOptionString GetLayoutOptionString2 GetLayoutOptionLong GetLayoutOptionLong2 GetLayoutOptionBool GetLayoutOptionBool2 GetLayoutOptionFloat GetLayoutOptionFloat2 GetLayoutCount GetLayoutCount2 GetLayout GetLayout2 DeleteLayout DeleteLayout2 Email options AddEmail AddEmail2 GetEmail GetEmail2 GetEmailCount DeleteEmail DeleteEmail2 SetEmailOptionString novaPDF SDK 8 User Manual Copyright 2015 Softland 48 novaPDF SDK 8 SetEmailO0ptionString2 SetEmailO0ptionLong SetEmailO0ptionLong2 SetEmailOptionBool SetEmailOptionBool2 GetEmailOptionString GetEmailOptionString2 GetEmailOptionLong GetEmailOptionLong2 GetEmailOptionBool GetEmailOptionBool2 SetEmailOptionEncryptedString SetEmailOptionEncryptedString2 GetEmailOptionEncryptedString GetEmailOptionEncryptedString2 AddEmailRecipient AddEmailRecipient2 DeleteEmailRecipient DeleteEmailRecipient2 GetEmailRecipientCount GetEmailRecipientCount2 GetEmailRecipient GetEmailRecipient2 Signature options GetSignature Ge
64. GetEmail2 or AddEmail2 p_nOption in option constant p_bValue out pointer to a pointer to bool that will contain the value of the retrievec Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type bool Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 47 GetEmailOptionEncryptedString The GetEmailOptionEncryptedString method retrieves an option of encrypted string type for an email HRESULT GetEmailOptionEncryptedString in string LPWSTR p_pwsEmailld in LONG p_nOption out LPWSTR p_pwsValue Parameters p_pwsEmailld in email id obtained with GetEmail or AddEmail p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contal Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id n
65. HANGEEXTENSTON NOVAPDF_EMATL_LOOKUP_ADDRESS NOVAPDF_EMATL_DELETE_PDF NOVAPDF_SMTP_SERVER NOVAPDF_SMTP_PORT NOVAPDF_SMTP_ACCOUNT NOVAPDF_SMTP_PASSWORD NOVAPDF_SMTP_AUTHENTICATION NOVAPDF_SMTP_SSL OVERLAY NOVAPDF_OVERLAY_FILE NOVAPDF_OVERLAY_FILE_LOCATION NOVAPDF_OVERLAY_FILE_PASSWORD NOVAPDF_OVERLAY_USER_NAME NOVAPDF_OVERLAY_USER_PASSWORD NOVAPDF_OVERLAY_REPEAT_TYPE false true string E sd bool false in re AA se AA ase EA re es ACT string encrypte d t E Type Possible values Default value Gane JO 93 1 Local 1 2 Server 97 password for the encrypte overlay PDF file if encrypted 94 string user name for network path 95 string user password encrypte d id eee 1 repeat last page 2 repeat all pages novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 39 NOVAPDF_OVERLAY_OPACITY 100 tong Jo 100 IMAGE WATERMARKS NOVAPDF_WTM_IMG_IMAGE_LOCATION 201 long 1 Local 1 A Pe e NOVAPDF_WTM_IMG_IMAGE_USER_NAME 202 string user name for e Gad e Co NOVAPDF_WTM_IMG_IMAGE_USER_PASSWOR 203 string user password D encrypte 10 NOVAPDF_WTM_ IMG VISIBILITY EXPORT TEXT WATERMARKS NOVAPDE_WTM_TXT_WATERMARK_TEXT NOVAPDF_WTM_TXT_FONT_NAME 240 241 NOVAPDF_WTM_TXT_FONT_TYPE long O TrueType 1 Typel 2 OpenType TrueType 3 OpenType Tpe1 243 244 245 246 247 sacar
66. IC m_strSmallSizeProfilelD m_nova0ptions LoadProfile2 m_strSmallSizeProfilelD T Set some options to this profile disable the Save PDF file as prompt m_novaOptions SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_NONE set generated Pdf files destination folder to the application m_novaOptions SetOptionLong NOVAPDF_SAVE_FOLDER_TYPE SAVEFOLDER m_novaOptions SetOptionString2 NOVAPDF_SAVE_FOLDER ExtractFilePath Application ExeName set output file name m_novaOptions SetOptionString2 NOVAPDF_SAVE_FILE_NAME PDF Converter small size pdf Set other options and profiles Lea END 6 Start a print job PROCEDURE TForml btnStartPrintClick Sender TObject var hExec HINST novaPDF SDK 8 User Manual Copyright O 2015 Softland 152 novaPDF SDK 8 BEGIN ay eae sett m Es m hExec efFileToConvert Text if hl E PROC BEGIN if Message Msg novaOpt regist novaOpt set NO novaOpt licens novaOpt the fil vaPDF as default printer ions SetDefaultPrinter to b print the document _ bPrintJobPending TRUE ShellAPI ShellExecute self handle m_bPrintJobPending m_novaOptions UnRegisterEventWindow m_novaOptions RestoreDefaultPrinter end ND
67. ION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 152 SetOptionEncryptedString The SetOptionEncryptedString method sets an encrypted string option HRESULT SetOptionEncryptedString in LONG p_nOption in LPCWSTR p_wsValue i Parameters p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 129 novaOptions h novaOptions pas Globals bas 2 4 10 4 153 SetOptionEncryptedString2 The SetOptionEncryptedString2 method sets an encrypted string option HRESULT SetOptionEncryptedString2 in LONG p_nOption in BSTR p_wsVa
68. If the definition Return values S_OK on success or COM error code was not added 1 novaPDF SDK 8 User Manual Copyright 2015 Softland 52 novaPDF SDK 8 NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded Remarks There can be defined maximum 9 bookmark definitions 2 4 10 4 3 AddEmail The AddEmail method adds a new email HRESULT AddEmail out string LPWSTR p_pwsNewEmailld i Parameters p_pwsNewEmailld out return email id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded Remarks The newly created email contains default settings and no email recipients 2 4 10 4 4 AddEmail2 The AddEmail2 method adds a new email HRESULT AddEmail2 out string BSTR p_pwsNewEmailld i Parameters p_pwsNewEmailld out return email id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded Remarks The newly created email contains default settings and no email recipients 2 4 10 4 5 AddEmailRecipient The AddEmailRecipient method adds a new email recipient HRESULT Addi EmailRecipient novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 53 in string LPWSTR p_wsEmailld ou
69. Include gt lt define BundleName My SDK Application Bundle gt lt change the UpgradeCode to an unique new GUID for your application gt lt define UpgradeCode EE97F3F2 C42F 4EF5 A68A 2319590A5ECF gt lt define AboutUrl http www novapdf com gt lt define SplashImage gt lt define IconFile gt lt define MyLicenseFileName C ProgramData Softland novaPDF 8 nPdfSdk8_Softland nPdfSdk8_ SoftlandEulaExt rtf gt lt version gt lt define MajorVersion 8 gt lt define MinorVersion 0 gt lt define BuildNumber 908 gt lt manufacturing gt lt define Manufacturer lt My SDK Company Name gt gt lt product name gt lt define ProductName lt My SDK Application Name gt gt lt full product name gt lt define FullProductName var ProductName var MajorVersion gt lt bundle specific gt lt define Driverkit86 C Users Public Documents novaPDF 8 SDK Branding novaPDF8PrinterDriver x86 msi gt lt define Driverkit64 C Users Public Documents novaPDF 8 SDK Branding novaPDF8PrinterDriver x64 msi gt lt define COMPathx64 C Users Public Documents novaPDF 8 SDK Branding novaPDF8COM x64 msi gt lt define COMPathx86 C Users Public Documents novaPDF 8 SDK Branding novaPDF8COM x86 msi gt lt define OemKit86 C Users Public Documents novaPDF 8 SDK Branding novaPDF8SDK x86 msi gt lt define OemKkit64 C U
70. K 8 User Manual Copyright O 2015 Softland 210 novaPDF SDK 8 Licenseshellexecutefile 110 Make the release build 17 MFC Converter 169 MFC Scribble 173 Modifybookmarkdefinition 111 Modifybookmarkdefinition2 112 N Network auto install 15 or ole 187 P PDF reports 144 Private Public Profiles 27 R Register COM 25 Register messages 27 Registereventwindow 113 RegisterNovaEvent 114 RegisterNovaEvent2 114 Registry Keys 30 Restoredefaultprinter 114 O Set printer options 26 Setactiveprofile 115 Setactiveprofile2 115 Setdefaultprinter 116 Setoptionlong 129 Setoptionstring 130 Setoptionstring2 130 SetPrinterOption 131 System requirements 13 oT Terminal services 12 U Uninstall 12 Unregistereventwindow 143 Use COM 26 Use Events 28 sWe VB converter 194 VCL converter 149 W WaitForNovaEvent 143 Windows messages 44 word ole 187 Word OLE CSharp 163 Word OLE Delphi 155 Word OLE VB 198 novaPDF SDK 8 User Manual Copyright 2015 Softland
71. K 8 User Manual Copyright 2015 Softland 140 novaPDF SDK 8 Parameters p_pwsWatermarkIid in watermark id obtained with GetWatermarkText p_nOption in option constant p_fValue in float value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 175 SetWatermarkTextOptionFloat2 The SetWatermarkTextOptionFloat2 method sets a watermark text option of float type HRESULT SetWatermarkTextOptionFloat2 in string BSTR p_pwsWatermarkld in LONG p_nOption in FLOAT p_fValue Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 p_nOption in option constant p_fValue in float value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong optio
72. LE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include novaPDF SDK 8 User Manual Copyright 2015 Softland 118 novaPDF SDK 8 folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 134 SetEmailOptionEncryptedString2 The SetEmailOptionEncryptedString2 method sets an option of encrypted string type for an email HRESULT SetEmailOptionEncryptedString2 in string BSTR p_pwsEmailld in LONG p_nOption in BSTR p_wsValue i Parameters p_pwsEmaillid in email id obtained with GetEmail2 or AddEmail2 p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option s
73. LETE_ERROR error deleting profile NV_PROFILE_ERROR error reading profiles 2 4 10 4 30 DeleteProfile2 The DeleteProfile2 method deletes an existing profile HRESULT DeleteProfile 2 in BSTR p_wsProfileld i Parameters p_wsProfileld in the id of the profile to delete Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called ERROR error connecting to novaPDF Server servic NV_SERVICE_ NV_PROFILE_DELETE_ERROR error deleting profile NV_PROFILE_ERROR error reading profiles 2 4 10 4 31 DeleteWatermarklmage The DeleteWatermarklmage method deletes an existing watermark image HRESULT DeleteWatermarkImage in string LPCWSTR p_wsWatermarkld Parameters p_wsWatermarkId in pointer to a null terminated Unicode string containing the watermark id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong image watermark index 2 4 10 4 32 DeleteWatermarklmage2 The DeleteWatermarklmage2 method deletes an existing watermark image HRESULT DeleteWatermarkImage2 in string BSTR p_wsWatermarkId i novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 65 Parameters p_wsWatermarkId in the watermark id Return valu
74. LE_CONFLICT_STRATEGY_AUTONUMBER_NEW EXIST_ACTION novaPDF SDK 8 User Manual Copyright 2015 Softland 172 novaPDF SDK 8 Set other options LA bias save profile changes m_novaOptions gt SaveProfile 6 Start a print job void CnovaPrintDlg OnBnClickedOk ET soa HRESULT hr S_OK set the active profile to be used for printing hr m_novaOptions gt SetActiveProfile m_strProfileld register our window to receive messages from the printer hr m_nova0ptions gt RegisterEventWindow LONG GetSafeHwnd set novaPDF as default printer so it will be used by ShellExecute hr m_novaOptions gt SetDefaultPrinter license file for ShellExecute hr m_novaOptions gt LicenseShellExecuteFile m_strFileToConvert AllocSysString F print the document m_bPrintJobPending TRUE HINSTANCE hExec ShellExecute GetSafeHwnd L print m_strFileToConvert NULL NULL SW_HIDE Of av 7 Restore default printer when printing finished LRESULT CnovaPrintDlg OnNovaPDFFileSaved WPARAM wParam LPARAM lParam restore original default printer m_novaOptions gt UnRegisterEventWindow m_novaOptions gt RestoreDefaultPrinter m_bPrintJobPending FALSE return 0 LRESULT CnovaPrintDlg OnNovaPDFPrintError WPARAM wParam LPARAM lParam switch wParam
75. LID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 180 UnRegisterEventWindow The UnRegisterEventWindow unregisters the window registered with RegisterEventWindow so it will no longer receive printing messages HRESULT UnRegisterEventWindow void Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called 2 4 10 4 181 WaitForNovaEvent The WaitForNovaEvent waits for a Windows event that will be signaled by the printer HRESULT WaitForNovaEvent in LONG p_nMilliseconds out BOOL p_bTimeout Parameters p_nMilliseconds in Number of milliseconds to wait for the event See How to use events for mc p_bTimeout out returns TRUE if a the wait function return with a timeout and FALSE othe Return values S_OK on success S_FALSE event was not found 2 5 Samples 2 5 1 What sample to choose There are several modes to start a print job to novaPDF SDK 8 and depending on your application you should choose a different sample 1 If you perform a print job by calling other controls Print
76. My Documents pNova gt SetOptionLong NOVAPDF_SAVE_FOLDER_TYPE SAVEFOLDER_MYDOCUMENTS set a macro for the file name pNova gt SetOptionString NOVAPDF_SAVE_FILE_NAME L test_ N in case a file with the same name exists in the selected folder choose what to do pNova gt SetOptionLong NOVAPDF_SAVE_FILEEXIST_ACTION FILE_CONFLICT_STRATEGY_AUTONUMBER_NEW save profile changes hr pNova gt SaveProfile set as active profile for printer pNova gt SetActiveProfile pwsNewProfileID HANDLE hPrinter PDEVMODEW pDevmode NULL PRINTER_DEFAULTS pd NULL NULL PRINTER_ACCESS_USE start print job if OpenPrinter PRINTER_NAME amp hPrinter amp 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_BUFFER set page size in DEVMODE pDevmode gt dmPaperSize DMPAPER_USER pDevmode gt dmPaperLength 2970 5940 pDevmode gt dmPaperWidth 2100 4200 pDevmode gt dmFields DM_PAPERSIZE DM_PAPERLENGTH DM_PAPERWIDTH DocumentProperties NULL hPrinter PRINTER_NAME pDevmode pDevmode DM_IN BUFFER DM_OUT_BUFFER Print a page HDC hDC CreateDC L PRINTER_NAME NULL pDevmode DOCINFO docInfo sizeof DOCINFO document name docInfo lpszDocName PDF_FILE_NAME StartDoc hDC amp docInfo StartP
77. N_SHOW_SIGN_DATE NOVAPDF_SIGN_SHOW_SIGN_REASON 138 NOVAPDF_SIGN_SHOW_LABELS g Ha 1 NOVAPDF_SIGN_SHOW_DETAILS 140 NOVAPDF_SIGN_SHOW_CONTACT_INFO 137 2 Server NOVAPDF_SIGN_FONT_NAME 142 NOVAPDF_SIGN_FONT_TYPE 143 string o 5 da O TrueType 1 Typel 2 OpenType TrueType 3 OpenType Tpe1 novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 37 NOVAPDF_STGN_CUSTOM_STZE 145 bool false ro Ae a NOVAPDF_STGN_NAME_COLOR_ 146 tong r Bcolor INOVAPDE_SIGN_INFO_REASON 150 string E INOVAPDF_STGN_INFO_tocaTron 155 string LINKS Tee ea ae ace too S tase 167 0 solid 1 dashed 168 long border width in 1000 points 1000 H_UNITS 259 long 0 Millimeters 1 Centimeters 2 Inches NOVAPDF_URL_BORDER_COLOR long RGB value 13369344 0 0 204 NOVAPDF_URL_COl NOVAPDF_URL_CHE EMAIL Constant name NOVAPDF_EMATL_ NOVAPDF_SE EMAIL ACTION O Send with default email client 1 Open default email client novaPDF SDK 8 User Manual Copyright O 2015 Softland 38 novaPDF SDK 8 NOVAPDF_EMATL_COMPRESS NOVAPDF_EMAIL_SUBJECT NOVAPDF_EMAIL_BODY NOVAPDF_EMAIL_EXTENSION NOVAPDF_EMAIL_ATTACH_PDF NOVAPDF_EMATL_ATTACH_OTHER_FILES NOVAPDF_EMATL_OTHER_FILES NOVAPDF_EMATL_C
78. Number Cache yes Cacheld DriverPackageldx64 var MajorVersion var MinorVersion f var BuildNumber DisplayInternalUI no EnableFeatureSelection yes ForcePerMachine yes Compressed yes SourceFile var DriverKit64 Visible yes Vital yes InstallCondition VersionNT64 gt lt MsiPackage gt lt oem product gt lt MsiPackage Id OemPackagex86 var MajorVersion var MinorVersion f var BuildNumber Cache yes Cacheld OemPackageIdx86 var MajorVersion var MinorVersion var BuildNumber DisplayInternalUI no novaPDF SDK 8 User Manual Copyright 2015 Softland 208 novaPDF SDK 8 EnableFeatureSelection no ForcePerMachine yes Compressed yes SourceFile var OemKit86 Visible no Vital yes InstallCondition NOT VersionNT64 gt lt MsiPackage gt lt MsiPackage Id OemPackagex64 var MajorVersion var MinorVersion f var BuildNumber Cache yes Cacheld OemPackageIdx64 var MajorVersion var MinorVersion var BuildNumber DisplayInternalUI no EnableFeatureSelection no ForcePerMachine yes Compressed yes SourceFile var OemKit64 Visible no Vital yes InstallCondition VersionNT64 gt lt MsiPackage gt lt Chain gt lt Bundle gt lt Fragment gt lt UI gt lt UI Id MyWixUI_Mondo gt lt UIRef Id WixUI_Mondo gt lt UIRef Id WixUI_ErrorProgressText gt lt UI gt lt Fragment gt lt Wix gt
79. OCTYPE html PUBLIC W3C DTD XHTML 1 0 Transitional EN http www w3 org TR xhtml11 DTD xhtml1 transitional dtd gt lt html xmlns http www w3 org 1999 xhtml gt novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 147 lt head id Head1 runat server gt lt title gt Hello World ASP NET lt title gt lt head gt lt body gt lt hl gt Hello World ASP NET and novaPDF SDK lt h1 gt lt form id form2 runat server gt lt div gt lt asp Label ID Label1 runat server Text Press the button gt lt asp Label gt lt br gt lt asp LinkButton ID Link1 Visible false runat server gt View folder lt asp LinkButton gt lt br gt lt asp Button ID Buttonl runat server onclick Buttonl_Click Text Print to novaPDF gt lt br gt lt br gt 1 In IIS Manager expand the local computer expand the Application Pools folder right click the application pool you would like to configure the one selected for this application virtual directory and click Properties lt be gt 2 Click the Identity tab lt br gt 3 Click Predefined and in the list box beside it click Local System lt pre gt 4 Click OK lt div gt lt form gt lt body gt lt html gt SOURCE CODE FOR THE ASP SAMPLE DEFAULT ASPX CS sing System ing System Web ing System Web UI ing System Web UI WebControls ing System Drawing
80. ON_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 108 GetWatermarkText The GetWatermarkText method retrieves an existing image watermark properties HRESULT GetWatermarkText in LONG p_nIndex out string LPWSTR p_pwsWatermarkId i Parameters p_nindex in watermark index p_pwsWatermarkId out string watermark id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong image watermark index novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 107 2 4 10 4 109 GetWatermarkText2 The GetWatermarkText2 method retrieves an existing image watermark properties HRESULT GetWatermarkText2 in LONG p_nIndex out string BSTR p_pwsWatermarkId gt Parameters p_nindex in watermark index p_pwsWatermarkId out string watermark id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong image watermark index 2 4 10 4 110 GetWatermarkTextCou
81. PCWS1 p_nDetFontType L p_bDetStyle L p_bDetBol L p_bDetItalic L p_bDetSize p_nDetSizeVal nDetSizePt TR p_wsDetFont d Lor lor novaPDF SDK 8 User Manual Copyright 2015 Softland 50 novaPDF SDK 8 in BOOL p_bDispAsBold in BOOL p_bDispAsItalic in LONG p_nDispColor out SHORT p_nDefinition Parameters p_nHeading in Jheading index where to add the definition 1 9 p_bEnabled in definition is enabled p_bDetFont in detect font p_wsDetFont in font name p_nDetFontType in font type true type typel open typ p_bDetStyle in detect font style p_bDetBold in bold font p_bDetItalic in italic font p_bDetSize in detect font size p_nDetSizeVal in font size p_nDetSizePt in font size rounding p_bDetColor in detect font color p_nDetColor in font color RGB value p_bDispAsBold in display bookmark font bold p_bDispAsItalic in display bookmark font italic p_nDispColor in display bookmark font color p_nDefinition out definition index if added If the definition was not added 1 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded Remarks There can be defined maximum 9 bookmark definitions 2 4 10 4 2 AddBookmarkDefinition2 The AddBookmarkDefinition2 method adds a new bookmark definition in the current loaded profile having the
82. PDF 8 SDK Developer to an unlimited number of end users without any additional fees 2 Component application license This type of license allows you to to develop market and distribute ONE component ONE wrapper ONE library or ONE module that integrates the novaPDF 8 SDK Developer to an unlimited number of end users without any additional fees After purchase you will receive an email with the next information e license key e licence file e customization file Each licensed user will received an unique ID that will guarantee your novaPDF 8 SDK Developer customized installers will install separately from the other users 2 Customize redistributable novaPDF installers with your license With novaPDF 8 SDK Developer there is installed a tool called novaPDF Co Branding You should run this tool to generate the msi files customized for your license You can start this tool from the novaPDF 8 SDK Developer installation menu See Customize your setup for more details You will need the resulting customized setup files in step 3 below novaPDF SDK 8 User Manual Copyright 2015 Softland 18 novaPDF SDK 8 2 3 3 3 Install customized printer installation files For testing purposes install novaPDF 8 SDK Developer running the resulting customized setup files MSI in the following order novaPDF8PrinterDriver x64 msi or novaPDF8PrinterDriver x86 msi each of them installs both 32 and 64 bit versions of the prin
83. PTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 131 2 4 10 4 157 SetPrinterActivePublicProfile The SetPrinterActivePublicProfile method sets an active public profile for a printer HRESULT SetPrinterActivePublicProfile in string LPWSTR p_wsPrinterName in string LPWSTR p_wsProfileld i Parameters p_wsPrinterName in string printer name p_wsProfileld in string public profile id Return values S_OK on success or COM error code NV_SERVICE_ERROR error connecting to novaPDF Server servic Remarks Sets an public profile as the active profile for the printer All users will be forced to use this public profile the cannot change the active profile 2 4 10 4 158 SetPrinterActivePublicProfile2 The SetPrinterActivePublicProfile2 method sets an active public profile for a printer HRESULT SetPrinterActivePublicProfile2 in string BSTR p_wsPrinterName in string BSTR p_wsProfileld i Parameters p_wsPrinterName in string printer name p_wsProfil
84. Parameters p_wsObjectId in object id watermark text watermark image overlay signature or content p_nIndex out layout index p_pwsLayoutld out layout id novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 81 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong object id NV_INVALID_LAYOUT layout not found for specified object Remarks For layout options see Working with Layout objects 2 4 10 4 63 GetLayoutCount The GetLayoutCount method retrieves the count of layout for the specified object in the loaded profile HRESULT GetLayoutCount in string LPWSTR p_pwsObjectld out LONG p_pnCount i Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pnCount out layouts count Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong object id 2 4 10 4 64 GetLayoutCount2 The GetLayoutCount2 method retrieves the count of layout objects for the specified object in the loaded profile HRESULT GetLayoutCount2 in string BSTR p_pwsObjectld out LONG p_pnCount i Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pnCount
85. PrinterName in string LPWSTR p_wsProfileld in BOOL p_bVisible Parameters p_wsPrinterName in string printer name p_wsProfileld in string public profile id p_bVisible in flag if visible Return values S_OK on success or COM error code NV_SERVICE_ERROR error connecting to novaPDF Server servic Remarks Sets the visibility option for a public profile and a printer By default all public profiles are visible ton all printers They can be hidden for some printers using this method 2 4 10 4 161 SetPrinterPublicProfile2 The SetPrinterPublicProfile2 method sets the visibility of a public profile for a printer HRESULT SetPrinterPublicProfile2 in string BSTR p_wsPrinterName in string BSTR p_wsProfileld in BOOL p_bVisible y Parameters p_wsPrinterName in string printer name p_wsProfileld in string public profile id p_bVisible in flag if visible novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 133 Return values S_OK on success or COM error code NV_SERVICE_ERROR error connecting to novaPDF Server servic Remarks Sets the visibility option for a public profile and a printer By default all public profiles are visible ton all printers They can be hidden for some printers using this method 2 4 10 4 162 SetWatermarklmageOptionBool The SetWatermarklmageOptionBool method sets a watermar
86. Profile 131 SetPrinterActivePublicProfile2 131 SetPrinterOptionietes seve be ehea vat vale ecient sted ited ieee dere ea ci ete edna eee 131 setPrinterPublic Profile nasere rk Ae da 132 SetPrinterPublic Profile ici a ds 132 SetWatermarklmageOptionBool 133 SetWatermarklMageOptioNBOol2 0 eeeesescessceeeeeeeeeaececeeeeeaeeeeesaeeaeeseeeaeeeaesseesaeceaesaeeeaeseeseaeeeaeeeeeeaeeeas 133 SetWatermarklmageOptionEncryptedString eecceccesceseeeeeeeeeeeeeeeseaeeeesaeeeeeeeesaeeeeeseeeaeeeeeeeseaeeeeeeateeas 134 SetWatermarkIlmageOptionEncryptedString2 ee ceceeeceseseeeeneeeeeeeeeeaeeeeeeaeeeeesaeesaeseeeseesaeeeeeseseateneeeaeeeas 134 SetWatermarklMageOPtion Float eeeceeseeeceeeeeeeeeeeeseceeeeeeeeaeeeeecaeeeaeeseeeaeeeeeserecaesneeeaeesaeseeeeaeseateneeeaeeeas 135 SetWatermarklmageOptionFloat2 eee esesesesceeeeeeeeaeeeeeeeeeseseeesaeeaeeseesaessaesaeesaesaecaeeeaeseeeeaeeeaeeeeseaeeeas 136 SetWatermarklMageOptionLong esceesesceeseeeeeeeeeeaeeeeeeseesseceeeeseeeaeesaeeaeeeaesseesaeseeesseeeaeseaeeaeseaeeeeeeaeeeas 136 SetWatermarklMageOptionLOng eeeesescesseceeeeeeeeaeeeeeeseeeaeseeeeseeaeeseeeaeeeaecseesaeseeecaeeeaeseeeeeeeaeeneeeaeeeas 137 SetWatermarklMageOPtionString eeceeeeeceeseeeneeeeeeeceeeseeeeaeeeeesaeeeaeeeesaeeeeeseesaeeneesaeesaeeeeeeeeseateneeeateeas 137 SetWatermarklMageOptionString2 eeeeeeecessceeeeceeeeeeeceeseesaeeeeeeaeesaeeseeeaeeaeeaeesseseesseeeaeseeseeseaeeseeeae
87. R cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 95 GetWatermarklmageOptionFloat2 The GetWatermarkimageOptionFloat2 method retrieves a watermark image option of boolean type HRESULT GetWatermarkImageOptionFloat2 in string BSTR p_pwsWatermarkld in LONG p_nOption out FLOAT p_pfValue novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 99 i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_pbValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next f
88. R p_pwsEmailld out LONG p_pnCount i Parameters p_pwsEmaillid novaPDF SDK 8 User Manual Copyright 2015 Softland 78 novaPDF SDK 8 in email id obtained with GetEmail2 or AddEmail2 p_pnCount out email recipients count Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMATL email not found 2 4 10 4 57 GetFirstProfile The GetFirstProfile starts an enumeration of profiles retrieving the id of the first profile in the enumeration HRESULT GetFirstProfile out LPWSTR p_pwsProfileld Parameters p_pwsProfileld out pointer to a pointer to a null terminated Unicode string containing the i Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot load profiles Remarks GetFirstProfile is used with GetNextProfile to retrieve profile names Sample usage hr GetFirstProfile amp pId while SUCCEEDED hr amp amp hr NV_NO_MORE_PROFILES do something with pName les CoTaskMenF ree pla get next profile if it exists hr GetNextProfile amp pId 2 4 10 4 58 GetFirstProfile2 The GetFirstProfile2 starts an enumeration of profiles retrieving the id of the first pr
89. Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 52 GetEmailOptionString2 The GetEmailOptionString2 method retrieves an option of string type for an email HRESULT GetEmailOptionString2 in string BSTR p_pwsEmailld in LONG p_nOption out BSTR p_pwsValue i Parameters p_pwsEmaillid in email id obtained with GetEmail2 or AddEmail2 p_nOption in option constant p_pwsValue out pointer to a pointer to a BSTR string that will contain the value of the Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option
90. S ACTIVE PROFILE try if oldActiveProfile length gt 0 pNovaDispatch callMethod SetActiveProfile2 new Object new JIString oldActiveProfile catch JIException except System out println SetActiveProfile2 Old pa except printStackTrace DELETE THE NEW PROFILE try pNovaDispatch callMethod DeleteProfile2 new Object new JIString activeProfile catch JIException except System out println DeleteProfile2 except printsStackTrace JISession destroySession session public int print Graphics g PageFormat pf int page throws PrinterException if page gt 0 We have only one page and page is zero based novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 187 2 5 7 2 E return NO_SUCH_PAGE E E User 0 0 is typically outside the imageable area so we must translate by the X and Y values in the PageFormat to avoid clipping Graphics2D g2d Graphics2D g g2d translate pf getImageableX pf getImageableY Now we perform our rendering qg drawString MESSAGE 100 100 tell the caller that this page is part of the printed document 2y return PAGE_EXISTS Word OLE The Word OLE Java SDK sample is a basic Java console application that converts a MS Word document in this sample the default location for the source
91. Solid Aa long ong 297000 1 1 NOVAPDF_LAYOUT_SCALE_X NOVAPDF_LAYOUT_SCALE_Y NOVAPDF_LAYOUT_USE_BORDER false NOVAPDF_LAYOUT_BORDER_STYLE NOVAPDF_LAYOUT_BORDER_WIDTH RGB color long O Neutral 1 Interior 2 Exterior NOVAPDF_LAYOUT_BORDER_COLOR NOVAPDF_LAYOUT_BORDER_POSITION NOVAPDF_LAYOUT_ ZINDEX 1350 long multipleof5 1 ADVANCED OPTIONS novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 43 novaor sov oormnze EN oa fake AA si oo _ fake nova sov consecr_rruucovor EN oa fake AO s3 bo _ fhe _ GENERAL PROFILE SETTINGS value NOVAPDE_PROFILE_ NAME ESETI NOVAPDF_PROFILE_AUTHOR aa fsi Y ao eel AO NOVAPDF_SAVE_LOCATION 14 long 1 Local 2 Server 1 NOVAPDF_PDF_VERSION 1 long 3 PDF 1 3 Adobe 5 Reader 4 4 PDF 1 4 Adobe Reader 5 5 PDF 1 5 Adobe Reader 6 6 PDF 1 6 Adobe Reader 7 7 PDF 1 7 Adobe Reader 8 NOVAPDF_PDFA_VERSION 3 long 1 PDFAMa 2 2 PDFA 1b PRINTER OPTIONS Constant name Value Type Possible values Default value OOO ce NOVAPDF_PRINTER SELECT PROFILE DL novaPDF SDK 8 User Manual Copyright 2015 Softland 44 novaPDF SDK 8 2 4 10 2 Windows messages novaPDF SDK 8 messages NOVAPDF2_STARTDOC sent when the printer driver jobID begins processing the print job and generating the PDF file NOVAPDF2_ENDDOC sent when the printer driver jobID finished processi
92. TIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 70 GetLayoutOptionLong2 The GetLayoutOptionLong2 method retrieves an option of long type for a layout object HRE SULT GetLayoutOptionLong2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption out LONG p_plValue i Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout2 p_nOption in option constant p_plValue out will contain the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile
93. V_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 91 2 4 10 4 80 GetOptionString2 The GetOptionString2 method retrieves a printing option of string type for a given profile HRESULT GetOptionString2 in LONG p_nOption out BSTR p_pwsValue i Parameters p_nOption in option constant p_pwsValue out return the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 81 GetOverlay The GetOverlay method retrieves the overlay and its layout object HRESULT GetOverlay o
94. Windows Start menu in Control Panel Programs and on the About page of the installed printer and tools Your company name The company name will appear on the About page of the installed printer and tools Add Printer Starting with version 8 3 you have the option to add one or multiple printers at installation In previous version there could be added only one printer You can also choose to not add any printer at installation time if you wish to add them later For each printer you can configure Printer name The name of the printer that you wish to install with your application Port name The name of the port for the printer Choose a name specific to your application so it will be unique If you add multiple printers it is better to put them on different ports otherwise the documents will be processed sequentially Make default printer You can also choose if the printer should be set as the default printer on the system Set active profile GUID The GUID of the public profile that you wish to set as default for the installed printer You can copy the GUID from the Profile Manager when it is opened in the Administrative mode from the Printer Manager tool This parameter is not mandatory novaPDF SDK 8 User Manual Copyright 2015 Softland 20 novaPDF SDK 8 2 3 4 Add a start menu folder The name of the Windows menu Language code Language for novaPDF printer and installed tools INJECT W
95. _Click Debug Print Err Number amp amp Err Description Resume Next End Sub ASP NET Hello World Hello World ASP NET sample is a simple ASP application that generates one PDF file containing the text novaPDF says Hello World from ASP NET The PDF is created using the novaPDF SDK 8 printer driver and is saved in the upload folder It demonstrates the basic use of the INovaPDFOptions interface The printing job is done using the package System Drawing Printing What this sample does e determines the active profile makes a copy of it and names it Test ASP NET e sets the new profile Test ASP NET as active as well as some mandatory settings e generates a test PDF file and saves it in the upload folder e restores the original settings of the novaPDF SDK 8 printer driver Note To test this sample on IIS you should set the Application Pool to run under the Local System Account Here s how you can do this 1 In IIS Manager expand Local computer the Application Pools folder right click the application pool you would like to configure the one selected for this application virtual directory and click Properties 2 Go to the Identity tab 3 Click on Predefined and in the list box beside it click Local System Click OK SOURCE CODE FOR THE ASP SAMPLE OUTPUT DISPLAY PAGE DEFAULT ASPX lt Page Language C AutoEventWireup true CodeFile Default aspx cs Inherits _Default gt lt D
96. _DITHER HIGH COLOR pf voor _ true NOVAPDF_IMAGE_DITHER_TYPE_HIGH_COL long O FS Dither OR 1 BAYER4 Dither 2 BAYER8 Dither 3 ORDER6 Dither 4 ORDERS Dither 5 ORDER16 Dither NOVAPDF_IMAGE_CONVERT_TYPE_INDEXED long O Grayscale 1 Monochrome NOVAPDF_IMAGE_DITHER_TYPE_INDEXED long O FS Dither 1 BAYER4 Dither 2 BAYER8 Dither 3 ORDER6 Dither 4 ORDERS Dither 5 ORDER16 Dither NOVAPDF_IMAGE_CONVERT_TYPE_TEXTAND long 0 Grayscale GR 1 Monochrome NOVAPDF_IMAGE_CONVERT_TRESH_TEXTAN long 0 255 DGR NOVAPDF_IMAGE_CONVERT_TRESH_HIGH_C long 0 255 OLOR NOVAPDF_IMAGE CONVERT_TRESH_INDEXE DIE D novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 33 FONTS Constant name Value Type Possible values Default value TS TED DOCUMENT INFO AND VIEWER OPTIONS N DF_INFO_ENABLE bool OVAPDF_ NOVAPDF_DOCINFO_AUTHOR string lt Default gt bool O Viewer default 1 single page 2 column 3 two columns left 4 two columns right 5 two pages left 6 two pages right NOVAPDF_DOCINFO_CREATOR N PDF_DOCINFO_KEYWORDS OVAPDF_ NOVAPDF E OVA P NFO_SUBJ P DOCINFO_TITL P ER 1 N DF_INFO_VIE PDF_VIEWOP_PAGE_LAYOUT i 7 67 70 34 8 NOVAPDF_VIEWOP_PAGE i 3 long 0 Viewer default 1 Non
97. _FLAG_PRINTHIG E ER nm RITY_USER_PASSWORD E ER Oo NOVAPDF_SECURITY_OWNER_PASSWORD string encrypte d NOVAPDF_SECURITY_LEVEL i 1 40 bits encryption 2 128 bits encryption SIGNATURE Constant name Value Type Possible values Default value NOVAPDF_SIGN_CERTIFICATE_TYPE 131 long 1 system certificate 2 certificate file NOVAPDF_SIGN_SYSCERT_ISSUEDTO NOVAPDF_SIGN_SYSCERT_ISSUEDBY NOVAPDF_SIGN_SYSCERT_FRIENDLYNAME NOVAPDF_SIGN_SYSCERT_SUBJECT novaPDF SDK 8 User Manual Copyright O 2015 Softland 36 novaPDF SDK 8 NOVAPDF_SIGN_SYSCERT_SUBJECT_NAME NOVAPDF_SIGN_SYSCERT_EXPIRE_DATE NOVAPDF_SIGN_FILECERT_LOCATION long 1 Local 1 1 129 30 20 NOVAPDF_SIGN_FILECERT_FILE 121 NOVAPDF_SIGN_FILECERT_FILE_PASSWOR 122 D NOVAPDF_SIGN_FILECERT_USER_NAME 123 NOVAPDF_SIGN_FILECERT_USER_PASSWOR string D encrypte d bool bool 1 Local NOVAPDF_SIGN_IMAGE_USER_PASSWORD 151 string encrypte d NOVAPDF_SIGN_SHOW_GRAPHIC_NAME NOVAPDF_SIGN_SHOW_GRAPHIC_IAMGE N 1 io 3 lt iv NOVAPDF_SIGN_IMAGE_LOCATION NOVAPDF_SIGN_IMAGE_FILE 132 133 148 149 NOVAPDF_SIGN_IMAGE_USER_NAME 150 NOVAPDF_SIGN_SHOW_KEEPASPECTRATIO 134 NOVAPDF_SIGN_IMAGE OPACITY 152 long NOVAPDF_SIGN_NAME_OPACITY 147 long NOVAPDF_SIGN_SHOW_CERTIFICATE_NAME 135 136 NOVAPDF_SIGN_SHOW_SIGN_LOCATION 139 NOVAPDF_SIG
98. _FileSaved OnNovaPDFFileSaved END_MESSAGE_MAP 2 Initialize INovaPDFOptions CScribbleView CScribbleView EN HRESULT hr Colnitialize NULL Gb aks create novaPDFOptions object hr CoCreatelnstance __uuidof NovaPdfOptions80 NULL CLSCTX_INPROC_SERVER __ initialize the NovaPdfOptions object to use with a printer licensed for SDK hr m_pNova gt Initialize PRINTER_NAME L Lt ves 3 Release INovaPDFOptions CScribbleView CScribbleView release novaPDFOptions object if m_pNova m_pNova gt Release novaPDF SDK 8 User Manual Copyright 2015 Softland 174 novaPDF SDK 8 CoUninitialize 4 Set novaPDF SDK 8 Options BOOL CScribbleView OnPreparePrinting CPrintInfo pInfo set novaPDF default printer if m_pNova m_pNova gt SetDefaultPrinter HRESULT hr hr create a new profile with default m_pNova gt AddProfile PROFI hr m_wsNewProfile load the newly created profile SUCCE at else ED ED hr hr MessageBox L Failed to create profile m_pNova gt GetActiveProfile 8m_ws settings DefaultProfile E_NAME 6 m_wsNewProfil e PROFILE_IS_PUBLIC m_pNova gt LoadProfile m_wsNewProfile L novaBDE
99. _pwsEmailld in LONG p_nOption out LONG p_lValue Parameters p_pwsEmaillIld in email id obtained with GetEmail2 or AddEmail2 p_nOption in option constant p_lValue out pointer to a pointer to long that will contain the value of the retrievec Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 51 GetEmailOptionString The GetEmailOptionString method retrieves an option of string type for an email HRESULT GetEmailOptionString in string LPWSTR p_pwsEmailld novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 75 in LONG p_nOption out LPWSTR p_pwsValue i Parameters p_pwsEmaillid in email id obtained with GetEmail or AddEmail p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contai
100. age 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 PDE_TEXT EndPage hDC EndDoc ADC DeleteDC hDC print job sent to printer MessageBox NULL L Print job finished L novaPDF MB_OK LocalFree pDevmode y ClosePrinter hPrinter novaPDF SDK 8 User Manual Copyright O 2015 Softland 178 novaPDF SDK 8 else WCHAR wsMessage 255 wsprintf wsMessage L OpenPrinter failed error d GetLastError MessageBox NULL wsMessage L novaPDE MB_OK delete newly created profile pNova gt DeleteProfile pwsNewProfilelD free memory CoTaskMemF ree pwsNewProfilelD delete temporarry printer pNova gt DeleteNovaPrinter PRINTER_NAMBE release NovaPdfOptions pNova gt Release CoUninitialize return 0 2 5 6 6 Multiple printers Multiple printers sample is similar with the Temporary printer sample but it uses several threads Source code HelloWorld cpp include stdafx h Include novaPDF headers include include novaOptions h NovaPdfOptions include include novapi h include nova h name of novaPDF Printer Demo define PRINTER _NAME1 L novaPDF temporary print
101. age hDC Draw text on page TextOut hDC 100 80 PDF_TEXT int wcslen PDF_TEXT EndPage hDC EndDoc hDC DeleteDC hDC novaPDF SDK 8 User Manual Copyright 2015 Softland 168 novaPDF SDK 8 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 if pwsOldActiveProfileID pNova gt SetActiveProfile pwsOldActiveProfileID delete newly created profile pNova gt DeleteProfile pwsNewProfileID free memory CoTaskMemFree pwsNewProfileID CoTaskMemFree pwsOldActiveProfileID else MessageBox NULL L Failed to initialize novaPDF Printer L novaPDF MB _OK release NovaPdfOptions pNova gt Release CoUninitialize return 0 2 5 6 2 Hello World network Hello World network sample is similar with Hello World sample but it can be used from network and print to novaPDF installed on a different computer The sample requests the shared printer name in a dialog as computer name printer name for example if novaPDF SDK 8 is installed on WS1 then you should enter WS1 novaPDF SDK 8 See Network use topic for more details on how to use novaPDF on network Source Code snippets in addition to Hello World s
102. allation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 100 GetWatermarkTextOptionBool The GetWatermarkTextOptionBool method retrieves a watermark text option of boolean type HRESULT GetWatermarkTextOptionBool in string LPWSTR p_pwsWatermarkId in LONG p_nOption out BOOL p_pbValue i Parameters novaPDF SDK 8 User Manual Copyright 2015 Softland 102 novaPDF SDK 8 p_pwsWatermarkIid in watermark id obtained with GetWatermarkText p_nOption in option constant p_plValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 101 GetWatermarkTextOptionBool2 The GetWatermarkTextOptionBool2 method retrieves a watermark text option of boolean type HRESULT GetWatermarkTextOpt
103. alueo0f novapi80 NovaPdfOptionss80 pid setAutoRegistration true comStub new JIComServer pid args 0 session unknown comStub createInstance pNovaDispatch IJIDispatch JIObjectFactory narrowObject unknown queryInterface IJIDispatch IID novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 189 INITIALIZE ER D JIString PRINT JIString APPNI pNovaDispatch callMethod Initialize2 new JIString GET ACTIVE PROFILE new JIString novaPDF SDK 8 new JIString Word Application new Object PRINTER String oldActiveProfile try JIVariant ap GetActiveProfile2 oldActiveProfil Le catch JIException except new Object new JIVariant pNovaDispatch callMethodA true ap 1 getObjectAsString getString System out printin GetActiveProfile2 except printStackTrace String activeProfile ADD A NEW PROFILE try JIVariant ap new Object new JIString PROFIL true activeProfile catch JIException E Wi r pNovaDispatch callMethodA AddProfile2 _NAME PROFILE_IS_PUBLIC new JIVariant ry ap 1 getObjectAsString getString except System out printin AddProfile2 except printStackTrace LOAD PROFILE try pNovaDispatch cal JIString activeProfile catch JIException System out print liMethod L
104. ame out pointer to a pointer to a null terminated Unicode string that will contai On success this value must be freed by the caller with CoTaskMemF ree Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called Remarks Because the novaPDF SDK 8 works with the printer spooler queue the documents sent to the printer are added to the queue If there are already some other documents in the queue the current document is not processed until the previous ones are finished There are two PDF file names you can find out depending on the value of the p_bPrintStarted flag novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 93 e the name of the PDF file that was just sent to the printer e the name of the PDF file that is currently processed by the printer This information is available only on the computer that starts the print job if the PDF file is saved local and not on the network 2 4 10 4 84 GetPDFFileName2 The GetPDFFileName2 method retrieves the name of the last generated PDF file HRESULT GetPDFFileName2 in BOOL p_bPrintStarted out string BSTR p_pwsFileName i Parameters p_bPrintStarted in flag what file name to retrieve S Remarks p_pwsFileName out will contain the file name Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called Remarks Because the novaPDF SDK 8 works wi
105. and 192 novaPDF SDK 8 PDF callMethod L icenseOLEServer public void performOp throws JIException InterruptedException JISystem c aa onfig JISystem setJavaCoClassAutoCollection true System out printin JIVariant dispatch get Version getObjectAsString getSt ring System out printin JIVariant dispatch get Path getObjectAsString getString JIVariant variant dispatch get Documents System out printin Open document IJIDispatch documents IJIDispatch JlObjectFactory narrowObject variant getObjectAsComObject JIString filePath new JIString c temp test doc JIVariant variant2 documents callMethodA open new Object filePath JIVariant OPTIONAL _PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL _PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL _PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM System out println doc opened ActivePrinter dispatch put ActivePrinter new Object PRINTER sleep 5 System out println Get content IJIDispatch document IJIDispatch JlObjectFactory narrowObject variant2 0 slee
106. and nPdfSdk8_SoftlandEulaExt rtf gt lt version gt lt define MajorVersion 8 gt lt define MinorVersion 0 gt lt define BuildNumber 908 gt lt manufacturing gt lt define Manufacturer lt My SDK Company Name gt gt lt product name gt lt define ProductName lt My SDK Application Name gt gt lt full product name gt lt define FullProductName var ProductName var MajorVersion gt lt bundle specific gt lt define Driverkit86 C Users Public Documents novaPDF 8 SDK Branding novaPDF8PrinterDriver x86 msi gt lt define Driverkit64 C Users Public Documents novaPDF 8 SDK Branding novaPDF8PrinterDriver x64 msi gt novaPDF SDK 8 User Manual Copyright 2015 Softland 206 novaPDF SDK 8 lt define COMPathx64 C Users Public Documents novaPDF 8 SDK Branding novaPDF8COM x64 msi gt lt define COMPathx86 C Users Public Documents novaPDF 8 SDK Branding novaPDF8COM x86 msi gt lt define OemKit86 C Users Public Documents novaPDF 8 SDK Branding novaPDF8SDK x86 msi gt lt define OemKit64 C Users Public Documents novaPDF 8 SDK Branding novaPDF8SDK x64 msi gt lt Include gt Bundle wxs lt xml version 1 0 encoding UTF 8 gt lt Wix xmlns http schemas microsoft com wix 2006 wi xmlns util http schemas microsoft com wix UtilExtension xmlns bal http schemas microsoft com wix BalExte
107. ark definition index 2 4 10 4 123 RegisterEventWindow cProfile in definition index enabled lag in detect font style ize nding olor in font color RGB value in display bookmark font bold in display bookmark font italic in display bookmark font color BSTR containing the profile to modify If this parameter is rofile is a public or a private profile error code Initialize was not called no profile loaded The RegisterEventWindow registers a window with the printer in order to receive printing messages HRESULT RegisterEventWindow in LONG p_hWnd i Parameters novaPDF SDK 8 User Manual Copyright O 2015 Softland C 114 novaPDF SDK 8 p_hwWnd in handle to the window cast to a LONG value that will receive the printer Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called 2 4 10 4 124 RegisterNovaEvent The RegisterNovaEvent registers a Windows event that will be signaled by the printer HRESULT RegisterNovaEvent in LPCWSTR p_wsEventName i Parameters p_wsEventName in Name of the event See How to use events topic for a list of possible ever Return values S_OK on success S_FALSE event cannot be created 2 4 10 4 125 RegisterNovaEvent2 The RegisterNovaEvent2 registers a Windows event that will be signaled by the printer HRESULT RegisterNovaEvent2 in BSTR p_wsEv
108. arkId in watermark id obtained with GetWatermarkText p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 179 SetWatermarkTextOptionString2 The SetWatermarkTextOptionString2 method sets a watermark text option of string type HRESULT SetWatermarkTextOptionString2 in string BSTR p_pwsWatermarkld in LONG p_nOption in BSTR p_wsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 143 NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVA
109. asically the sample creates a new profile called Access Profile sets the new profile as active sets the user options from form controls opens and prints a report and restores original printer settings Source code Option Compare Database Option Explicit novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 145 Private Const s Const s Obj PDF As Object trIAProfile As String Access Profile trPDFDriver As String novaPDF SDK 8 Const bIAPublicProfile As Long 0 Private On Dim Dim Dim e Dim al obj Ys strDefaultPrinter Application Sub cmdCreatePDF_Click strActiveProfileld As String strNewProfileld As String strDefaultPrinter As String nitialize the NovaPdfOptions PDF Initialize2 strPDFDriver tore the Default Printer pdate Access internally fast Get the Active Profile PDF GetActiveProfile2 strActiveProfileld obj Add new profile obj Lo obj Wit ad the profile Error GoTo Error_cmdCreatePDF_Click reate the NovaPdfOptions object objPDF As New NovaPdfOptions80 object to use with a printer licensed for SDK ww Note Access cannot use the objPDF SetDefault enough You must use the Application Printer Printer DeviceNam PDF AddProfile2 strProfileName bIAPublicProfile strNewProfileld PDF LoadProfile2 strNewProfileld h Me VKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK AA RAR RAR RARA AAA RAR AAA AAA AAA
110. at NOVAPDF_LAYOUT_RIGHTANCHOR_USED NOVAPDF_LAYOUT_RIGHTANCHOR_OFFSET NOVAPDF_LAYOUT_RIGHTANCHOR_USE_PE RCENT float NOVAPDF_LAYOUT_TOPANCHOR_USED float NOVAPDF_LAYOUT_TOPANCHOR_OFFSET NOVAPDF_LAYOUT_TOPANCHOR_USE_PERC ENT NOVAPDF_LAYOUT_BOTTOMANCHOR_USED float NOVAPDF_LAYOUT_BOTTOMANCHOR_USE_P ERCENT NOVAPDF_LAYOUT_VERTANCHOR_USED NOVAPDF_LAYOUT_VERTLANCHOR_OFFSET NOVAPDF_LAYOUT_VERTANCHOR_USE_PER CENT NOVAPDF_LAYOUT_HORIZANCHOR_USED NOVAPDF_LAYOUT_HORIZANCHOR_OFFSET 3 NOVAPDF_LAYOUT_BOTTOMANCHOR_OFFSE T float 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 36 float novaPDF SDK 8 User Manual Copyright 2015 Softland 42 novaPDF SDK 8 NOVAPDF_LAYOUT_HORIZANCHOR_USE_PE RCENT NOVAPDF_LAYOUT_USE_ASPECT_RATIO NOVAPDF_LAYOUT_WIDTH float NOVAPDF_LAYOUT_HEIGHT NOVAPDF_LAYOUT_ROTATION NOVAPDF_LAYOUT_UNITS 0 Millimeters 1 Centimeters 2 Inches NOVAPDF_LAYOUT_FIRSTPAGE false NOVAPDF_LAYOUT_LASTPAGE false NOVAPDF_LAYOUT_ODDPAGE NOVAPDF_LAYOUT_EVENPAGE false NOVAPDF_LAYOUT_ALLPAGE true NOVAPDF_LAYOUT_PAGES false NOVAPDF_LAYOUT_PAGERANGE NOVAPDF_LAYOUT_FORM_WIDTH 210000 NOVAPDF_LAYOUT_FORM_HEIGHT 297000 NOVAPDF_LAYOUT_BOUNDING_WIDTH a Ss for for fot 210000 SSS EAN AA AA 1 NOVAPDF_LAYOUT_BOUNDING_HEIGHT 1 NOVAPDF_LAYOUT_ORIGINAL_WIDTH NOVAPDF_LAYOUT_ORIGINAL_HEIGHT bool O
111. ate a new profile with default settings pNova AddProfile2 PROFILE_NAME PROFILE_IS_PUBLIC strNewProfilelD load the newly created profile if SUCCEEDED hr and Length strNewProfileID gt 0 then begin pNova LoadProfile2 strNewProfilelD end else begin System Writeln Failed to create profile exit end set novaPD uncomment change the opti AddProfileo F options the function calls for the options you wish to set and ons in nova cpp unit ptions pNova novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 155 2 5 4 3 AddDocumentInformation pNova AddViewerO0ptions pNova AddLinksOptions pNova AddAdvancedOptions pNova AddGraphicsOptions pNova AddEmbedFontsOptions pNova AddBookmarksDefinitions pNova AddSecurity pNova AddSaveOptions pNova AddAfterSaveActions pNova AddEmailOptions pNova AddWatermarkImage pNova AddWatermarkText pNova AddPageContentOptions pNova AddOverlayOptions pNova AddSignatureOptions pNova save profile changes pNova SaveProfile get current default profile id pNova GetActiveProfile2 strOldActiveProfilelID set as active profile for printer pNova SetActiveProfile2 strNewProfilelD start print job Printer Title PDF_FILE_ NAME Printer BeginDoc Printer Canvas Font Size 24 Printer Canvas TextO
112. ayoutOptionBool2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption in BOOL p_bValue i Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content novaPDF SDK 8 User Manual Copyright 2015 Softland 124 novaPDF SDK 8 p_pwsLayoutld in layout id obtained with GetLayout2 p_wsOption in option constant p_bValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 145 SetLayoutOptionFloat The SetLayoutOptionFloat method sets an option of float type for a layout object HRESULT SetLayoutOptionFloat in string LPWSTR p_pwsObjectld in string LPWSTR p_pwsLayoutld in LONG p_nOption in FLOAT p_fValue i Parameters p_pwsObjectId in object id watermark text watermark image overlay signa
113. ayoutld in layout id obtained with GetLayout2 p_nOption in option constant p_pfValue out will contain the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 69 GetLayoutOptionLong The GetLayoutOptionLong method retrieves an option of long type for a layout object HRE SULT GetLayoutOptionString in string LPWSTR p_pwsObjectld in string LPWSTR p_pwsLayoutld in LONG p_nOption out LONG p_plValue i Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pwsLayoutId in layout id obtained with GetLayout p_nOption novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 85 in option constant p_plValue out will contain the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INI
114. ber of days until the expiration will be shown too Options to Activate Reactivate will re activate online the current product key Deactivate Enter Change product key and Registering a product key Miscellaneous information regarding the other products developed by the company as well as copyright information novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 12 novaPDF SDK 8 2 novaPDF SDK 2 1 Introduction novaPDF SDK is a PDF software development kit that programmers can use to add the ability to create PDF files in their own applications As a COM Object novaPDF SDK can be integrated in any Windows XP 2003 Server 2008 Server Vista Windows 7 Windows 2008 Server Windows 8 Windows 2012 Server application programmed in a language that supports COM Objects C C C Visual C Delphi Visual Basic novaPDF SDK includes e a COM interface for customizing novaPDF printer options e novaPDF SDK documentation including several code samples ASP NET CH C Delphi Java Ms Access Visual Basic VBNet e novaPDF for SDK printer to distribute royalty free licensing Details regarding novaPDF SDK e It is mandatory to distribute the novaPDF for SDK printer in your application s setup This is done under royalty free licensing you only pay for the SDK license If you don t want to show novaPDF for SDK under the list of Printers you can use a temporary printer each time your application creates
115. bject call RestoreDefaultPrinter with the same object to restore the original default printer Do not call SetDefaultPrinter twice without calling RestoreDefaultPrinter between the calls or else the original default printer will not be restored 2 4 10 4 131 SetEmailOptionBool The SetEmailOptionBool method sets an option of boolean type for an email HRESULT SetEmailOptionBooli in string LPWSTR p_pwsEmailld in LONG p_nOption in BOOL p_bValue gt Parameters p_pwsEmaillid in email id obtained with GetEmail or AddEmail p_wsOption in option constant p_bValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 132 SetEmailOptionBool2 The SetEmailOptionBool2 method sets an option of boolean type for an email HRESULT SetEmailOptionBooli novaPDF SDK 8 User Manual Copyright 2015 Softland
116. c False True ob jDoc PrintOut False objDoc Close False objWord Quit False restore default printer pNova RestoreDefaultPrinter restore default profile If Len sOldActiveProfileID gt 0 Then pNova SetActiveProfile2 sOldActiveProfilelD End If delete newly created profile pNova DeleteProfile2 sNewProfilelD Exit Sub ErrorHandler Debug Print Err Number amp Err Description End Sub VBNet Hello World VBNet Hello World VBNet sample is a simple Windows console application that prints one page with the novaPDF says Hello World from VB Net text to the novaPDF SDK 8 It demonstrates the basic use of the INovaPDFOptions interface The printing job is made using the package System Drawing Printing Basically the sample determines the active profile makes a copy of it into a profile called Test VBNet sets the new profile as active sets the subject of the generated PDF document prints a page and restores original printer settings The location of the generated document depends on whatever the settings are for the current active profile Notice Because of the specific exception based error handling in NET all calls to methods in the INovaPDFOptions interface must be nested within a try catch block Consider for example that we want to add a profile called test but the profile test already exists Then the call pNova AddProfile test will throw an System Runtime InteropServi
117. can create a new folder or use an existing one If you choose an existing folder the files from the folder will be deleted and the original msi installers will be copied there and injected with the new properties If you already have run the tool and you only wish to change some options select the settings file from the previous run CUSTOMIZATION FILES Customizations ctm The ctm file you received when you purchased a novaPDF 8 SDK Developer license License lic novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 19 The lic file you received when you purchased a novaPDF 8 SDK Developer license Controls ctl Special customization file for the Profile Manager tool Contact novaPDF 8 SDK Developer support team for more information about customizing Profile Manager tool Forms nps This file contains the default printer forms This is a text file and you can modify it to distribute the forms you wish EULA rtf Default EULA file is empty You can select the EULA document for your application Profiles database If you wish to distribute some public profiles with your application you can define the public profiles by running the Profile Manager tool in the administrative mode The profiles database will be included in your customized msi Also there will be included all the files from the Default files folder EXTRA PARAMETERS Your application name The application name will appear in
118. case ERROR_MSG_TEMP_FILE MessageBox L Error saving temporary file on printer server L novaPDE break case ERROR_MSG_LIC_INFO MessageBox L Error reading license information L novaPDF MB OK break case ERROR_MSG_SAVE_PDF novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 173 MessageBox L Error saving PDF file L novaPDF MB _ OK break case ERROR_MSG_JOB_CANCELED MessageBox L Print job was canceled L novaPDF MB _ OK break restore original default printer m_novaOptions gt UnRegisterEventWindow m_novaOptions gt RestoreDefaultPrinter m_bPrintJobPending FALSE return 0 2 5 6 4 MFC Scribble The MFC Scribble sample extends the standard MFC Scribble sample with the generation of PDF files using novaPDF SDK 8 It demonstrates how to integrate novaPDF SDK in a document view MFC architecture Source code snippets 1 Register novaPDF SDK 8 event define PROFILE NAME L MFCScribble Profile define PDF_FILE_NAME MFCScribble pdf define PROFILE_IS_PUBLIC 0 This message is sent when the PDF file is finished and saved on the harddisk const UINT wm_Nova_FileSaved RegisterWindowMessageW MSG_NOVAPDF2_FILESAVED BEGIN _MESSAGE_ MAP CScribbleView CScrollView AFX_MSG_MAP CScribbleView Den AFX_MSG_MAP Lf nee ON_REGISTERED_MESSAGE wm_Nova
119. ccess or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 103 GetWatermarkTextOptionFloat2 The GetWatermarkTextOptionFloat2 method retrieves a watermark text option of boolean type HRESULT GetWatermarkTextOptionFloat2 in string BSTR p_pwsWatermarkld tn LONG p_nOption out FLOAT p_pfValue Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 p_nOption in option constant p_pbValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded novaPDF SDK 8 User Manual Copyright 2015 Softland 104 novaPDF SDK 8 NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long
120. ces COMException with the ErrorCode property set to NV_PROFILE_EXISTS 0xD5DA0006 Source code novaPDF SDK 8 User Manual Copyright O 2015 Softland 200 novaPDF SDK 8 Imports Imports Imports Imports System System the novapiLib Imports novapiL Module Modulel System Drawing Drawing Printing System Windows Forms package must be added as a 1b80 COM refference lt summary gt j The main entry point for the application i lt summary gt Const PRINTER_NAME As String novaPDF SDK 8 Const PROFILE_NAME As String Test VBNet Const PROFILE_IS_PUBLIC As Integer 0 Const NOVAPDF_INFO_SUBJECT As String Document Subject Const NV_PROFILE_EXISTS As Long 707133434 Sub Main IEY create the NovaPdfOptions object Dim pNova As NovaPdfOptions80 pNova pNova Initialize PRINTI Dim LES Catch ex As System Runtime InteropServices COM active profile newProfilelD exists New NovaPdfOptions80 initialize the NovaPdfOptions object if you have an application license for novaPDF SDK TER_NAME mark start changing options get the active profile Dim activeProfile As String nActivePublic As Integer 0 Ey ES wee pNova GetActiveProfile activeProfile Exception ignore profile exists error If NovaErrors NV_NO_ACTIVE_PROFILE ex ErrorCode Then System Console WriteLine The printer does not have an
121. chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 173 SetWatermarkTextOptionBool2 The SetWatermarkTextOptionBool2 method sets a watermark text option of boolean type HRESULT SetWatermarkTextOptionBool2 in string BSTR p_pwsWatermarkld in LONG p_nOption in BOOL p_bValue gt Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 p_nOption in option constant p_bValue in boolean value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 174 SetWatermarkTextOptionFloat The SetWatermarkTextOptionFloat method sets a watermark text option of float type HRESULT SetWatermarkTextOptionFloat in string LPWSTR p_pwsWatermarkId in LONG p_nOption in FLOAT p_fValue i novaPDF SD
122. chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 91 GetWatermarklmageOptionBool2 The GetWatermarklImageOptionBool2 method retrieves a watermark image option of boolean type HRESULT GetWatermarkImageOptionBool2 in string BSTR p_pwsWatermarkld in LONG p_nOption out BOOL p_pbValue y Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_pbValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 97 folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 92 GetWatermarklmageOptionEncryptedString The GetWatermarklImageOptionEncryptedString method retrieves a watermark image option of e
123. characteristics specified by the method parameters HRESULT AddBookmarkDefinition2 novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 51 Parameters p_n p_b p_b in in SHORT p_nHeading BOOL p_bEnabled BOOL p_bDetFont string BSTR p_wsDetFont LONG p_nDetFontType BOOL p_bDetStyle BOOL p_bDetBold BOOL p_bDetItalic BOOL p_bDetSize INT p_nDetSizeVal FLOAT p_nDetSizePt BOOL p_bDetColor LONG p_nDetColor BOOL p_bDispAsBold BOOL p_bDispAsItalic n LONG p_nDispColor out SHORT p_nDefinition H H H H H H H H H H H H H H H H o de det kt o dl ds A l l a F Heading heading index where to add the definition 1 9 Enabled definition is enabled in DetFont detect font p_wsDetFont in font name p_nDetFontType in font type true type typel open typ p_bDetStyle in detect font style p_bDetBold in bold font p_bDetItalic in italic font p_bDetSize in detect font size p_nDetSizeVal in font size p_nDetSizePt in font size rounding _bDetColor in in in detect font color DetColor font color RGB value DispAsBold display bookmark font bold _bDispAsItalic pn pn in DispColor in display bookmark font italic display bookmark font color Definition out definition index if added
124. code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_PROFILE_SAVE_ERROR cannot save new profile 2 4 10 4 18 DeleteBookmarkDefinition The DeleteBookmarkDefinition method deletes an existing bookmark definition HRESULT DeleteBookmarkDefinition in SHORT p_nDefinition i novaPDF SDK 8 User Manual Copyright 2015 Softland 60 novaPDF SDK 8 Parameters p_nDefinition in definition index Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_INVALID_BOOKMARK_DEF wrong bookmark definition index NV_UNKNOWN_PROFILE no profile loaded 2 4 10 4 19 DeleteEmail The DeleteEmail method deletes an existing email HRESULT DeleteEmail in LPWSTR p_wsEmailld i Parameters p_wsEmaillId in email id obtained with GetEmail or AddEmail Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMATL email not found 2 4 10 4 20 DeleteEmail2 The DeleteEmail2 method deletes an existing email HRESULT DeleteEmail2 in BSTR p_wsEmailld Parameters p_wsEmaillId in email id obtained with GetEmail2 or AddEmail2 Return values S_OK on success or COM error c
125. converts a document created with Microsoft Word to PDF using Word automation Wix bundle setup sample compresses the msi files in an setup executable Bin sample executables for DotNet Win32 and Win64 Network use novaPDF SDK 8 network auto install novaPDF SDK 8 can be installed on one computer and can be used by any computer in the network without having to install it on each computer This is to ease the work of network administrators both at installation time and future upgrades novaPDF SDK 8 supports Point and Print technology This means that you can install the printer on one computer on the network share it and you can connect to it from any other computer The system copies the necessary files for the driver without any user interaction On the server there are installed both i386 and x64 drivers and you can connect from the network with any i386 or x64 computers How to use novaPDF SDK 8 in a network If you have a large network you can install novaPDF SDK 8 and your application which integrates novaPDF 8 SDK Developer on a single computer and use it from any computer in the network All you need to do in your software is to initialize the INovaPdfOptions interface with the correct printer name including the name of the computer on which it is installed like server novaPDF SDK 8 When the application initiates the first print job to the printer server the system copies the necessary printer driver files without any
126. cryptedString ceceeeceeseeeceeeeceeeeeeceaeeesesaeeeeeseeeeaeeeaeseeeaeeeeeseeeseseaeeneeeaees 97 GetWatermarklmageOptionEncryptedString2 ececeeeeseeeceeeeeeeeeeeeeeeeeeeseeseeseeeseeeeaeeeeesaeeeaeseeeseseaeeeneeaees 97 GetWatermarklmageOptionFloat eeeesececesseceecseeeeeeseeaceeseceesseeeaecsaecseeeaesaeeseeeaerseeeaeeeaeseeeseseaeeneeeaees 98 GetWatermarklImageOptionFloat2 98 GetWatermarklmageQptiO0NLONY coococconccnnnnncnicnnncnnccnncn nori cn orcos 99 GetWatermarklMageOptionLOng2 eseessssesseceeeeeeeeseeeeeseesaeeeneeaeesaeeseeeaeeaesaeesaeseesaeeeaeseaseeeeaeeeeeeaeeeas 100 GetWatermarklMageOPtionString AO 100 GetWatermarklMageOPtionStringG2 ceeeeeceeceseeeeeeeeeeeeceeeeeeecaeseeeseeeeaeeseeeaeeeeesaeesaeseeeseeeaeeeeeseseateneeeaeeaas 101 GetWatermarkTextOptionBool cecesseesesesseceeeceeeeaeeeeesseeeaeeeeeaeeeaesseeeaeeeaeeaeesaecneesaeeaeseceeaeeeaeeenseaeenas 101 GetWatermarkTextOptionBoOdl2 icocinnin sctedi iapesdevsbeareneenonicanecdeus estes aeeiiaii elvabeebogneds 102 GetWatermarkT extOption Float cecescessssceeseceeeeeeeeaeeeeeeseeeaeeseeesecaeeseeeaeeaesaeesaeeaeesaeeeaeseeseaeeeateeeeeaeeeas 103 GetWatermarkTextOptionFloat2 103 GetWatermarkTextOptionLong sceceesceesseseeseceeeeeeeeaeeeeeeeeeaecenesseeaeeseeeaeeeaesaeesaesaeecaeeeaeseaeeeeeaeeeeeeaeenas 104 GetWatermarkTextOption Long nsnsi aedade read Maa Ainii 104 GetWatermarkT extOptionString
127. d the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 148 SetLayoutOptionLong2 The SetLayoutOptionLong2 method sets an option of long type for a layout object HRESULT SetLayoutOptionLong2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption in LONG p_lValue gt Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout2 p_wsOption in option constant p_lValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 149 SetLayoutOptionString The Se
128. d2 if hThread3 gt wait to stop processing events WaitForSingleObject hThread3 INFINITE CloseHandle hThread3 return 0 HANDLE CreatePrtThread LPWSTR p_strPrinterName LPWSTR p_wsPortName LPWSTR p_wsFileName PRT_THREAD_PARAM pParams DWORD dwThreadId Transmit parameters for thread pipe handle and PDF temp file name pParams PRT_THREAD PARAM GlobalAlloc LPTR sizeof PRT_THREAD PARAM wcscpy pParams gt wsPrinterName p_strPrinterName wcscpy pParams gt wsPortName p_wsPortName novaPDF SDK 8 User Manual Copyright 2015 Softland 180 novaPDF SDK 8 wcscpy pParams gt wsFileName p_wsFileName Create the thread HANDLE hThread CreateThread NULL no security attribute default stack size LPTHREAD_START_ROUTINE PrtThreadProc LPVOID pParams thread parameter not suspended amp dwThreadId returns thread ID return hThread DWORD WINAPI PrtThreadProc LPVOID lpParameter 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 Read thread s parameter a handle to a pipe instance and the name of the temporary PDF file PRT_THREAD_PARAM pParams PRT_THREAD_PARAM 1pParameter INovaPdfOptions pNova 0 hr CoCreateInstance __uuidof NovaPdfOptions8 NULL CLSCTX_INPROC_SERVER __uuidof INovaPdfOptions8
129. der The COM is first registered when installed with novaPDF SDK If you want to register unregister novaPDF COM manually use the following commands from the command line Register regsvr32 exe C Program Files Softland novaPDF 8 SDK Lib i386 novapi80 dll or for x64 systems regsvr32 exe C Program Files Softland novaPDF 8 SDK Lib x64 novapi80 dll Unregsiter regsvr32 exe u C Program Files Softland novaPDF 8 SDK Lib i386 novapi80 dll or for x64 systems regsvr32 exe u C Program Files Softland novaPDF 8 SDK Lib x64 novapi80 dll msi In the C Program Files Softland novaPDF 8 SDK Installer folder there are two msi that install the x86 or x64 version of the COM and register it These only install the COM and they are meant to be novaPDF SDK 8 User Manual Copyright 2015 Softland 26 novaPDF SDK 8 2 4 2 2 4 3 used on client computers if you install novaPDF printer on a server and run your application from different computers novaPDF8COM x86 msi novaPDF8COM x64 msi How to use the COM 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 8 printer 2 Call the Initialize method Initialize method has one parameter the name of the printer for example novaPDF SDK 8 or when on the network server name novaPDF SDK 8 3 Set novaP
130. document is C temp test doc to PDF using Word OLE automation and j Interop j Interop is a Java Open Source library under LGPL that implements the DCOM wire protocol MSRPC to enable development of Pure Bi Directional Non Native Java applications which can interoperate with any COM component j Interop can be found at http www j interop org Note If you encounter problems or have questions on using j Interop visit their FAQ page at http www j interop org faq html Also to avoid the Logon failure unknown user name or bad password error configure DCOM for remote access detailed here http j integra intrinsyc com support com doc remoteaccess html winxp and make sure your firewall is not turned on SOURCE CODE FOR WORD OLE SAMPLE MAIN JAVA package wordole import java io File import java util logging Level import org jinterop dcom common JIException import org jinterop dcom common JISystem import org jinterop dcom core IJIComOb ject import org jinterop dcom core JIComServer import org jinterop dcom core JIProgId import org jinterop dcom core JISession import org jinterop dcom core JIString import org jinterop dcom core JIVariant import org jinterop dcom impls JIObjectFactory import org jinterop dcom impls automation IJIDispatch 333333333 Eh Cas Ga ls al es E a ta novaPDF SDK 8 User Manual Copyright O 2015 Softland 188 novaPDF SDK 8
131. e 2 show bookmarks panel 3 show pages panel 4 Full screen 5 show layers panel 6 show attachments panel novaPDF SDK 8 User Manual Copyright O 2015 Softland 34 novaPDF SDK 8 NOVAPDF_VIEWOP_START_PAG NOVAPDF_VIEWOP_ZOOM O Default viewer settings 1 Default 2 Fit Width 3 Fit Height 4 Fit Page 5 Percent 6 Fit Visible NOVAPDF_VIEWOP_USE_START_PAG NOVAPDF_VIEWOP_PAGE_SCALING 0 Application Default NOVAPDF_VIEWOP_TRANSITION_TYP O Viewer default Replace Split Blinds Box Wipe Dissolve Glitter Fly in Fly out Push Cover Uncover Fade TION 1 vertical O ION Tas too _ fave ECH too _ fave C37 tor __ fave _FULLSCREE 39 long O Viewer default 1 None 2 Bookmarks 3 Pages 4 Layers novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 35 SECURITY Constant name Value Type Possible values Default value RITY_FLAG_MODIFYDOC 113 E ER wo gt vo N n n 1a m o gt m O false 1 true O false 1 true O false 1 true false O false 1 true false RITY_FLAG_EXTRACTTE 114 RITY_ FLAG _MODIFYANN E E ul RITY_FLAG_ADVANCE RITY_FLAG_ADVANCE E E 00 string encrypte d RITY_FLAG_ASSE E E N RITY
132. e Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 165 SetWatermarklmageOptionEncryptedString2 The SetWatermarklImageOptionEncryptedString2 method sets a watermark image option of encrypted string type HRESULT SetWatermarkImageOptionEncryptedString2 in string BSTR p_pwsWatermarkld in LONG p_nOption in BSTR p_wsValue novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 135 i Parameters p_pwsWatermarkIid in watermark id obtained with GetWatermarkImage2 p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 166 SetWatermarklmageOptionFloat The SetWatermarklImageOptionFloat method se
133. eProfile2 strProfilelD m_NovaOptions SetDefaultPrinter Dim strToExecute As String Dim r As Long m_NovaOptions RegisterEventWindow Me hwnd m_NovaOptions LicenseShellExecuteFile txtFileToConvert r ShellExecute Me hwnd print txtFileToConvert SW_HID btnStartPrinting Enabled True Gl 6 Restore default printer when printing finished novaPDF SDK 8 User Manual Copyright 2015 Softland 198 novaPDF SDK 8 2 5 8 3 Private Sub OnNovaPDFFileSaved wParam As Long lParam As Long m_NovaOptions UnRegisterEventWindow m_NovaOptions RestoreDefaultPrinter End Sub Private Sub OnNovaPDFPrintError wParam As Long lParam As Long Select Case wParam Case ERROR_MSG_TEMP_FILE sgBox Error saving temporary file on printer server vbOKOnly novaPDF Case ERROR_MSG_LIC_INFO sgBox Error reading license information vbOKOnly novaPDF Case ERROR_MSG_SAVE_PDF sgBox Error saving PDF file vbOKOnly novaPDF Case ERROR_MSG_JOB_CANCELED sgBox Print job was canceled vbOKOnly novaPDF End Select m_NovaOptions UnRegisterEventWindow m_NovaOptions RestoreDefaultPrinter End Sub Word OLE VB The Word OLE VB sample is a simple Windows console application that converts a MS Word document C Test doc to PDF using Word OLE automation Source code Attribute VB_Name Modulel Private Declare Sub Sleep L
134. ed NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_PROFILE_SAVE_ERROR cannot save new profile dd GI Remarks novaPDF SDK 8 User Manual Copyright O 2015 Softland 56 novaPDF SDK 8 The newly created profile contains default settings 2 4 10 4 10 AddProfile2 The AddProfile2 method adds a new profile HRESULT AddProfile2 in string BSTR p_wsProfileName in BOOL p_bPublicProfile out string BSTR p_pwsNewProfileld Parameters p_wsProfileName in name of the profile to add p_bPublicProfile in Flag if the profile is a public or a private profile p_pwsNewProfileld out return profile id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_PROFILE_SAVE_ERROR cannot save new profile Remarks The newly created profile contains default settings 2 4 10 4 11 AddWatermarklmage The AddWatermarklmage method adds a new image watermark HRESULT AddWatermarkImage out string LPWSTR p_pwsNewWatermarkId out string LPWSTR p_pwsNewLayoutId i Parameters p_pwsNewWatermarkld out string return new watermark id p_pwsNewLayoutld in string return layout id for the new watermark Return values S_OK on success
135. eeas 138 novaPDF SDK 8 User Manual Copyright 2015 Softland Contents 7 SetWatermarkTextOptionBool SetWatermarkTextOptionBool2 SetWatermarkTextOptionFlOAt oooonocccnccnnncnnncccconccononconncnononcono nono nc conc non cnn nn carr E aio aeea Teetar rn aan r can cnana nina SetWatermarkT extOption Float cocina dd 140 SetWatermarkT extOptionLong ececesceessescesseceeeeeeeeaeceeeeeeeaeeeeesseeeaesseeeaeeeaeeaeessesaesaeeeaeseaseseeeaeseneeaeenas 141 SetWatermarkTextOption bong ici a 141 SetWatermarkT extOptionString ce esceesescesseceeeceeeeaeeeeeeeesseseeeeseeeaeeseeeaeeeaesaeesaeseaecseeeaeseeseeseaeeeeeeaeeeas 142 SetWatermarkTextOptionString2 esesecesceeseeeeceseeeaeseeeeeeeaeceeeseesaeeseeeaeececseeeaeseesseseaeseaeeaeseaeeseseaeeaas 142 UnRegisterEventWindow WaitForNova Event itni aa ea a ea e Pinta tide edt raa E ES AA a A T What sample to Ch00S ccsccssseseseessseeseeenseesseessenseneesenesseneesseeseaeeeseersasessenesseneesenessenerseneeaceesacenenenseneesenen ACCESS nasenne PDF Reports nn II E ieaS baa ESen Faa Kaare aeb aaeain en ello Aio dle PARA BENE AEN EEE AEE AEE E TE SEE A E TANE AEE ES E A EEE Delphi prire e Ea aE a a a S MAR EEEREN EE ETEA E EE E AEE OR Hello World Delphi senenn aa nee ieee eee ee eee Word OLE Delphi eee eeeeesecececeeeeeeceeeeaeeaeeaceeseesaecseeeaeseaesaeesessaeeseesaessaesaeeeaeseeeeaeeeaecseesaeeeae
136. eeeeaeseaeeeaeeateeas A O enssedetnessecenpesdaceseXechtuseevsnsvesbersseversars Hlello World CGSNarD iia eii doce a aa aan er ae EEEN GSharp Gonvertet cia A da Word OLEG Pi iia Cr A da Hello World Hello World network s vi ncseceeen capes sae eke Saeco eee eee eee MEG Converte tis N A AAEE E E E EE AE EEEN EE E E EA AE E E MEG SGril al iio ad N MA A EE EA TATE E T EE EE AEN Multiple printers SAVE E E E E E T A A O aleea oldo saci E EEEE E ET A A dial WG EO E EEEE ENE E TEA T AE EE A AEE A A ebecrsesnerseet AIN VB Convera vcd AAA A AE EO E A aaa dia YN CS A EAT A AOA O A VBNet esses Hello World VBNEt ccccceecceeceeeeenceeeeeeeeeeeceaeceaeeceaaeeaeescaeessaeeseaeeseaeeceaeesaaeseaeeseaeeseaeeseaeeseaeeseaeeseaeesneeeseeeeaes VBNetConVerte tien ccs cisteccceticeccede iad cdeeec oes etiescben A E NR A O A A Aaa aee Sdan edia Installs O a O O Installation package bundle Index novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK novaPDF SDK 9 1 1 1 1 1 1 1 1 1 novaPDF SDK Using novaPDF SDK Create PDF from Office applications Create merge multiple documents This option allows you to batch bulk convert Office documents to PDF or merge multiple documents from different sources in a single one You can either add individual files and convert them or select entire folders and all recognized file formats will be converted to PDF Select printer In thi
137. eld in string public profile id Return values S_OK on success or COM error code NV_SERVICE_ERROR error connecting to novaPDF Server servic Remarks Sets an public profile as the active profile for the printer All users will be forced to use this public profile the cannot change the active profile 2 4 10 4 159 SetPrinterOption The SetPrinterOption method sets a general printer option of long int type HRESULT SetPrinterOption in LONG p_nOption in LONG p_lValue i Parameters p_nOption in option constant p_lValue novaPDF SDK 8 User Manual Copyright O 2015 Softland 132 novaPDF SDK 8 in long integer value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called printer name unknown NV_INVALID_OPTION cannot set a general all users option on client computers Remarks Sets general options that are not part of a profile like show or not the select profile dialog You can find the complete list of option names in the Profile option strings chapter general settings tables In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 160 SetPrinterPublicProfile The SetPrinterPublicProfile method sets the visibility of a public profile for a printer HRESULT SetPrinterPublicProfile in string LPWSTR p_ws
138. entName i Parameters p_wsEventName in Name of the event See How to use events topic for a list of possible ever Return values S_OK on success S_FALSE event cannot be created 2 4 10 4 126 RestoreDefaultPrinter The RestoreDefaultPrinter method restores the default printer to the printer that was default before calling SetDefaultPrinter HRESULT RestoreDefaultPrinter void Parameters none Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_NODEFAULT_PRINTER SetDefaultPrinter was not called Remarks After calling SetDefaultPrinter with an INovaPdfOptions object call RestoreDefaultPrinter with the same object to restore the original default printer novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 115 2 4 10 4 127 SaveProfile The SaveProfile method loads an existing profile HRESULT SaveProfile void Parameters none Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR error connecting to novaPDF Server servic NV_NO_PROFILE no profile loaded NV_PROFILE_ERROR error reading profiles NV_PROFILE_SAVE_ERROR error saving profile 2 4 10 4 128 SetActiveProfile The SetActiveProfile sets the active profile i e the profile that will be used for printing HRESULT SetActiveProfile
139. er1 Hdefine PRINTER_NAME2 L novaPDF temporary printer2 Hdefine PRINTER_NAME3 L novaPDF temporary printer3 define PORT_NAME1 novaPDF8templ define PORT_NAME2 novaPDF8temp2 define PORT_NAME3 novaPDF8temp3 define FILE_NAME1 L First pdf Hdefine FILE_NAME2 L second pdf define FILE_NAME3 L third pdf text to be written in the PDF file define PDF_TEXT L Hello world novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 179 PDF file name define PDF_FILE_NAME L HelloWorld pdf Print profile name define PROFILE_NAME L HelloWorld Profile define PROFILE_IS PUBLIC 0 typedef struct _PRT_THREAD PARAM WCHAR wsPrinterName 255 WCHAR wsPortName 255 WCHAR wsFileName 255 PRT_THREAD_PARAM DWORD WINAPI PrtThreadProc LPVOID lpParameter HANDLE CreatePrtThread LPWSTR p_strPrinterName LPWSTR p_wsFileName entry point for the console application int _tmain int argc _TCHAR argv HANDLE hThread1 CreatePrtThread PRINTER_NAME1 PORT_NAME1 FILE_NAME1 HANDLE hThread2 CreatePrtThread PRINTER_NAME2 PORT_NAME2 FILE_NAME2 HANDLE hThread3 CreatePrtThread PRINTER_NAME3 PORT_NAME3 FILE_NAME3 if hThread1 gt wait to stop processing events WaitForSingleObject hThread1 INFINITE CloseHandle hThread1 if hThread2 gt wait to stop processing events WaitForSingleObject hThread2 INFINITE CloseHandle hThrea
140. es S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong image watermark index 2 4 10 4 33 DeleteWatermarkText The DeleteWatermarkText method deletes an existing watermark text HRESULT DeleteWatermarkText in string LPCWSTR p_wsWatermarkId Parameters p_wsWatermarkId in pointer to a null terminated Unicode string containing the watermark id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong text watermark index 2 4 10 4 34 DeleteWatermarkText2 The DeleteWatermarkText2 method deletes an existing watermark text HRESULT DeleteWatermarkText2 in string BSTR p_wsWatermarkId Parameters p_wsWatermarkId in the watermark id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong text watermark index 2 4 10 4 35 GetActiveProfile The GetActiveProfile retrieves the id of the active profile i e the profile that is used for printing HRESULT GetActiveProfile out LPWSTR p_wsProfileld gt novaPDF SDK 8 User Manual Copyright 2015 Softland 66 novaPDF SDK 8 Parameters p_wsProfileld out pointer to a pointer to a n
141. es Public Function VB_WindowProc ByVal hwnd As Long ByVal wMsg As Long ByVal wParam As Long ByVal lParam As Long As Long For the registered messages perform specific tasks If wMsg wm_Nova_FileSaved Then OnNovaPDFFileSaved wParam lParam Exit Function End If If wMsg wm_Nova_PrintError Then OnNovaPDFPrintError wParam lParam Exit Function End If For other messages just send them via normal old handling process VB_WindowProc CallWindowProc oldHandler hwnd wMsg wParam lParam End Function 3 Initialize INovaPdfOptions novaPDF SDK 8 User Manual Copyright 2015 Softland 196 novaPDF SDK 8 Private Sub Form_Load On Dim Dim Dim Dim Dim Error GoTo strProfil strProfil strActive nPublicPr nActivePu ErrorHandler eID As String eName As String ProfileID As String ofile As Long blicProfile As Long initialize the NovaPdfOptions object to use with a printer licensed for SDK m_NovaOptions Initialize PRINTER_NAM moB ts the va E lue of the windows messages handler to VB_WindowProc and sets the old handler address of function oldHandler VB_WindowProc SetWindowLongApi Me hwnd cmbProfiles Clear Call AddSmall Cal Size 1 AddFullOptions get the active profile m_NovaOptions GetActiveProfile2 strActiveProfileID in oldHandler GWL_WNDPROC AddressOf m_NovaOptions GetFir
142. ess or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 164 SetWatermarklmageOptionEncryptedString The SetWatermarkimageOptionEncryptedString method sets a watermark image option of encrypted string type HRESULT SetWatermarkImageOptionEncryptedString in string LPWSTR p_pwsWatermarkId in LONG p_nOption in LPCWSTR p_wsValue i Parameters p_pwsWatermarkIid in watermark id obtained with GetWatermarkImage p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in th
143. eteNovaPrinter2 casitas ai aia Ads 62 DeletePrinterActivePublicP role sera 63 DeletePrinterActivePublicProfile2 aee eaa reena aa a a aa eaa cnn ae de r cn can Ln E rE Eea 63 DeleteProfile cio a AAA AAA 63 DeleteProfile2 ac A A AAA AAA AAA 64 DeleteWatermarklMage iss ssi thas const rd aie eit eee ii 64 Delete Watermark Mage i i csciceiiecdecscoussvtsecuscncsveseeesdsevecedasced see ecseusedsn set cousdesvsevdaroevereeoaganscresuseceversessedenseres 64 Delete Watermark TeX bso AA ts 65 Delete Watermark Tel iii AA aia AAA da 65 GetActive Profile yt A ena 65 GetActiveProfile2 sm 66 GelBook Mak DON iii AAA AAA RA 66 GetBookmarkDefinition2 iii nt tie ig eid a OASIS da 67 GetBookmarkDefinitionCOLN Emi t 68 GetContentl ayout sec aun dr 69 GetContentLayout2 sm 69 GetEmail ERAS AA AAA AAA Aid 70 GetEmail2 2 aa AA A IA es 70 GetEmallCount ti A A ie Ai SA ens edie ais 71 GetEmallOptionBOOL sixisorirara iaa 71 GetEmailOPtionBOol2 i aci A AAA AAA dE 72 GetEmailOptionEncryptedStridg ici a 72 GetEmailOptionEncryptedStriNg2 xmmmriint ii td 73 GetEmailOptionLong we 73 GetEmailOptionLong2 74 GetEmailOptionString 74 GetEMallOptiOn String vic A dd td 75 G etEmailRecipicnt vez 2 20 29 sae ages AAA ea oa 76 GetEmailRecipient2 mo 76 GetEmaillRecipientCoUNt iii A A 77 GetEmailRecipientE out iii llas 77 GetFirstProfile uri AAA AAA e aa 78 GetFirstProfile nai AAA AAA td 78 G tF ntOptior
144. file 14 insert before pdf file could not read file 15 overlay pdf file no or wrong password 16 overlay pdf file could not read file 18 sign PDF error signing 19 sign PDF error creating signature form 20 sign PDF image file not found 21 image watermark error drawing 22 overlay error drawing How to register windows messages You can register windows messages using RegisterWindowMessage function Here are some samples of how to do it MFC Converter VCL Converter VB Converter 2 4 10 3 What is INovaPdfOptions The INovaPdfOptions interface represents a COM object that allows the developers to set printing parameters for novaPDF SDK 8 This interface is derived from IDispatch interface directly This interface resides in the novapi8 dll module that is distributed with the novaPDF SDK and is registered at install time INovaPdfOptions has next methods Initialization Initialize Initialize2 InitializeSilent InitializeSilent2 Get Set Options GetOptionString GetOptionString2 SetOptionString SetOptionString2 GetOptionLong SetOptionLong SetOptionBool GetOptionBool SetOptionEncryptedString SetOptionEncryptedString2 GetOptionEncryptedString GetOptionEncryptedString2 novaPDF SDK 8 User Manual Copyright 2015 Softland 46 novaPDF SDK 8 Fonts options GetFontOption GetFontOption2 SetFontOption SetFontOption2 ClearFontOptions Bookmarks options AddBookmarkDefin
145. g LPWSTR p_pwsWatermarkId in LONG p_nOption in LPCWSTR p_wsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called novaPDF SDK 8 User Manual Copyright O 2015 Softland 138 novaPDF SDK 8 NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 171 SetWatermarklmageOptionString2 The SetWatermarklImageOptionString2 method sets a watermark image option of string type HRESULT SetWatermarkImageOptionString2 in string BSTR p_pwsWatermarkld in LONG p_nOption in BSTR p_wsValue gt Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initial
146. ges Use it when your application runs as a windows service or ona server computer 2 4 10 4 116 LicenseApplication The LicenseApplication method licences an application to print to novaPDF HRESULT LicenseApplication in BSTR p_pwstrAppName i novaPDF SDK 8 User Manual Copyright 2015 Softland 110 novaPDF SDK 8 Parameters p_pwstrAppName in pointer to a Unicode string containing the name of the application that wi Return values S_OK on success or COM error code Remarks This method must be called prior to launching the application with the specified name This call assures that the application will print without the notice on bottom of pages 2 4 10 4 117 LicenseOLEServer The LicenseOLEServer method license the OLE server prior initialized with InitializeOLEServer HRESULT LicenseOLEServer void Return values S_OK on success or COM error code Remarks This method must be called after initializing the OLE object that will perform the print to the novaPDF SDK 8 2 4 10 4 118 LicenseShellExecuteFile The LicenseShellExecuteFile method licences a document to be printed with ShellExecute HRESULT LicenseShellExecuteFile in BSTR p_pwstrFileName Parameters p_pwstrFileName in pointer to a Unicode string containing the name of the file that will be 1 Return values S_OK on success or COM error code Remarks This method must be called prior to calling the Shell
147. gt Const PRINTER_NAME As String novaPDF SDK 8 Const PROFILE_NAME As String Word OLE VBNet Const PROFILE_IS_PUBLIC As Integer 0 Const NOVAPDF_INFO_SUBJECT As Integer 68 Sub Main create the NovaPdfOptions80 object Dim pNova As NovaPdfOptions80 pNova New NovaPdfOptions80 Dim activeProfile As String Dim newProfileID As String String Empty initialize the NovaPdfOptions80 object if you have an application license for novaPDF SDK pNova Initialize PRINTER_NAME save old active profile id pNova GetActiveProfile activeProfile create new profile Nova AddProfile PROFILE_NAME PROFILE_IS_PUBLIC newProfilelD load the new profile pNova LoadProfile newProfilelD and set some options pNova SetOptionString NOVAPDF_INFO_SUBJECT C Word OL T O T El document pNova SaveProfile set the copy profile as active profile pNova SetActiveProfile newProfilelD set nova default printer pNova SetDefaultPrinter print word document Dim objWord As Object Dim objDoc As Object pNova InitializeOLEUsage Word Application objWord CreateObject Word Application pNova LicenseOLEServer ob jDoc objWord Documents Open C temp test docx False True objDoc PrintOut False objDoc Close False objWord Quit False restore active profile If activeProfile Length gt 0 AndAlso activeProfile CompareT
148. hen pressing the inject button the new customized msi files will be created The settings you filled in these pages can be saved in an ini file in the branding folder After running the tool next msi files will be available in the branding folder novaPDF8PrinterDriver x64 msi or novaPDF8PrinterDriver x86 msi each of them installs both 32 and 64 bit versions of the printer driver novaPDF8COM x64 msi or novaPDF8COM x86 msi install 32 and 64 bit versions of the COM novaPDF8SDK x64 msi or novaPDF8SDK x86 msi install the custom licensed printer Note After the msi files are injected with your custom parameters their digital signature becomes invalid so they need to be signed again See more details in the topic Build an installation package bundle Build an installation package bundle If you already have an installation package for your application you only need to add the novaPDF 8 SDK Developer msi files to your package If not you can start with the installation package sample we included with novaPDF 8 SDK Developer Follow the steps below to create the bundle 1 Install WIX Toolset 3 9 This is a free and open source set of tools for building Windows installation packages You will use this to create the bundle 2 Sign the novaPDF 8 SDK Developer msi files All msi files have to be signed with a valid digital signature You can sign them by running the signtool exe tool and providing your company digital signature fi
149. hicsOptions pNova AddSecurityOptions pNova AddSaveOptions pNova AddAfterSaveActions pNova AddEmailOptions pNova AddWatermarkImage pNova AddWatermarkText pNova AddPageContentOptions pNova AddOverlayOptions pNova AddSignatureOptions pNova AddEmbedFontsOptions pNova AddBookmarksDefinitions pNova the new added profile SaveProfile profile as active profile SetActiveProfile newProfilelD page using the previously set active New PrintDocument PRINTER_NAME AddressOf PrintPageFunction pd Print If activeProfile Length gt 0 And activeProfile CompareTo PROFILE_NAME lt gt 0 Then pNova SetActiveProfile activeProfile pNova DeleteProfile newProfilelD Ena TE Catch e As System Runtime InteropServices COMException MessageBox Show e Message Catch e As Exception MessageBox Show e Message End Try End Sub and finally the function that actually prints the page Private Sub PrintPageFunction ByVal sender As Object PrintPageEventArgs Dim str As String Dim font As Font Dim brush As Brush ByVal ev As novaPDF says Hello World from VB Net New Font Arial New SolidBrush Color Black 16 ev Graphics DrawString str font brush 20 0 20 0 ev HasMorePages False End Sub novaPDF SDK 8 User Manual Copyright O 2015 Softland 202 novaPDF SDK 8 2 5 9 2 End Module VBNet Converter The VBNe
150. ib kernel32 ByVal dwMilliseconds As Long the novapiLib and novapiLibDemo packages must be added as a COM reference Const PRINTER_NAME As String novaPDF SDK 8 Const PROFILE_NAME As String VB Word OLE Const PROFILE_IS_PUBLIC As Long 0 The main entry point for the application Public Sub Main On Error GoTo ErrorHandler create the NovaPdfOptions object Dim pNova As New NovaPdfOptions80 Dim sOldActiveProfileID As String Dim sNewProfileID As String initialize the NovaPdfOptions object to use with a printer licensed for SDK pNova Initialize2 PRINTER_NAME pNova GetActiveProfile2 sOldActiveProfilelD create new profile On Error Resume Next pNova AddProfile2 PROFILE_NAME PROFILE_IS_PUBLIC sNewProfilelD pNova LoadProfile2 sNewProfilelD and set some options pNova SetOptionString2 NOVAPDF_DOCINFO_SUBJECT Test OLE document save profile changes T novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 199 2 5 9 2 5 9 1 pNova SaveProfile set as active profile for printer pNova SetActiveProfile sNewProfilelD set nova default printer pNova SetDefaultPrinter print word document Dim objWord As Object Dim objDoc As Object pNova InitializeOLEUsage Word Application Set objWord CreateObject Word Application pNova LicenseOLEServer Set objDoc objWord Documents Open C Test do
151. ile ROFILE_IS_ PUBLIC 0 U U var novaPDF SDK 8 User Manual Copyright 2015 Softland 154 novaPDF SDK 8 hr HRESULT pNova INovaP strOldActi strNewProf decomment ne dfOptionss80 veProfileID WideString ileID WideString xt code if you use workaround for printer index s below Device Driver Port array 0 80 of Char DevMode THandle begin initialize COM hr Activex CoInitialize nil if FAILED hr then begin System Writeln Failed to initialize COM exit end create one NovaPdfOptions instance pNova nil hr ActiveX CoCreateInstance CLASS _NovaPdfOptionss80 CLSID_CNovaPdfSource if FAILED hr nil CLSCTX_INPROC_SERVER IID_INovaPdfOptions80 pNova then begin System Writeln Failed to create novaPDF COM object exit end initial licensed for SDK lize the NovaPdfOptions object to use with a printer pNova Initialize2 PRINTER_NAME pNova SetDefaultPrinter now the default printer is novaPDF printer but the Printer object is not updated here is a workaround to update the Printer object with the default printer you only need this code if you check later on the Printer PrinterIndex to find out the default printer Printer GetPrinter Device Driver Port DevMode Printer SetPrinter PRINTER_NAME Driver Port 0 cre
152. iles novaOptions h novaOptions pas Globals bas 2 4 10 4 96 GetWatermarklmageOptionLong The GetWatermarkimageOptionLong method retrieves a watermark image option of long int type HRESULT GetWatermarkImageOptionLong in string LPWSTR p_pwsWatermarkId in LONG p_nOption out LONG p_plValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_nOption in option constant p_plValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaPDF SDK 8 User Manual Copyright 2015 Softland 100 novaPDF SDK 8 novaOptions h novaOptions pas Globals bas 2 4 10 4 97 GetWatermarklmageOptionLong2 The GetWatermarkimageOptionLong2 method retrieves a watermark image option of long type HRESULT GetWatermarkImageOptionLong2 in string BSTR p_pwsWatermarkld it LONG p_nOption
153. iles on novaPDF SDK 8 C Hello World CSharp a simple Windows console application that prints one page to the novaPDF SDK 8 C CSharp Converter converts an existing file to PDF using different profiles on novaPDF SDK 8 C Word OLE CSharp converts a document created with Microsoft Word to PDF using Word automation Delphi Hello World Delphi a Delphi application that prints using the Printer object Delphi VCL Converter a Delphi application that converts an existing file to PDF using different profiles on novaPDF SDK 8 Delphi Word OLE Delphi converts a document created with Microsoft Word to PDF using Word automation Java Hello World Java an Java application that prints using the Printer object Java Word OLE Java converts a document created with Microsoft Word to PDF using Word automation VB Hello World VB a VB application that prints using Printer object novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 15 2 2 4 VB VB Converter a VB application that converts an existing file to PDF using different profiles on novaPDF SDK 8 VB Word OLE VB converts a document created with Microsoft Word to PDF using Word automation VBNet Hello World VBNet a VBNet console application that prints one page to the novaPDF SDK 8 VBNet VBNet Converter a VBNet application that converts an existing file to PDF using different profiles on novaPDF SDK 8 VBNet Word OLE VBNet
154. in BSTR p_wsPrinterName novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 55 in string BSTR p_wsOEMID in string BSTR p_wsServicePort in string BSTR p_wsLicenseKey i Parameters p_wsPrinterName in pointer to a null terminated Unicode string containing the name of the pri p_wsOEMID in custom OEMID for trial is nPdfSdk8_Softland p_wsServicePort in novaPDF Server service port number p_wsLicenseKey in license key Return values S_OK on success or COM error code NV_NOT_A_NOVAPDF_PRINTER invalid OEMID NV_INVALID_PRINTER_NAME a printer with the specified name cannot be added Remarks This method must be called before printing documents and setting novaPDF options It will add a printer in the system with the specified name This printer will be available until DeleteNovaPrinter is called with the same printer name Use this method if you wish to work with temporary printers 2 4 10 4 9 AddProfile The AddProfile method adds a new profile HRESULT AddProfile in string LPCWSTR p_wsProfileName in BOOL p_bPublicProfile out string LPWSTR p_pwsNewProfileld y Parameters p_wsProfileName in name of the profile to add p_bPublicProfile in Flag if the profile is a public or a private profile p_pwsNewProfileld out return profile id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not call
155. int job that will be executed by the printer the calls of LicenseApplication and the execution of a print job must go in pair If you call several times LicenseApplication in your code but the printer processes some of the jobs later they might not be licensed So to assure these pair executions use next two calls when printing novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 29 2 4 8 Before starting the print job call RegisterNovaEvent NOVAPDF_EVENT_START_DOC After sending the print job wait for the printer to start processing it and read the licensing for it by calling WaitForNovaEvent 1 amp bTimeout Use temporary printers If you do not wish a novaPDF printer visible in the Printers list you could use this approach When customizing your installer do not add a printer see Customize your setup What this means is that only the novaPDF printer driver and the COM are installed but no printer is added in the Printers list In your application code when you want to use novaPDF to convert to PDF first call AddNovaPrinter to add a temporary printer set the printer options using the SetOptionXXX methods print a document or several documents to generate PDF files delete the temporary printer with DeleteNovaPrinter You may call the AddNovaPrinter and DeleteNovaPrinter several times the only restriction is to call it in pair so you do not leave unused printers in the printers
156. ionBool2 in string BSTR p_pwsWatermarkld in LONG p_nOption out BOOL p_pbValue Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 p_nOption in option constant p_pbValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 103 2 4 10 4 102 GetWatermarkTextOptionFloat The GetWatermarkTextOptionFloat method retrieves a watermark text option of float type HRESULT GetWatermarkTextOptionFloat in string LPWSTR p_pwsWatermarkId A LONG p_nOption out FLOAT p_pfValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText p_nOption in option constant p_pfValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on su
157. ions You can use INovaPdfOptions interface to read or set novaPDF SDK 8 options INovaPDFOptions provides the following methods for this GetOptionString SetOptionString novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 27 2 4 4 2 4 5 GetOptionLong SetOptionLong SetOptionBool GetOptionBool The options are saved in the current loaded profile See Private and public profiles topic for more details about profiles You have to make these settings before starting the print job You can find the complete list of option constants that you can use in the GetOptionXXXX and SetOptionXXXX in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas Before setting the options the profile should be loaded with LoadProfile and when finish the profile should be saved with SaveProfile Before printing a document set the profile you wish to use with SetActiveProfile Private and public profiles Public profiles are visible from all client computers and from all users With the Profile Manager tool you are only allowed to create public profiles on the printer server computer but with novaPDF SDK you may create public profiles from any computer You should use public profiles if you want to configure printing options that should be used by several compute
158. ition AddBookmarkDefinition2 ModifyBookmarkDefinition ModifyBookmarkDefinition2 DeleteBookmarkDefinition GetBookmarkDefinition GetBookmarkDefinition2 GetBookmarkDefinitionCount Image watermarks options AddWatermarklmage AddWatermarklmage2 DeleteWatermarklmage DeleteWatermarkimage2 GetWatermarklmage GetWatermarklmage2 GetWatermarklmageCount SetWatermarkImageOptionString SetWatermarkImageOptionString2 SetWatermarkImageOptionLong SetWatermarkImageOptionLong2 SetWatermarkImageOptionBool SetWatermarkImageOptionBool2 SetWatermarkImageOptionFloat SetWatermarkImageOptionFloat2 GetWatermarkImageOptionString GetWatermarkImageOptionString2 GetWatermarkImageOptionLong GetWatermarkImageOptionLong2 GetWatermarkImageOptionBool GetWatermarkImageOptionBool2 GetWatermarkImageOptionFloat GetWatermarkImageOptionFloat2 SetWatermarkImageOptionEncryptedString SetWatermarkImageOptionEncryptedString2 GetWatermarkImageOptionEncryptedString GetWatermarkImageOptionEncryptedString2 Text watermarks options AddWatermarkText AddWatermarkText2 DeleteWatermarkText novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 47 DeleteWatermarkText2 GetWatermarkText GetWatermarkText2 GetWatermarkTextCount SetWatermarkTextOptionString SetWatermarkTextOptionString2 SetWatermarkTextOptionLong SetWatermarkTextOptionLong2 SetWatermarkTextOptionBool SetWatermarkTextOptionBool2 SetWatermarkTextOptionFloat SetWatermarkTextOption
159. ize was not called NV_UNKNOWN_PROFILE no profile loaded 2 4 10 4 40 GetContentLayout The GetContentLayout method retrieves the content object and its layout object HRESULT GetContentLayout out string LPWSTR p_pwsContentId out string LPWSTR p_pwsLayoutId i Parameters p_pwsContentId out string content id p_pwsLayoutId out string layout id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_PROFILE_ERROR error reading profile Remarks The content layout defines how the printed content will be positioned on the PDF page There is only one content object in the profile For layout options see Working with Layout objects 2 4 10 4 41 GetContentLayout2 The GetContentLayout2 method retrieves the content object and its layout object HRESULT GetContentLayout2 out string BSTR p_pwsContentId out string BSTR p_pwsLayoutId i Parameters p_pwsContentld out string content id p_pwsLayoutld out string layout id Return values novaPDF SDK 8 User Manual Copyright O 2015 Softland 70 novaPDF SDK 8 S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_PROFILE_ERROR error reading profile Remarks The content layout defines how the printed content will be posi
160. ize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 172 SetWatermarkTextOptionBool The SetWatermarkTextOptionBool method sets a watermark text option of boolean type HRESULT SetWatermarkTextOptionBool in string LPWSTR p_pwsWatermarkId in LONG p_nOption in BOOL p_bValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText p_nOption in option constant novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 139 p_bValue in boolean value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings
161. k image option of boolean type HRESULT SetWatermarkImageOptionBool in string LPWSTR p_pwsWatermarkId in LONG p_nOption in BOOL p_bValue Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_nOption in option constant p_bValue in boolean value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 163 SetWatermarklmageOptionBool2 The SetWatermarklmageOptionBool2 method sets a watermark image option of boolean type HRESULT SetWatermarkImageOptionBool2 in string BSTR p_pwsWatermarkld in LONG p_nOption in BOOL p_bValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_bValue in boolean value to set novaPDF SDK 8 User Manual Copyright 2015 Softland 134 novaPDF SDK 8 Return values S_OK on succ
162. l terminated Unicode string containing the license key Return values S_OK on success or COM error code NV_INVALID_PRINTER_NAME cannot find printer with given printer name NV_NOT_A_NOVAPDF_PRINTER printer is not a novaPDF SDK 8 NV_INVALID_ LICENSE cannot read license or not a SDK license NV_SERVICE_ERROR cannot connect to novaPDF Server servic Remarks This method can be used instead of the Initialize method when you don t want to have message boxes shown with error messages Use it when your application runs as a windows service or ona server computer 2 4 10 4 115 InitializeSilent2 The InitializeSilent2 method initializes the INovaPdfOptions interface silently HRESULT InitializeSilent2 in BSTR p_wsPrinterName in BSTR p_wsLicenseKey Parameters p_wsPrinterName in pointer to a BSTR containing the name of the printer to configure p_wsLicenseKey in pointer to a BSTR containing the license key Return values S_OK on success or COM error code NV_INVALID_PRINTER_NAME cannot find printer with given printer name NV_NOT_A_NOVAPDF_PRINTER printer is not a novaPDF SDK 8 NV_INVALID_LICENSE cannot read license or not a SDK license NV_SERVICE_ERROR cannot connect to novaPDF Server servic Remarks This method can be used instead of the Initialize method when you don t want to have message boxes shown with error messa
163. le If you do not have a digital signature file you can upload the msi files on our site to be signed with Softland s signature here https secure novapdf com requestCodeSignForm You will be requested to enter your novaPDF 8 SDK Developer license key your email address and the path to the msi file You have to upload and sign these two msi files novaPDF8SDK x64 msi novaPDF8SDK x86 msi novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 21 2 3 5 You will receive an email with the download link for the signed msi files 3 Open the Installation package bundle sample and build the setup executable In the sample you have to change the defined variables with information about your application application name company name version company site url It is very important to change the Upgrade code to a new generated GUID because each application should have its unique GUID so it installs separately on Windows Also take care to set the correct path of the novaPDF 8 SDK Developer msi files If you wish to sign the bundle exe you have to use your company s signature Use the signtool exe and the insignia exe tools to sign like this C Program Files x86 WiX Toolset v3 9 bin insignia exe ib C Users Public Documents novaPDF 8 OEM Samples OEMBundle OEMBundle bin Release OEMBundle exe o C Users Public Documents novaPDF 8 OEM Samples OEMBundle OEMBundle bin Release tmp exe
164. list When deleting a printer there might happen that the jobs are not all processed yet and there are still jobs in the printer queue If you wish those PDF file to be generated then is better to wait for the PDF to be finished before deleting the printer It is recommended to use the event methods we provide How to use events Network printing If you wish to install novaPDF printer on a server and share it in the network then a printer has to be added at installation time on the server or the AddNovaPrinter and DeleteNovaPrinter must be called from an application running on server This solution works on client computers by adding a printer connection to the printer on server instead of adding a local printer So in this situation these are the changes the installer must be run on the server normally installing a printer there the application code is the same only the printer name must contain the server path like this lt server name gt lt printer name gt where the lt printer name gt printer must exist on server Restrictions On some operating systems you need administrative rights to add delete a printer Below you can see a list of operating systems supported by novaPDF and what type of user accounts are working Administrator Windows XP yes ne i ie novaPDF SDK 8 User Manual Copyright 2015 Softland 30 novaPDF SDK 8 Windows 2003 Server Windows 2008 Server Windows 2012 Server 2 4
165. ll terminated Unicode string that will contal novaPDF SDK 8 User Manual Copyright O 2015 Softland 98 novaPDF SDK 8 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 94 GetWatermarklmageOptionFloat The GetWatermarklImageOptionFloat method retrieves a watermark image option of float type HRESULT GetWatermarkImageOptionFloat in string LPWSTR p_pwsWatermarkId in LONG p_nOption out FLOAT p_pfValue i Parameters p_pwsWatermarkIid in watermark id obtained with GetWatermarkImage p_nOption in option constant p_pfValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERRO
166. llMethod SetOptionLong new Object NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_SIMPLE catch JIException except System out println Set options except printsStackTrace SAVE PROFILE try pNovaDispatch callMethod SaveProfile2 catch JIException except System out println SaveProfile2 except printsStackTrace SET IT AS ACTIVE PROFILE try set the copy profile as active profile pNovaDispatch callMethod SetActiveProfile2 new Object new JIString activeProfile novaPDF SDK 8 User Manual Copyright O 2015 Softland 186 novaPDF SDK 8 catch JIException except System out println SetActiveProfile2 except printsStackTrace PRINT SOMETHING WITH NEW PROFILE PrinterJob job PrinterJob getPrinterJob PrintService services PrinterJob lookupPrintServices Boolean flag Boolean FALSE for int i 0 i lt services length i if services i getName equalsIgnoreCase PRINTER_NAME flag Boolean TRUE try job setPrintService services i job setPrintable this job print catch Throwable throwable System out printin Printing Exception throwable printStackTrace break if flag Boolean FALSE System out printin Printer not found else System out println PDF Printed RESTORE PREVIOU
167. lue i Parameters p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 154 SetOptionLong The SetOptionLong method sets a printing option of long int type HRESULT SetOptionLong in LONG p_nOption in LONG p_lValue Parameters p_nOption in option constant p_lValue in long integer value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaPDF SDK 8 User
168. mtWarning mbOK 0 novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 153 restore original default printer m_novaOptions UnRegisterEventWindow m_novaOptions RestoreDefaultPrinter m_bPrintJobPending FALSE end else begin inherited WndProc Message 2 5 4 2 Hello World Delphi Hello World Delphi sample is a simple Windows console application that prints one page with the Hello World from Delphi text to the novaPDF SDK 8 It demonstrates the basic use of the INovaPDFOptions interface The printing job is made with calls to the global Printer object defined by Delphi Text is printed using Canvas TextOut method It generates a Hello World pdf file in the working folder Notice If you print an existing document using ShellExecute function or you want to handle printing events you should check the VCL Converter sample instead Source code program HelloWorld SAPPTYPE CONSOL E uses ActiveX Printers Windows novaOptions in include novaOptions pas novapiLIB80_TLB in include novapiLIB80_TLB pas Nova in Nova pas const name of novaPDF Printer PRINTER_NAME novaPDF SDK 8 Se text to be written in the PDF file DF_TEXT Hello world from Delphi WU k PDF file name DF_FILE NAME HelloWorld_Delphi U Print profile name ROFILE_NAME HelloWorld Delphi Prof
169. n a database on the server The profiles are available for all printers COMPRESSION SETTINGS Constant name Possible values Default value NOVAPDF_COMPRESS_ F NOVAPDF_COMPRESS_TEXT_GRAPHICS novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 31 EL NOVAPDF_COMPRESS_HIGH_COLOR_TYPE O zip compression 1 JPEG compression povnor cowness romeo oe ens fo 77 poros comes sexo vee se long _ o apeanpresion 0 poros coses vomemorrzs o1 long Joss compresion 0 _ GRAPHICS SETTINGS ETE NOVAPDF_GR_DOWNSMPL_ENABLE GR_DOWNSMPL_ENABLE false NOVAPDF_DOWNSAMPLE_RES_HIGH_COLOR EANTA 72 2400 gt NOVAPDF_DOWNSAMPLE_TYPE_HIGH_COLOR long O BOX Filter 1 BILINEAR Filter 2 BSPLINE Filter 3 BICUBIC Filter 4 CATMULLROM Filter 5 LANCZOS3 Filter NOVAPDF_DOWNSAMPLE_RES INDEXED CANTE 72 2400 NOVAPDF_DOWNSAMPLE_TYPE_INDEXED long O BOX Filter 1 BILINEAR Filter 2 BSPLINE Filter 3 BICUBIC Filter 4 CATMULLROM Filter 5 LANCZOS3 Filter novaPDF SDK 8 User Manual Copyright 2015 Softland 32 novaPDF SDK 8 NOVAPDF_DOWNSAMPLE_RES_MONOCHROM e 72 2400 INC NOVAPDF_DOWNSAMPLE_TYPE_MONOCHROM long O BOX Filter 1 BILINEAR Filter 2 BSPLINE Filter 3 BICUBIC Filter 4 CATMULLROM Filter 5 LANCZOS3 Filter NOVAPDF_IMAGE_CONVERT_TYPE_HIGH_CO long 0 Grayscale LOR 1 Monochrome NOVAPDE_IMAGE
170. n constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 141 2 4 10 4 176 SetWatermarkTextOptionLong The SetWatermarkTextOptionLong method sets a watermark text option of long int type HRESULT SetWatermarkTextOptionLong in string LPWSTR p_pwsWatermarkId in LONG p_nOption in LONG p_lValue gt Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText p_nOption in option constant p_lValue in long integer value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the nex
171. n crm asa 79 Eteilo a AAA AA Ada 79 Getlayout gt rra data 80 Getlayout2 sashvisisivhiveanwiadiiadgn AAA einen AAA Ad 80 GetlayoUICOUNE a oa 81 novaPDF SDK 8 User Manual Copyright O 2015 Softland Contents 5 GetLayoutCount2 so 81 GetLayoutOptionBool 82 GetlayoutOptionBOdlLi vaticin 82 GetlayOutOption FlO At iva AA Ada 83 GetLayoutOption Flo ate ici AAA AAA dls 84 Get ayoutOptiombOng viii 84 GetlAyOUTOPtion LONG essai heed ce A ida 85 Get AayOULOPtioNStrinG micorriariria eouleveentenscta eE evo ra a deb ARA AAA 86 GetLayoutOptionString2 sm 86 GetNextProfile iii Aa 87 GetNextProtile2 coi A A da 87 GetOPtionBool msi A deea eN 88 GetOption Encrypted String iii A Mn aed eee 88 GetOptionEncryptedString2 sm 89 GOOPtOALONO acia a Ra 89 GetOptionString minioonorarr A A A 90 GetOptionStting2 3d A AAA Malan Ea 91 GetOverlay gt passere a e Aa 91 GetOverlay2 vain a E A A ti 92 GetPDFFIN AMO siii a bande tra den aa ato 92 GetPDFEFIISNaME2 crara e a A A ATA DAs Gea eee 93 G tSignat re id a eii 93 GetSIQNAtUre2 anna AAA e ee aare a a ENEE TEN E ENa 94 GotWatermarkIMagO cocos tee 94 GetW termarklmage2 titi it dine Mii A even da 95 GetWatermarklmageGount uti Aisa 95 GetWatermarklmageOptionBool wee 95 GetWatermarklmageOptionBool oo eeeesceceeseeeeeseeeeseeeseeseeeseceecseeeaesseeeaeeeaesaeeseesaerseeeaeseaeseeeaeeeeetneseaees 96 GetWatermarklmageOptionEn
172. n folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 139 SetEmailRecipient The SetEmailRecipient method changes options of a recipient HRESULT SetEmailRecipient novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 121 LPWSTR p_pwsNewRecipientld LPWSTR p_wsFrom in string LPWSTR p_wsTo i LPWSTR p_wsCC LPWSTR p_wsBCC i Parameters p_pwsNewRecipientid in recipient id obtained with AddEmailRecipient or GetEmailRecipient p_wsFrom in From address p_wsTo in To address p_wsCC in CC address p_wsBCC in BCC address Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_INVALID_RECIPIENT wrong recipeint id 2 4 10 4 140 SetEmailRecipient2 The SetEmailRecipient2 method changes options of a recipient HRE ULT SetEmailRecipient2 in string BSTR p_pwsNewRecipientId j j BSTR p_wsFrom BSTR p_wsTo BSTR p_wsCC BSTR p_wsBCC Parameters p_pwsNewRecipientld in recipient id obtained with AddEmailRecipient2 or GetEmailRecipient2 p_wsFrom in From address p_wsTo in To address p_wsCC in CC add
173. n list You can save the list of the files that show up by clicking on Save list A text file will be created and you can later use Open list to re load that list of files using this option will clear the current list of files Create PDF Once you have added all the files that should be converted in bulk just click on Create PDF A new window will open and it will allow you to choose whether you want to convert those as individual PDF files or merge them in a single one 1 1 1 1 1 About The About page contains information about the version and edition you have installed plus the option to Activate Reactivate Deactivate the application Change product key or Register online it novaPDF SDK 8 User Manual Copyright 2015 Softland 10 novaPDF SDK 8 novaPDF SDK is available as a trial version It is fully functional for 30 days During the trial version a notice is printed on each PDF page mentioning the novaPDF SDK The notice will be removed from further created PDF files when you buy and activate novaPDF SDK If you ve already purchased it you can visit the Activate section to activate the program The about window will show the following information Version and build number of the profile manager and printer manager in parenthesis you ll also the the version of the printer driver used Windows version and edition for support inquiry purposes Edition installed and activated for trial extra trial licenses the num
174. nager exe tool from the printer driver installation folder C Program Files Softland novaPDF 8 Driver Call it for each printer with next command line parameters PrinterManager exe silent oem lt your OEM ID gt sp 8501 add printer lt printer name gt printerport lt port name gt It is better to add each printer on a different port so they can work independently When multiple printers work on the same port the documents are processed sequentially To assign a default active profile for a printer call the Printer Manager tool with next command line parameters PrinterManager exe silent oem lt your OEM ID gt port 8501 printer lt printer name gt set profile lt profile id gt Or you could perform both steps in one call add a printer and set the active profile PrinterManager exe silent oem lt your OEM ID gt port 8501 add printer lt printer name gt printerport lt port name gt profile lt profile id gt You may see the profile id when you start the Profile Manager tool in administrative mode from the Printer Manager tool Integration How to integrate You have to follow these steps for integrating novaPDF 8 SDK Developer in your application 1 Install novaPDF 8 SDK Developer When installing novaPDF 8 SDK Developer a novaPDF SDK 8 printer is added in the Printers list in Control Panel novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 17 2 3 2 2 Take a sample
175. names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaPDF SDK 8 User Manual Copyright O 2015 Softland 76 novaPDF SDK 8 novaOptions h novaOptions pas Globals bas 2 4 10 4 53 GetEmailRecipient The GetEmailRecipient method retrieves the recipient for the specified email Recipient p_nindex LPWSTR p_pwsEmailld LPWSTR p _pwsRecipientld LPWSTR p_pwsFrom LPWSTR p_pwsTo LPWSTR p_pwsCC LPWSTR p_pwsBCC HRESULT GetEmail in LONG in SECTAS eut string lout string lout string lout string l out string i Parameters p_nIndex in recipient index p_pwsEmaillid email id p_pwsRecipientld in out recipient id p_pwsFrom out From address p_pwsTo out To address p_pwsCcC out CC address p_pwsBCC out BCC address Return values S_OK on success or NV_NOT_INITIALIZI NV_UNKNOWN_PROF IL NV_INVALID_EMAIL NV_INVALID_R amp 2 4 10 4 54 GetEmailRecipient2 COM error code ED Initialize was not called no profile loaded email not found ECIPIENT no recipient for the given index The GetEmailRecipient2 method retrieves the recipient for the specified email Recipient2 HRESULT GetEmail lin LONG in string BSTR out string BSTR out string BSTR out string BSTR
176. ncrypted string type HRESULT GetWatermarkImageOptionEncryptedString in string LPWSTR p_pwsWatermarkId in LONG p_nOption out LPWSTR p_pwsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 93 GetWatermarklmageOptionEncryptedString2 The GetWatermarklImageOptionEncryptedString2 method retrieves a watermark image option of encrypted string type HRESULT GetWatermarkImageOptionEncryptedString2 in string BSTR p_pwsWatermarkld in LONG p_nOption out BSTR p_pwsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_pwsValue out pointer to a pointer to a nu
177. neees 9 AQUA aa RA AI 9 novaPDF SDK 12 MAA O A 12 OVEIVIEW oia IIA E sects tucctecebenns E E T E UCA 12 installation cocinas AAA AAA DRAE AAA EEE AREAS A 12 SYSTEM A O 13 Co er i 13 A A AAN 15 Multiple printers si 16 META A aa 16 Howto INTE Gate ciseictecstecsetacisesescusecscnaciadciestecbeadadsadersceesacrersuersnuvadccescseuednarenceduscsventosdsadccbesesneredusesecetncneavoereaees 16 How to make the release build cccccseeceseeesseessseeeseeseneseseeesneeeseeeeseeeesnessenesesneeseneeseeesseeeseneasaeeesneeeeneessaaeees 17 Customize your Setup seeceeeeeeeeeers ws 18 Build an installation package bundle cscssseeeesteesseesseeeesneeseneessneessneeseeesseeesneesenesseneessneeseessseeeseeessneseenens 20 Installation package bundle oonnnnncncnnnoncccnnnncnnonanicnin arar 21 Changes In novaPDF SDK Version 8 onmniccocninnnnnnnnnnnnrer enneunen nnne nn ennenen 25 ls AAA de sdcceesdaczeadedecddcassceccecsaaegstagecccaducndezsedeeeccies 25 Howto register COM iio e iia 25 How touse the COM A A O 26 How to set printer options 26 Private and public profiles o nnnnicnnnnnnnnnnninnnanncnn cnn 27 How to register for MESSAGES coonnonnocnnnoncnnancnnancnnnc carac ronca rca 27 How t use NN NO 28 Multithreading applications onnnccnnncnninnnnoninnoninicnnn arrancan 28 Use temporary printers 29 Working With La youl jicciiccaccreiedicesecccndsnasecticosssesastecsereseubdscba
178. ng novaPDF SDK 8 Const PROFILE_NAME As String Test VB Const PROFILE_IS_PUBLIC As Long 0 The main entry point for the application Public Sub Main On Error GoTo ErrorHandler create the NovaPdfOptions object Dim pNova As New NovaPdfOptions80 Dim sOldActiveProfileID As String Dim sNewProfileID As String initialize the NovaPdfOptions object to use with a printer licensed for SDK pNova Initialize2 PRINTER_NAME pNova GetActiveProfile2 sOldActiveProfilelD On Error Resume Next make new profile pNova AddProfile2 PROFILE_NAME PROFILE_IS_PUBLIC sNewProfileID pNova LoadProfile2 sNewProfilelD and set some options uncomment the function calls for the options you wish to set and change the options in the Nova vb unit 1 AddProfileOptions pNova AddDocumentInformation pNova AddViewerOptions pNova AddLinksOptions pNova AddAdvancedOptions pNova novaPDF SDK 8 User Manual Copyright 2015 Softland 194 novaPDF SDK 8 AddGraphicsOptions pNova AddEmbedFontsOptions pNova AddBookmarksDefinitions pNova AddSecurity pNova AddSaveOptions pNova AddAfterSaveActions pNova AddEmail Options pNova AddWatermarkImage pNova AddWatermarkText pNova AddPageContentOptions pNova AddOverl ayOptions pNova AddSignatureOptions pNova save pr pNova Sa ofile changes veProfile set as ac
179. ng ShellExecute or you want to handle printing events check the VB Converter sample 13 If you have a VBNet application that prints using the package System Drawing Printing check the Hello World VBNet sample 14 If you have a VBNet application that prints using the package System Drawing Printing check the VBNet Converter sample 15 If you have an Access database and you want to generate PDF files check the PDF Reports Access sample 16 If you want to convert MS Word documents or if you use other OLE controls to print your documents choose one of the next samples Word OLE CSharp Word OLE Delphi Word OLE VB Word OLE VBNet or Word OLE Java 17 If you wish to work with temporary printers check the Temporary printer sample 18 If you wish to use novaPDF SDK in a multithreading application check the Multiple printers sample All Hello World samples include a separate tool file with sample functions for setting all kind of options save options watermarks bookmarks overlay graphics document info security email links fonts Access PDF Reports PDF Reports Sample is an Access database with one table and one form On the form you can set several options for the novaPDF SDK 8 and then press a button to generate a PDF file A report is made on the table and it is sent to novaPDF SDK 8 It demonstrates the basic use of the INovaPDFOptions interface The printing job is made using the object Application Printer B
180. ng the print job NOVAPDF2_STARTPAGE sent when the printer driver jobID starts processing a new page NOVAPDF2_ENDPAGE sent when the printer driver jobID finished processing a page NOVAPDF2_FILESENT sent when the printer driver jobID finished generating the PDF file and sent it to the computer that started the print job NOVAPDF2_FILESAVED sent when the PDF file is received jobID and saved by the computer that started the print job NOVAPDF2_PRINTERROR sent when an error occurred error no jobID during the print job NOVAPDF2_EMAILSENT sent when the email option is jobID enabled and a email with the generated PDF file was sent NOVAPDF2_EMAILERROR sent when the email option is jobID enabled and there was an error sending the email with the generated PDF file The following error numbers are sent by the printer driver in the NOVAPDF2_PRINTERROR event 1 Error saving temporary PDF file on the printer server 2 Error reading license information on the printer server 3 Error generating the PDF file 4 Print job was canceled 5 Licensing error too many copies running with the same license 6 Client computer is not licensed 7 Error sending email 9 Could not read printer info 10 Could not read profile novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 45 11 append pdf file no or wrong password 12 insert before pdf file no or wrong password 13 append pdf file could not read
181. novaPDF SDK Paperless office solutions novaPDF SDK User Manual Copyright 2015 Softland novaPDF SDK User Manual for novaPDF SDK version 8 by Softland This documentation contains proprietary information of Softland All rights reserved No part of this documentation shall be reproduced stored in a retrieval system or transmitted by any means electronic mechanical photocopying recoding or otherwise without permission from Softland No patent liability is assumed with respect to the use of the information contained herein The information in this document is subject to change without notice Although every precaution has been taken in the preparation of this book Softland assumes no responsibility for errors and omissions Nor is any liability assumed for damages resulting from the information contained herein Windows is a registered trademark of the Microsoft Corporation All other products or company names in this document are used for identification purposes only and may be trademarks of their respective owners Contents 3 Table of Contents Part Part Il novaPDF SDK 9 Using novaPDF SDK iii ii 9 Create PDF from Office applications cssssscseeecseresseceeesseeseesseesenseeeeeneseeesnesseeneeseeeseneseeeeneseeeneesenesenseeesenenaees 9 Create merge multiple COCUMENTS cceseeeeeeceeeeteceeceeseeeeeeseeeaecseeeaeesaecaeeeaeceaeeseeeaessaeeaeeeaessaesseeeaeseeeaeseaee
182. novaPDF SDK 123 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong font name 2 4 10 4 143 SetLayoutOptionBool The SetLayoutOptionBool method sets an option of boolean type for a layout object HRESULT SetLayoutOptionBool in string LPWSTR p_pwsObjectld in string LPWSTR p_pwsLayoutld in LONG p_nOption in BOOL p_bValue i Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout p_wsOption in option constant p_bValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 144 SetLayoutOptionBool2 The SetLayoutOptionBool2 method sets an option of boolean type for a layout object HRESULT SetL
183. novaPDF SDK 8 message to be sure that the print job was started In this message handler restore the default printer with the RestoreDefaultPrinter method This way you made sure that the default printer was restored and your document is printed to novaPDF SDK 8 Source code snippets novaPDF SDK 8 User Manual Copyright 2015 Softland 150 novaPDF SDK 8 1 DECLARE INovaPdfOptions variable declare an INovaPdfOptions member variable PRIVATE m_novaOptions INovaPdfOptions 2 Register novaPDF SDK 8 messages register event messages WM_NOVAPDF2_FILESAVED RegisterWindowMessage MSG_NOVAPDF2_FILESAVED WM_NOVAPDF2_PRINTERROR RegisterWindowMessage MSG_NOVAPDF2_PRINTERROR handle event messages PUBLIC PROCEDURE WndProc var Message TMessage override PROCEDURE TForml WndProc var Message TMessage BEGIN IF Message Msg WM_NOVAPDF2_FILESAVED then BEGIN END ELSE IF Message Msg WM_NOVAPDF2_PRINTERROR then BEGIN Ss are END ELSE BEGIN inherited WndProc Message END ND E 3 Initialize INovaPdfOptions PROCEDURE TForml FormCreate Sender TObject BEGIN LL initialize COM libraries hr ActiveX Colnitialize nil if FAILED hr then begin MessageDlg Failed to initialize COM 13 SysErrorMessage hr 13 SysErrorMessage GetLastError m
184. nsion xmlns swid http schemas microsoft com wix TagExtension xmlns dotNet http schemas microsoft com wix NetFxExtension gt lt include Variables wxi gt lt Bundle Name var BundleName Version var MajorVersion var MinorVersion var BuildNumber Manufacturer var Manufacturer UpgradeCode var UpgradeCode AboutUrl var AboutUr1 SplashScreenSourceFile var SplashImage Compressed yes IconSourceFile var IconFile gt lt swid Tag Regid regid 2008 09 org wixtoolset gt lt change the UpgradeCode to an unique new GUID for your application gt lt RelatedBundle Id var UpgradeCode Action Upgrade gt lt application license gt lt BootstrapperApplicationRef Id WixStandardBootstrapperApplication RtfLicense n S lt bal WixStandardBootstrapperApplication LicenseFile var MyLicenseFileName SuppressOptionsUI yes gt lt BootstrapperApplicationRef gt lt Check for printer driver msi upgrade code this is a fix to not allow upgrade over versions 905 906 and 907 gt lt util ProductSearch Result version Variable Version80907 UpgradeCode b3e39fcd 55eb 41b6 92eb 4c5a000c7043 gt lt bal Condition Message Cannot run this setup Please uninstall doPDF from the Control Panel and then run the installation again gt lt CDATA Version80907 lt gt 8 0 907 0 AND Version80907 lt gt 8 0 906 0 AND Version80907 lt gt 8 0 905 0 gt lt bal C
185. nt The GetWatermarkTextCount method retrieves the number of image watermarks HRESULT GetWatermarkTextCount out SHORT p_pnCount i Parameters p_pnCount out count of image watermarks Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded 2 4 10 4 111 Initialize The Initialize method initializes the INovaPdfOptions interface HRESULT Initialize in LPCWSTR p_wsPrinterName in LPCWSTR p_wsLicenseKey i Parameters p_wsPrinterName in pointer to a null terminated Unicode string containing the name of the pri p_wsLicenseKey in pointer to a null terminated Unicode string containing the license key Return values S_OK on success or COM error code NV_INVALID_PRINTER_NAME cannot find printer with given printer name novaPDF SDK 8 User Manual Copyright 2015 Softland 108 novaPDF SDK 8 NV_NOT_A NOVAPDF_PRINTI NV_INVALID_LICENSE NV_SERVICE_ERROR ER printer is not a novaPDF SDK 8 cannot read license or not a SDK license cannot connect to novaPDF Server servic Remarks This method must be called prior to calling any method from the INovaPdfOptions interface 2 4 10 4 112 Initialize2 The Initialize2 method initializes the INovaPdfOptions interface HRESULT Initialize2 in BSTR p_wsPrinterName in BSTR p_wsLicenseKey i
186. ntecsanevecoudnadsevsuidonsenascessutedusstedcadsesnedeeseseasdontwedearnacneess 30 FREPEP ON 30 Profile Option StriNQS cececeeeceeseeeeeeeeeeeceeeeseeeaeeeecaeeeaesseeeaeeeaesaeeeaeesaeeseseaeeeesaeesaeseeeseeeaeeeeeseeeseseeeseeeeeeneeeaes 30 Windows MESAS A A ia 44 What is Nova PROPINA iio 45 INOVAP AO PONS cia aii 49 AddBookmarkDefinition cecceeceeceeeeeeeeeeeeeeeeeeeneeeaeeeeeeaeeeaeceeeaeseaeeeesaeseaeceesaeseeeseesaeeeeeseeeeaeseaeteeseaeeeaeeaes 49 AddBookmarkDefinition2 we 50 O O SO EE T 52 AddEmail2 ia Das 52 AddEmailRecipient oooomoccnoneosonnonccnonannonnennononennnnnonconccnonennonconnanenoncn nao nconono ron conan nono n nose r no nca sonora pre raanconos 52 AACE MAailRECIPION iii ai 53 AddNovaPrinter 54 AddNovaPrinter2 54 AddProfile 55 novaPDF SDK 8 User Manual Copyright 2015 Softland 4 novaPDF SDK 8 AddProfile2 we 56 AddWatermarklmage 56 Add WatermarkIMage c cio a edad 57 Ad Watermark Te xs AA AAA acto 57 Ad Watermark Tex AAA AAA AA AE 58 ClearFontOptions ricino A 58 CopyProfile ira ii Ata 58 COpyProfile2 gt iris AAA Ai 59 DeleteBookmarkDefinition nt 59 DelsteEmall ici isa 60 Delete Em il2 gt iia AA A a idad NE Aids 60 DeleteEmailRecipient 2 2 ce 202 4 sac ri A A Aaa 60 De leteEmailRecipient2 anian ir a A A ae ie eee 61 DeleteLayout 61 DeleteLayout2 62 De leteNovaPrintetiivecreentatacauven ia AAA AAA AA AAA 62 Del
187. o PROFILE_NAME lt gt 0 Then pNova SetActiveProfile activeProfile pNova DeleteProfile newProfilelD End If restore default printer pNova RestoreDefaultPrinter novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 205 2 5 10 2 5 10 1 End Sub End Module Install Installation package bundle This is a sample on how to compress the msi installations packages in a bundle and generate an setup executable to install novaPDF 8 SDK Developer If you haven t already done so you will need to install the Wix Toolset to build this project The project contains two files 1 Variables wxi contains variables for application name company name version it important to change the UpgradeCode to an unique new GUID for your application 2 Bundle wxs contains the msi files that need to be included and the execution order Net Framework 4 is required by novaPDF 8 SDK Developer and is set as prerequisite S Variables wxi lt xml version 1 0 encoding utf 8 gt lt Include gt lt define BundleName My SDK Application Bundle gt lt change the UpgradeCode to an unique new GUID for your application gt lt define UpgradeCode EE097F3F2 C42F 4EF5 A68A 2319590A5ECF gt lt define AboutUrl http www novapdf com gt lt define SplashImage gt lt define IconFile gt gt lt define MyLicenseFileName C ProgramData Softland novaPDF 8 nPdfSdk8 Softl
188. oadProfile2 new Object new except ln LoadProfile2 except printsStackTrace CHANGE SOME OPTIONS try and set some pNovaDispatch cal DF_DOCINFO_SUBJECT new ovaDispatc new Dispatc T_ACTION Dispatch cal DF_INFO_VIEW ENABL 1 pNova Neca NOVA h cal DF_SAVE_ E NOVA FIL n cad F DF_SAVE_ NOVA FI F NOVA a y Dispatc JIstr JIStri FI options llMethod Seto ing NOVAPDF_INFO_SUBJ llMethod SetOptionStri ng novaPDFJavaDocume liMethod SetOptionLong E_CONFLICT_STRATEGY_A llMethod SetOptionBool ptionString2 new Object ECT ng2 new Object nt new Object UTONUMBER_NEW new Object da Method SetOptionLong new Object Ey ES NOVAPDF_SAV _PROMPT_TYPE catch JIException PROMPT_ SAVE_SIMPLE except System out print In Set options except printStackTrace novaPDF SDK 8 User Manual Copyright 2015 Softland 190 novaPDF SDK 8 SAVE PROFILE try pNovaDispatch callMethod SaveProfile2 catch JIException except System out printin SaveProfile2 except printStackTrace SET IT AS ACTIVE PROFILE try set the copy profile as active profile pNovaDispatch callMethod SetActiveProfile2 new Object new JIString activeP
189. ode NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 138 SetEmailOptionString2 The SetEmailOptionString2 method sets an option of string type for an email HRESULT SetEmailOptionString2 in string BSTR p_pwsEmailld in LONG p_nOption in BSTR p_wsValue i Parameters p_pwsEmaillid in email id obtained with GetEmail2 or AddEmail2 p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installatio
190. ode NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMATL email not found 2 4 10 4 21 DeleteEmailRecipient The DeleteEmailRecipient method deletes an existing recipient from the specified email HRESULT DeleteEmailRecipient in string LPWSTR p_wsEmailld lin string LPWSTR p_wsRecipientld novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 61 Parameters p_wsEmailld in email id obtained with GetEmail or AddEmail p_wsRecipientld in email id obtained with GetEmailRecipient or AddEmailRecipient Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL email not found NV_INVALID_RECIPIENT recipient not found 2 4 10 4 22 DeleteEmailRecipient2 The DeleteEmailRecipient2 method deletes an existing recipient from the specified email HRESULT DeleteEmailRecipient2 in string BSTR p_wsEmailld in string BSTR p_wsRecipientld i Parameters p_wsEmaillId in email id obtained with GetEmail2 or AddEmail p_wsRecipientld in email id obtained with GetEmailRecipient2 or AddEmailRecipient2 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded
191. of long type HRESULT GetWatermarkTextOptionLong2 in string BSTR p_pwsWatermarkld ia LONG p_nOption out LONG p_plValue Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 105 p_nOption in option constant p_plValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 106 GetWatermarkTextOptionString The GetWatermarkTextOptionString method retrieves a watermark text option of string type HRESULT GetWatermarkTextOptionString in string LPWSTR p_pwsWatermarkId in LONG p_nOption out LPWSTR p_pwsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated
192. ofile retrieving the id of the next profile in the enumeration HRESULT GetNextProfile out LPWSTR p_pwsProfileld i Parameters p_pwsProfileld out pointer to a pointer to a null terminated Unicode string containing the r Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_ENUM_NOT_INIT enumerate was not started GetFirstProfile was not called before NV_NO_MORE_PROFILES there are no more profiles to enumerat Remarks GetNextProfile is used with GetFirstProfile to retrieve profile names Sample usage hr GetFirstProfile amp pName while SUCCEEDED hr amp amp hr NV_NO_MORE_PROFILES do something with pName Lf CoTaskMemF ree pName get next profile if it exists hr GetNextProfile amp pName 2 4 10 4 74 GetNextProfile2 The GetNextProfile2 continues an enumeration of profiles started with GetFirstProfile retrieving the id of the next profile in the enumeration HRESULT GetNextProfile2 out BSTR p_pwsProfileld i novaPDF SDK 8 User Manual Copyright 2015 Softland 88 novaPDF SDK 8 Parameters p_pwsProfileld out pointer to a pointer to a null terminated Unicode string containing the r Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_ENUM_NOT_INIT enumerate was not started GetFirstProfile was no
193. ofile in the enumeration HRESULT GetFirstProfile2 out BSTR p_pwsProfileld Parameters p_pwsProfileld out pointer to a pointer to a null terminated Unicode string containing the i Return values novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 79 S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICI NV_PROFILI E Ea 2 4 10 4 59 GetFontOption _ERROR cannot connect to novaPDF Server servic _ERROR cannot load profiles The GetFontOption method retrieves embed options for a given font HRESULT GetFontOption in string LPCWSTR p_wsFontName out BOOL p_pbAlwaysEmbed out BOOL p_pbNeverEmbed y Parameters p_wsFontName in font name p_pbAlwaysEmbed out pointer to a boolean that will p_pbNeverEmbed out pointer to a boolean that will Return values S_OK on success or COM error code contain the always embed flag for the font contain the never embed flag for the font NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong font name 2 4 10 4 60 GetFontOption2 The GetFontOption2 method retrieves embed options for a given font HRESULT GetFontOption2 in string BSTR p_wsFontName out BOOL p_pbAlwaysEmbed out BOOL p_pbNeverEmbed y Parameters p_w
194. ofile urinarias 115 SEDO Ri A A T R A Dai A N ESN 116 SetEmailOptionBool 116 SetEmailOptionBool2 116 SetEmailOptionEncryptedString 020 020 acans denen cede io 117 SetEmailOptionEncryptedString2 eseeccesccsscceceeeeeeeeeeeeseeeaeeseeeseeaeeseeeaeseaeeseeeaeseesseseaeseaseneseaeseeeeaeeaas 118 SetEMAilOpPtionliOng veers Hee verve ieee ede its 118 SetEMalOPtONLONY2 ica wii eevee nh nels een Ss 119 SStEMailOptionS tring ee c2ves sence ey evened ceeded evden eect Aarena 119 SetEmailOptonString2 iii AAA aise seed day Tae do oa A eee 120 SetEmallRecipientiiionini ata ciate deel A and ied eee 120 SelEmailRecipiont2cc savccataavesa nea Navneet ails lien asia A era eed 121 SEtFONtOPLION noria A Att 122 SeELFONtOPtiON2 a AAA A AO AA A nea 122 SetLayoutOptionBO0l cco dicos Ie 123 SetLayoutOptionBool2 123 SetkayoutOption Fle ative ca ove cya cac aces a a Ads 124 setLayoutOptionFloatas isAldeiied besa an em niece oia 125 SetLayotOptiONLONO sii e ale edhe aire eed dine ele 125 SetLayontOptiONLONDL iia it oh Grint N 126 SetLayoutOptionString 126 SetLayoutOptionString2 127 SEtOPtiON BOO muii tt teeters 128 setOptionEncryptedString i a Ae a 128 SetOptionEncryptedString2 s ca cece ave deeedt dd 129 DELOPtIONLONG cai A aes een iden veces iste eel Fa Dae ns a een ee 129 SetOption String ias tte deste dis eames i need renee ake 130 SetOption StriNg2 it iaa heed Ale een eee ates ieee te A ete kien AS 130 SetPrinterActivePublic
195. older of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 49 GetEmailOptionLong The GetEmailOptionLong method retrieves an option of long type for an email HRESULT GetEmailOptionLong in string LPWSTR p_pwsEmailld in LONG p_nOption out LONG p_lValue Parameters p_pwsEmailld in email id obtained with GetEmail or AddEmail p_nOption novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 8 in option constant p_lValue out pointer to a pointer to long that will contain the value of the retrievec Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 50 GetEmailOptionLong2 The GetEmailOptionLong2 method retrieves an option of long type for an email HRESULT GetEmailOptionLong2 in string BSTR p
196. ondition gt lt Chain gt novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 207 lt prereqs gt lt PackageGroupRef Id NetFx4 Web gt lt COM gt lt MsiPackage Id COMx86 var MajorVersion var MinorVersion var BuildNumber Cache yes Cacheld COMIdx86 var MajorVersion var MinorVersion var BuildNumber DisplayInternalUI no EnableFeatureSelection no ForcePerMachine yes Compressed yes SourceFile var COMPathx86 Visible yes Vital yes gt lt MsiPackage gt lt MsiPackage Id COMx64 var MajorVersion var MinorVersion var BuildNumber Cache yes CacheId COMIdx64 var MajorVersion var MinorVersion var BuildNumber DisplayInternalUI no EnableFeatureSelection no ForcePerMachine yes Compressed yes SourceFile var COMPathx64 Visible yes Vital yes InstallCondition VersionNT64 gt lt MsiPackage gt lt driver gt lt MsiPackage Id DriverPackagex86 var MajorVersion var MinorVersion var BuildNumber Cache yes Cacheld DriverPackageldx86 var MajorVersion var MinorVersion f var BuildNumber DisplayInternalUI no EnableFeatureSelection yes ForcePerMachine yes Compressed yes SourceFile var DriverKit86 Visible yes Vital yes InstallCondition NOT VersionNT64 gt lt MsiPackage gt lt MsiPackage Id DriverPackagex64 var MajorVersion var MinorVersion var Build
197. or a print job to be finished you can register some Windows events and wait for them to be signaled by novaPDF SDK 8 Before starting the print job you have to inform novaPDF SDK 8 that you want to be wait for an event Call RegisterNovaEvent LPCWSTR p_wsEventName with one one of the next strings NOVAPDF_EVENT_START_DOC NOVAPDF_EVENT_END_DOC NOVAPDF_EVENT_FILE_SAVED After you send the job to the printer call WaitForNovaEvent ULONG p_nMiliseconds BOOL p_bTimeout This function will return when the event was signaled or when the time was elapsed If the time was elapsed p_bTimeout is TRUE and if the event was signaled p_bTimeout is FALSE If you just want to be sure that the print job was started the profile was read and you want to proceed modifying the profile for the next job you should wait for the NOVAPDF_EVENT_START_DOC event If you are interested where the PDF file is ready so you can do further actions with it you should wait for the NOVAPDF_EVENT_FILE_SAVED event Multithreading applications If you wish to use novaPDF in multi threading or multi process applications there are some restrictions novaPDF COM is not thread safe you should implement your own thread synchronization when using the COM When you use third party applications to print they have to be licensed separately by using the LicenseApplication call Because this call does not license this application for any print calls but just for the next pr
198. ot open document in PDF viewer Nova SetOptionBool NOVAPDF_ACTION_DEFAULT_VIEWER 1 FI save profile changes Nova SaveProfile get current default profile id Nova GetActiveProfile2 stroldActiveProfilelD set as active profile for printer Nova SetActiveProfile2 strNewProfilelD Print Word Document rs TUTO WSs MO SUENO So SO K K pNova InitializeOLEUsage Word Application ord CreateOleObject Word Application ord DisplayAlerts 0 pNova LicenseOLEServer NewDoc Word Documents Open C temp Test doc False True NewDoc PrintOut False NewDoc Close False ord Quit False except on E Exception do ShowMessage E Message end restore default profile pNova SetActiveProfile2 strOldActiveProfilelD pNova DeleteProfile2 strNewProfilelD resore default printer pNova RestoreDefaultPrinter release NovaPdfOptions pNova _Release ActiveX CoUninitialize novaPDF SDK 8 User Manual Copyright 2015 Softland 158 novaPDF SDK 8 end 25 5 CH 2 5 5 1 Hello World CSharp Hello World CSharp sample is a simple Windows console application that prints one page with the novaPDF says Hello World from CH text to the novaPDF SDK 8 It demonstrates the basic use of the INovaPDFOptions interface The printing job is made using the package System Drawing Printing Basically the sample determines the active
199. ource code Vee initialize COM hr CoInitialize NULL novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 169 if FAILED hr MessageBoxW NULL L Failed to initialize COM L novaPDF MB _OK return hr create one NovaPdfOptions instance INovaPdfOptions pNova 0 hr CoCreatelnstance __uuidof NovaPdfOptions80 NULL CLSCTX_INPROC_SERVER if FAILED hr MessageBoxW NULL L Failed to create novaPDF COM object L novaPDF MB OK return hr DWORD dwSize 256 WCHAR strWorkStation 256 find out computer name GetComputerNameW strWorkStation amp dwSize PrinterNameDlg dlg construct printer name as computer name printer name dlg m_strPrinterName Format L s s strWorkStation PRINTER_NAME get printer name from user if IDCANCEL dlg DoModal pNova gt Release CoUninitialize return hr CString strPrinterName dlg m_strPrinterName initialize the NovaPdfOptions object to use with a printer licensed for SDK hr pNova gt Initialize LPCWSTR strPrinterName L Plea 2 5 6 3 MFC Converter The MFC Converter sample demonstrates how to convert an existing file by printing it to novaPDF SDK 8 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
200. ourceFile var OemKit64 Visible no Vital yes InstallCondition VersionNT64 gt lt MsiPackage gt lt Chain gt lt Bundle gt lt Fragment gt novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 25 2 3 6 2 4 2 4 1 lt UI gt lt UI Id MyWixUI_Mondo gt lt UIRef Id WixUI_Mondo gt lt UIRef Id WixUI_ErrorProgressText gt lt UI gt lt Fragment gt lt Wix gt Changes In novaPDF SDK version 8 Installer In version 8 of novaPDF we changed the installation mode Instead of the silent installer there are now used some msi files to install each component the printer driver the COM and the licensed printer You have to distribute and install these msi files with your application Profiles The profiles are kept in a database on server the computer where novaPDF is installed and there is installed a service that assures communication between the printer driver and the profiles database COM There are changes in the COM methods the constants for profile options are integer values instead of strings the profiles usage is the same as in the previous versions but there are new methods specific to email fonts overlay signature watermarks and layout options Check the Hello World samples to see how each option can be set novaPDF COM How to register COM novaPDF SDK includes a COM interface INovaPdfOptions The COM binary file is located in the Lib sub fol
201. out LONG p_plValue i Parameters p_pwsWatermarkIid in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_plValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 98 GetWatermarklmageOptionString The GetWatermarkimageOptionString method retrieves a watermark image option of string type HRESULT GetWatermarkImageOptionString in string LPWSTR p_pwsWatermarkId in LONG p_nOption out LPWSTR p_pwsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 101 NV_NOT_INITIALIZED Initiali
202. ovaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 73 NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 48 GetEmailOptionEncryptedString2 The GetEmailOptionEncryptedString2 method retrieves an option of encrypted string type for an email HRESULT GetEmailOptionEncryptedString2 in string BSTR p_pwsEmailld in LONG p_nOption out BSTR p_pwsValue i Parameters p_pwsEmaillid in email id obtained with GetEmail2 or AddEmail2 p_nOption in option constant p_pwsValue out pointer to a pointer to a BSTR string that will contain the value of the Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include f
203. ovaPDF8PrinterDriver x86 msi installs printer driver copies the files needed for driver service and applications novaPDF8COM x64 msi novaPDF8COM x86 msi installs NovaPdfOptions80 COM novaPDF8SDK x64 msi novaPDF8SDK x86 msi installs configuration files profiles database license and adds a printer SDK Lib novapi80 dll INovaPdfOptions80 binary file There are two versions of the dll one for i386 systems and one for x64 systems SDK Tools novaPDF Co Branding tool customization tool for installers see Customize your setup In C Users Public Documents novaPDF 8 SDK the installer will create the following folder structure Include definition files for INovaPdfOptions interface definitions for Windows messages and Profile option strings Samples Contains several samples of how to use INovaPdfOptions Access PDF Reports make a report on an Access database and convert it to PDF ASP NET Hello World an ASP NET application that prints using the Printer object C Hello World a console application that prints one page to the novaPDF SDK 8 C Hello World network the same as Hello World sample but it can be run from any computer in the network thought the novaPDF SDK 8 is installed on one single computer C MFC Scribble the standard MFC Scribble sample extended with generate PDF files C MFC Converter a MFC dialogs sample that converts an existing file to PDF using different prof
204. p 5 getObjectAsComObject System out println Printing document callMethod PrintOut new Object 1 System out println Closing document document callMethod Close private void sleep int sec throws InterruptedException System out println Sleeping sec second s Thread sleep int sec 1000 throws JIException a public void quitAndDestroy throws JIException System out printin Quit novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 193 dispatch callMethod Ouit new Object new JIVariant 1 true JIVariant OPTIONAL_PARAM JIVariant OPTIONAL_PARAM JISession destroySession dispatch getAssociatedSession 2 5 8 VB 2 5 8 1 Hello World VB Hello World VB sample is a simple Windows console application that prints one page with the novaPDF says Hello World from VB text to the novaPDF SDK 8 It demonstrates the basic use of the INovaPDFOptions interface The printing job is made with calls to the global Printer object defined by VB It generates a HelloWorld pdf file and opens it in the default PDF viewer Notice If you print an existing document using ShellExecute function or you want to handle printing events you should check the VB Converter sample instead Source code the novapiLib and novapiLibDemo packages must be added as a COM reference Const PRINTER_NAME As Stri
205. ptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 72 GetLayoutOptionString2 The GetLayoutOptionString2 method retrieves an option of string type for a layout object HRE SULT GetLayoutOptionString2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption out BSTR p_pwsValue i Parameters p_pwsObjectld in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout2 p_nOption in option constant p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contai novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 87 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 73 GetNextProfile The GetNextProfile continues an enumeration of profiles started with GetFirstPr
206. public class Main public static String PROFILE_NAME Test Java and Word OLE public static int PROFILE_IS_PUBLIC 0 public static long NOVAPDF_DOCINFO_SUBJECT 68 public static String NOVAPDF_INFO_SUBJECT Java OLE Word Document Subject public static long NOVAPDF_SAVE_FILE_NAME 104 public static long NOVAPDF_SAVE_FILEEXIST_ACTION 108 public static long FILE_CONFLICT_STRATEGY_AUTONUMBER_NEW 1 public static long NOVAPDF_INFO_VIEWER_ENABLE 8 public static long NOVAPDF_SAVE_PROMPT_TYPE 101 public static long PROMPT_SAVE_SIMPLE 2 param args the command line arguments 7 public static void main String args if args length lt 4 System out println Please provide address domain username password return File docFile new File c temp test doc if docFile exists System out printin c temp test doc file does not exist return disable J Interop Log try JISystem getLogger setLevel Level INFO JISystem setInBuiltLogHandler false catch Exception e System out println e getMessage JIComServer comStub null IJIDispatch pNovaDispatch null TJIComObject unknown null try JISession session JISession createSession args i args 2 args 3 session useSessionSecurity true JIProgld pid JIProgld v
207. r HRESULT tDeletePrinterActivePublicProfile in string LPWSTR p_wsPrinterName i Parameters p_wsPrinterName in string printer name Return values S_OK on success or COM error code NV_SERVICE_ERROR error connecting to novaPDF Server servic Remarks Removes the active profile setting for the printer The users will be allowed to change the active profile 2 4 10 4 28 DeletePrinterActivePublicProfile2 The DeletePrinterActivePublicProfile2 method removes the active public profile setting for a printer HRESULT tDeletePrinterActivePublicProfile2 in string BSTR p_wsPrinterName Parameters p_wsPrinterName in string printer name Return values S_OK on success or COM error code NV_SERVICE_ERROR error connecting to novaPDF Server servic Remarks Removes the active profile setting for the printer The users will be allowed to change the active profile 2 4 10 4 29 DeleteProfile The DeleteProfile method deletes an existing profile HRESULT DeleteProfile in LPCWSTR p_wsProfileld i Parameters novaPDF SDK 8 User Manual Copyright 2015 Softland 64 novaPDF SDK 8 p_wsProfileld in pointer to a null terminated Unicode string containing the id of the profi Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_SERVICE_ERROR error connecting to novaPDF Server servic NV_PROFILE_DE
208. r the new watermark Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded novaPDF SDK 8 User Manual Copyright O 2015 Softland 58 novaPDF SDK 8 Remarks The newly created watermark contains default settings Use the watermark id and layout id as parameters for set watermark and layout options functions For layout options see Working with Layout objects 2 4 10 4 14 AddWatermarkText2 The AddWatermarkText2 method adds a new text watermark HRESULT AddWatermarkText2 out string BSTR p_pwsNewWatermarkId out string BSTR p_pwsNewLayoutId Parameters p_pwsNewWatermarkld out string return new watermark id p_pwsNewLayoutld in string return layout id for the new watermark Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded Remarks The newly created watermark contains default settings Use the watermark id and layout id as parameters for set watermark and layout options functions For layout options see Working with Layout objects 2 4 10 4 15 ClearFontOptions The ClearFontOptions empties the always embed and never embed fonts lists HRESULT ClearFontOptions void Parameters none Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_NO_PROFILE
209. ress p_wsBCC in BCC address novaPDF SDK 8 User Manual Copyright 2015 Softland 122 novaPDF SDK 8 Return values S_OK on success or NV_NOT_INITIALIZED COM error code Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_INVALID_RECIPIENT wrong recipient id 2 4 10 4 141 SetFontOption The SetFontOption method sets embed options for a given font HRESULT SetFontOption in string LPCWSTR p_wsFontName in BOOL p_bAlwaysEmbed in BOOL p_bNeverEmbed Parameters p_wsFontName in font name p_bAlwaysEmbed out always embed flag for the font p_bNeverEmbed out never embed flag for the font Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong font name 2 4 10 4 142 SetFontOption2 The SetFontOption2 method sets embed options for a given font HRESULT SetFontOption2 in string BSTR p_wsFontName in BOOL p_bAlwaysEmbed in BOOL p_bNeverEmbed Parameters p_wsFontName in font name p_bAlwaysEmbed out always embed flag for the font p_bNeverEmbed out never embed flag for the font novaPDF SDK 8 User Manual Copyright O 2015 Softland
210. rg terop dcom common JISystem import org terop dcom core IJIComObject import org terop dcom core JIComServer import org terop dcom core JIProgIid import org terop dcom core JISession import org terop dcom core JIString import org terop dcom core JIVariant import org terop dcom impls JIObjectFactory import org terop dcom impls automation IJIDispatch n n n n in in n n n n a Cito E El td a td al public class MSWord private JIComServer comStub null private IJIDispatch dispatch null private IJIComObject unknown null private IJIDispatch PDF null private JIString PRINTER null public MSWord String address String args IJIDispatch PDF JIString PRINTER throws JIException UnknownHostException this PDF PDF this PRINTER PRINTER JISession session JISession createSession args 1 args 2 args 3 session useSessionSecurity true comStub new JIComServer JIProgIid valueOf Word Application address session public void startWord throws JIException unknown comStub createlnstance dispatch IJIDispatch JIObjectFactory narrowObject unknown queryInterface IJIDispatch IID public void showWord throws JIException int dispId dispatch getIDsOfNames Visible JIVariant variant new JIVariant Boolean FALSE dispatch put dispId variant novaPDF SDK 8 User Manual Copyright O 2015 Softl
211. rints the page private static void PrintPageFunction object sender PrintPageEventArgs ev string str novaPDF says Hello World from CH Font font new Font Arial 16 Brush brush new SolidBrush Color Black ev Graphics DrawString str font brush 20 0f 20 0f ev HasMorePages false 2 5 5 2 CSharp Converter The CSharp Converter sample demonstrates how to convert an existing file by printing it to novaPDF SDK 8 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 novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 161 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 SDK 8 using the ShellExecute function call When using this technique to convert a file to PDF you have to take care of 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
212. rofile catch JIException except System out println SetActiveProfile2 except printStackTrace InitializeOLEUsage Word Application pNovaDispatch callMethod InitializeOLEUsage new Object APPNID pNovaDispatch callMethod LicenseOLEServer MSWord word new MSWord args 0 args pNovaDispatch PRINTER word startWord word showWord word performOp word quitAndDestroy RESTORE PREVIOUS ACTIVE PROFILE try if oldActiveProfile length gt 0 pNovaDispatch callMethod SetActiveProfile2 new Object new JIString oldActiveProfile catch JIException except System out println SetActiveProfile2 Old except printStackTrace DELETE THE NEW PROFILE try pNovaDispatch callMethod DeleteProfile2 new Object new JIString activeProfile catch JIException except System out println DeleteProfile2 except printsStackTrace System out printin Done catch Exception e System out println UPS e printStackTrace novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 191 SOURCE CODE FOR WORD OLE SAMPLE MSWORD JAVA package wordole j interop can be found at http www j interop org and it is an open source project d import java net UnknownHostException import org jinterop dcom common JIException import o
213. rofile loaded 2 4 10 4 45 GetEmailOptionBool The GetEmailOptionBool method retrieves an option of bool type for an email HRESULT GetEmailOptionBooli in string LPWSTR p_pwsEmailld in LONG p_nOption out LONG p_bValue y Parameters p_pwsEmailld in email id obtained with GetEmail or AddEmail p_nOption in option constant p_bValue out pointer to a pointer to bool that will contain the value of the retrievec Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMAIL wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type bool Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland 72 novaPDF SDK 8 2 4 10 4 46 GetEmailOptionBool2 The GetEmailOptionBool2 method retrieves an option of bool type for an email HRESULT GetEmailOptionBooli in string BSTR p_pwsEmailld in LONG p_nOption out LONG p_bValue y Parameters p_pwsEmailld in email id obtained with
214. rs in your network For instance you can configure a folder where all client computers will save the PDF files Private profiles are visible only on the computer where they were created and for the user that created them How to register for messages novaPDF SDK 8 generates the following events when processing a print job e Document Started e Page Started e Page Ended e Document Ended File Sent File Saved Print Error Email Sent Email Error novaPDF SDK 8 User Manual Copyright O 2015 Softland 28 novaPDF SDK 8 2 4 6 2 4 7 When the events are fired by the driver these Windows messages are sent to a registered window handler To receive a message you need to register your window handle with the RegisterEventWindow method See the MFC Converter and MFC Scribble samples These events are fired when the print job is processed by the driver When an applications sends a print job to the printer the print job is added in the printer spooler queue There might be other jobs waiting in the queue that have to be finished before your job starts So there might be some delay between the moment the application is sending the job to the printer the moment the job is actually processed and the time when the PDF file is saved If you need for instance to open the PDF file afterwards you need to register to the File Saved message and process the PDF file in this message handler How to use events If you want to wait f
215. s e determines the active profile makes a copy of it and names it Test Java e sets the new profile Test Java as active as well as some mandatory settings e g the subject of the PDF e generates a test PDF file e restores the original settings of the novaPDF SDK 8 printer driver novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 183 j Interop is a Java Open Source library under LGPL that implements the DCOM wire protocol MSRPC to enable development of Pure Bi Directional Non Native Java applications which can interoperate with any COM component j Interop can be found at http www j interop org Note If you encounter problems or have questions on using j Interop visit their FAQ page at http www j interop org faq html Also to avoid the Logon failure unknown user name or bad password error configure DCOM for remote access detailed here http j integra intrinsyc com support com doc remoteaccess html winxp and make sure your firewall is not turned on SOURCE CODE OF THE HELLO WORLD JAVA SAMPLE MAIN JAVA package helloworld import java awt import java awt print import java net UnknownHostException import java util logging Level import javax print PrintService import org import org import org import org import org import org import org import org import org import org interop dco interop dco interop dco interop dco in
216. s Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_INVALID_EMAIL wrong email id 2 4 10 4 7 AddNovaPrinter The AddNovaPrinter method adds a temporary novaPDF printer in the system HRESULT AddNovaPrinter in LPCWSTR p_wsPrinterName in string LPCWSTR p_wsOEMID in string LPCWSTR p_wsServicePort in string LPCWSTR p_wsLicensekey i Parameters p_wsPrinterName in pointer to a null terminated Unicode string containing the name of the pri p_wsOEMID in custom OEMID for trial is nPdfSdk8_Softland p_wsServicePort in novaPDF Server service port number p_wsLicenseKey in license key Return values S_OK on success or COM error code NV_NOT_A_NOVAPDF_PRINTER invalid OEMID NV_INVALID_PRINTER_NAME a printer with the specified name cannot be added Remarks This method must be called before printing documents and setting novaPDF options It will add a printer in the system with the specified name This printer will be available until DeleteNovaPrinter is called with the same printer name Use this method if you wish to work with temporary printers 2 4 10 4 8 AddNovaPrinter2 The AddNovaPrinter2 method adds a temporary novaPDF printer in the system HRESULT AddNovaPrinter2
217. s drop down you will be able to see the list of printers that are installed on the current computer and use the novaPDF SDK driver Usually only one printer will show up but if you have multiple ones you can select a different one Optionally you can click on Preferences to adjust the driver s options File list This is the list of files that can be converted individually to PDF or merged in a single PDF file You can click on Add files to add documents for conversion or Add folder if you have multiple documents in a folder If you select a folder all files that are convertible will be detected and added to the list Once the list of files is displayed you can manage those by selecting them and clicking on Remove or move Up Down in the list the order in which the files are displayed is the order in which they will be inserted in the PDF when you merge the files If you want to exclude some of the files from the conversion but still keep them in the list just uncheck the Use option for those particular files These file formats can be currently converted in bulk doc docx docm dotx dotm dot mht htm rtf txt xml odt wps xlsx xlsm xIsb xls xltx xltm xlt csv prn dif slk xlam ods pptx pptm ppt potx potm pot thmx ppsx ppsm pps odp vsdx vssx vstx vsdm vssm vstm vsd vdw vss vst svg svgz dwg dxf emz Save Ope
218. sDefaultProfile m_pNova gt SetActiveProfile m_wsDefaultProfile delete newly created profile m_pNova gt DeleteProfile m_wsNewProfile free memory CoTaskMemFree m_wsNewProfile CoTaskMemF ree m_wsDefaultProfile m_wsDefaultProfile NULL m_wsNewProfile NULL restore default printer m_pNova gt RestoreDefaultPrinter 6 novaPDF SDK 8 message handler LRESULT CScribbleView OnNovaPDFFileSaved WPARAM LPARAM PDF is saved so just show a message that the conversion to PDF was successful essageBox L PDF file was saved successfully L novaPrint return 0 2 5 6 5 Temporary printer Temporary printer sample is similar with Hello World sample but it uses temporary printers It demonstrates the use of AddNovaPrinter and DeleteNovaPrinter Source code include stdafx h Include novaPDF headers include include novaOptions h NovaPdfOptions tinclude include novapi h tinclude nova h name of novaPDF Printer Demo define PRINTER_NAME L novaPDF temporary printer define PORT_NAME L novaPDF8temp text to be written in the PDF file define PDF_TEXT L Hello world PDF file name novaPDF SDK 8 User Manual Copyright 2015 Softland 176 novaPDF SDK 8 define PDF_FILE_NAME L HelloWorld pdf Print profile name define PROFILE_NAME L HelloWorld Profile define PROFILE _IS PUBLIC 0 entry point for
219. sFontName in font name p_pbAlwaysEmbed out pointer to a boolean that will p_pbNeverEmbed out pointer to a boolean that will Return values S_OK on success or COM error code contain the always embed flag for the font contain the never embed flag for the font NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong font name novaPDF SDK 8 User Manual Copyright 2015 Softland 80 novaPDF SDK 8 2 4 10 4 61 GetLayout The GetLayout method retrieves the layout id for the specified object in the loaded profile HRESULT GetLayout in string LPWSTR p_wsObjectld in LONG p_nindex out string LPWSTR p_pwsLayoutId Parameters p_wsObjectId in object id watermark text watermark image overlay signature or content p_nIndex in layout index p_pwsLayoutld out layout id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong object id NV_INVALID_LAYOUT layout not found for specified object Remarks For layout options see Working with Layout objects 2 4 10 4 62 GetLayout2 The GetLayout2 method retrieves the layout id for the specified object in the loaded profile HRESULT GetLayout2 in string BSTR p_wsObjectlId in LONG p_nindex out string BSTR p_pwsLayoutId
220. sers Public Documents novaPDF 8 SDK Branding novaPDF8SDK x64 msi gt lt Include gt Bundle wxs lt xml version 1 0 encoding UTF 8 gt lt Wix xmlns http schemas microsoft com wix 2006 wi xmlns util http schemas microsoft com wix UtilExtension xmlns bal http schemas microsoft com wix BalExtension xmlns swid http schemas microsoft com wix TagExtension novaPDF SDK 8 User Manual Copyright O 2015 Softland novaPDF SDK 23 xmlns dotNet http schemas microsoft com wix NetFxExtension gt lt include Variables wxi gt gt lt Bundle Name var BundleName Version var MajorVersion var MinorVersion var BuildNumber Manufacturer var Manufacturer UpgradeCode var UpgradeCode AboutUrl var AboutUr1 SplashScreenSourceFile var SplashImage Compressed yes IconSourceFile var IconFile gt lt swid Tag Regid regid 2008 09 org wixtoolset gt lt change the UpgradeCode to an unique new GUID for your application gt lt RelatedBundle Id var UpgradeCode Action Upgrade gt lt application license gt lt BootstrapperApplicationRef Id WixStandardBootstrapperApplication RtfLicense UW gt lt bal WixStandardBootstrapperApplication LicenseFile var MyLicenseFileName SuppressOptionsUI yes gt lt BootstrapperApplicationRef gt lt Check for printer driver msi upgrade code this is a fix to not allow upgrade over ver
221. sions 905 906 and 907 gt lt util ProductSearch Result version Variable Version80907 UpgradeCode b3e39fcd 55eb 41b6 92eb 4c5a000c7043 gt lt bal Condition Message Cannot run this setup Please uninstall doPDF from the Control Panel and then run the installation again gt lt CDATA Version80907 lt gt 8 0 907 0 AND Version80907 lt gt 8 0 906 0 AND Version80907 lt gt 8 0 905 0 gt lt bal Condition gt lt Chain gt lt prereqs gt lt PackageGroupRef Id NetFx4 Web gt lt COM gt lt MsiPackage Id COMx86 var MajorVersion var MinorVersion var BuildNumber Cache yes Cacheld COMIdx86 var MajorVersion f var MinorVersion var BuildNumber DisplayInternalUI no EnableFeatureSelection no ForcePerMachine yes Compressed yes SourceFile var COMPathx86 Visible yes Vital yes gt lt MsiPackage gt lt MsiPackage Id COMx64 var MajorVersion var MinorVersion var BuildNumber Cache yes CacheId COMIdx64 var MajorVersion var MinorVersion var BuildNumber DisplayInternalUI no EnableFeatureSelection no ForcePerMachine yes Compressed yes SourceFile var COMPathx64 Visible yes novaPDF SDK 8 User Manual Copyright O 2015 Softland 24 novaPDF SDK 8 Vital yes InstallCondition VersionNT64 gt lt MsiPackage gt lt driver gt lt MsiPackage Id DriverPackagex86 var MajorVersion var MinorVersion
222. stProfile2 strProfilelD m_NovaOptions LoadProfile2 strProfileID m_NovaOptions GetOptionString2 NOVAPDF_PROFILE_NAME strProfileName cmb On Do On cmb Exi End Sub Profiles AddItem strProfileName Error Resume Next m_NovaOptions GetNextProfile2 strProfilelD If err Number NV_NO_MORE_PROFIL Exit End If ES Then Do m_NovaOptions LoadProfile2 strProfileID m_NovaOptions GetOptionString2 NOVAPDF_PROFILE_NAME strProfileName cmbProfiles AddItem strProfileName Loop While True Error GoTo Profiles L E Sub ErrorHandler Debug Print err Number err De ErrorHandler istIndex 0 UpdateDialogFromProfile 4 Set novaPDF SDK 8 Options Private Sub AddSmallSize Dim strProfileID As String On Error GoTo ErrHandler scription m_NovaOptions AddProfile2 SMALL SIZE PROFILE PROFILE_IS_PUBLIC strProfileID novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 197 m_NovaOptions LoadProfile2 strProfilelD Set some options to this profile disable the Save PDF file as prompt m_NovaOptions SetOptionLong2 NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_NONE set generated Pdf files destination folder c m_NovaOptions SetOptionString2 NOVAPDF_SAVE_FOLDER c set output file name m_NovaOptions SetOptionString2 NOVAPDF_SAVE_FILE_NAME PDF Converter small size pdf if file e
223. started Therefore you have to set the default printer to novaPDF SDK 8 before calling ShellExecute using the SetDefaultPrinter method wait the process to be started using WaitForExit restore the default printer with the RestoreDefaultPrinter method This way you made sure that the default printer was restored and your document is printed to novaPDF SDK 8 Source code snippets 1 DECLARE INovaPdfOptions variable private NovaPdfOptions80Class mobjNovaOptios 2 Initialize INovaPdfOptions mob jNovaOptios new NovaPdfOptions80Class initialize the NovaPdfOptions object mob jNovaOptios Initialize PRINTER_NAME create option profiles AddSmallProfile AddFullProfile 3 Set novaPDF SDK 8 Options try String newSmallSizeProfileId String Empty Set some options to this profile mob jNovaOptios AddProfile SMALL_SIZE_PROFILE PROFILE_IS_PUBLIC out newSmallSizeProfileld load the new profile mob jNovaOptios LoadProfile newSmallSizeProfileld disable the Save PDF file as prompt mob jNovaOptios SetOptionLong NovaOptions NOVAPDF_SAVE_PROMPT_TYPE 0 set generated Pdf files destination folder c mob jNovaOptios SetOptionString NovaOpt ions NOVAPDF_SAVE_FOLDER en catch System Runtime InteropServices COMException ComException novaPDF SDK 8 User Manual Copyright O 2015 Softland 162 novaPDF SDK 8
224. ster novaPDF SDK 8 messages const UINT wm_Nova_FileSaved RegisterWindowMessageW MSG_NOVAPDF2_FILESAVED const UINT wm_Nova_PrintError RegisterWindowMessageW MSG_NOVAPDF2_PRINTERROR BEGIN_MESSAGE_MAP CnovaPrintDlg CDialog Th sak ON_REGISTERED_MESSAGE ON_REGISTERED_MESSAG wm_Nova_FileSaved OnNovaPDFFileSaved wm_Nova_PrintError OnNovaPDFPrintError A ERR END_MESSAGE_MAP 3 Initialize INovaPdfOptions BOOL CnovaPrintDlg OnInitDialog TF ie HRESULT hr S_OK m_novaOptions 0 create an instance of INovaPdfOptions hr CoCreatelnstance __uuidof NovaPdfOptions80 NULL CLSCTX_INPROC_SERVER if SUCCEEDED hr initialize the NovaPdfOptions object to use with a printer licensed for hr m_novaOptions gt Initialize PRINTER_NAME L else MessageBoxW NULL L Failed to create novaPDF COM object L novaPDF ME TP wee novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 171 4 Release INovaPDFOptions CnovaPrintDlg CnovaPrintDlg Ff asa delete profiles if m_wsProfileSmall hr m_novaOptions gt DeleteProfile m_ wsProfileSmall CoTaskMemF ree m_wsProfileSmall if m_wsProfileFull hr m_novaOptions gt DeleteProfile m_wsProfileFull CoTaskMemFree m_wsProfileFull destroy
225. string BSTR p_pwsLayoutId i Parameters p_pwsSignatureld out string signature id p_pwsLayoutld out string layout id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_PROFILE_ ERROR error reading profile Remarks There can be only one signature in a profile For layout options see Working with Layout objects 2 4 10 4 87 GetWatermarklmage The GetWatermarklmage method retrieves an existing image watermark properties HRESULT GetWatermarkImage in LONG p_nIndex out string LPWSTR p_pwsWatermarkId i Parameters p_nindex in watermark index p_pwsWatermarkId out string watermark id novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 95 Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong image watermark index 2 4 10 4 88 GetWatermarklmage2 The GetWatermarklmage2 method retrieves an existing image watermark properties HRESULT GetWatermarkImage2 in LONG p_nIndex out string BSTR p_pwsWatermarkId gt Parameters p_nindex in watermark index p_pwsWatermarkIid out string watermark id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE
226. t called before NV_NO_MORE_PROFILES there are no more profiles to numerat 2 4 10 4 75 GetOptionBool The GetOptionBool method retrieves a printing option of boolean type HRESULT GetOptionBool in LONG p_nOption out BOOL p_pbValue i Parameters p_nOption in option constant p_pbValue out pointer to a boolean that will contain the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 76 GetOptionEncryptedString The GetOptionEncryptedString method retrieves an option of type encrypted string HRESULT GetOptionEncryptedString in LONG p_nOption out LPWSTR p_pwsValue i Parameters p_nOption in option constant novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 89 p_pwsValue out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM
227. t string LPWSTR p_pwsNewRecipientld in string LPWSTR p_wsFrom in string LPWSTR p_wsTo in string LPWSTR p_wsCC in string LPWSTR p_wsBCC i Parameters p_wsEmailld in the email id where to add the recipient obtained with GetEmail or AddEmai p_pwsNewRecipientld out return recipient id p_wsFrom in From address p_wsTo in To address p_wsCC in CC address p_wsBCC in BCC address Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_SERVICE_ERROR cannot connect to novaPDF Server servic NV_PROFILE_ERROR cannot read default profile NV_INVALID_EMAIL wrong email id 2 4 10 4 6 AddEmailRecipient2 The AddEmailRecipient2 method adds a new email recipient HRESULT AddEmailRecipient2 in string BSTR p_wsEmailld out string BSTR p_pwsNewRecipientId in string BSTR p_wsFrom in string BSTR p_wsTo in string BSTR p_wsCC BSTR p_wsBCC in string Parameters p_wsEmaillId in the email id where to add the recipient obtained with GetEmail2 or Adal p_pwsNewRecipientld out return recipient id p_wsFrom in From address p_wsTo in To address E 3 0 novaPDF SDK 8 User Manual Copyright 2015 Softland 54 novaPDF SDK 8 p_wsCC in CC address p_wsBCC in BCC addres
228. t Converter sample demonstrates how to convert an existing file by printing it to novaPDF SDK 8 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 SDK 8 using the ShellExecute function call When using this technique to convert a file to PDF you have to take care of 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 SDK 8 before calling ShellExecute using the SetDefaultPrinter method wait the process to be started using WaitForExit restore the default printer with the RestoreDefaultPrinter method This way you made sure that the default printer was restored and your document is printed to novaPDF SDK 8 Source code snippets 1 Declare INovaPdfOptions variable Private mob
229. t files novaOptions h novaOptions pas Globals bas 2 4 10 4 177 SetWatermarkTextOptionLong2 The SetWatermarkTextOptionLong2 method sets a watermark text option of long int type HRESULT SetWatermarkTextOptionLong2 in string BSTR p_pwsWatermarkld in LONG p_nOption in LONG p_lValue Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkText2 p_nOption in option constant p_lValue in long integer value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_TXT wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long novaPDF SDK 8 User Manual Copyright 2015 Softland 142 novaPDF SDK 8 Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 178 SetWatermarkTextOptionString The SetWatermarkTextOptionString method sets a watermark text option of string type HRESULT SetWatermarkTextOptionString in string LPWSTR p_pwsWatermarkId in LONG p_nOption in LPCWSTR p_wsValue i Parameters p_pwsWaterm
230. tLayoutOptionString method sets an option of string type for a layout object HRESULT SetLayoutOptionString in string LPWSTR p_pwsObjectld in string LPWSTR p_pwsLayoutld in LONG p_nOption in LPCWSTR p_wsValue novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 127 Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout p_wsOption in option constant p_wsValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 150 SetLayoutOptionString2 The SetLayoutOptionString2 method sets an option of string type for a layout object HRESULT SetLayoutOptionString2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption in BSTR p_wsValue i
231. tSignature2 Overlay options GetOverlay GetOverlay2 Content options GetContentLayout GetContentLayout2 Profiles Management LoadProfile LoadProfile2 SaveProfile SaveProfile2 AddProfile AddProfile2 CopyProfile CopyProfile2 DeleteProfile DeleteProfile2 GetFirstProfile GetFirstProfile2 GetNextProfile GetNextProfile2 GetActiveProfile novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 49 GetActiveProfile2 SetActiveProfile SetActiveProfile2 Set default printer SetDefaultPrinter RestoreDefaultPrinter Printers management AddNovaPrinter AddNovaPrinter2 DeleteNovaPrinter DeleteNovaPrinter2 Register events RegisterEventWindow UnRegisterEventWindow RegisterNovaEvent RegisterNovaEvent2 WaitForNovaEvent OLE Licensing InitializeOLEUsage LicenseOLEServer ShellExecute Licensing LicenseShellExecuteFile Print from launched applications LicenseApplication 2 4 10 4 INovaPdfOptions 2 4 10 4 1 AddBookmarkDefinition The AddBookmarkDefinition method adds a new bookmark definition in the current loaded profile having the characteristics specified by the method parameters HRESULT AddBoo D xo 1 INT poe H H par H H H H H H H H bA o kbA b A h k h wA be n SHORT p_ BOOL BOO LONG BOO BOO BOO BOO FLOAT p_ BOO LONG p_nDetCol L p_bDetCol kmarkDefinition nHeading p_bEnabled L p_bDetFont string L
232. tWarning mbOK 0 end create an instance of INovaPdfOptions m_novaOptions nil hr ActiveX CoCreateInstance CLASS _NovaPdfOptionss80 CLSID_CNovaPdfSource nil CLSCTX_INPROC_SERVER IID_INovaPdfOptions80 m_novaOptions if FAILED hr then begin MessageDlg Failed to create novaPDF COM object mtWarning mbOK 0 exit end initialize the NovaPdfOptions object to use with a printer licensed for SDK m_novaOptions Initialize PRINTER_NAME if FAILED hr then begin MessageDlg Failed to initialize NovaPdfOptions mtWarning mbOK 0 novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 151 exit end add 2 profiles CreateProfiles load profiles in list LoadProfiles ND E 4 Release INovaPDFOptions PROCEDURE TForml FormClose Sender TObject var Action TCloseAction BEGIN Eos delete profiles m_novaOptions DeleteProfile2 m_strSmallSizeProfilelD m_novaOptions DeleteProfile2 m_strFullOptProfilelD destroy m_novaOptions object no need for this as the Delphi takes care of it automatically uninitialize COM libraries ActiveX CoUninitialize Po Det E ND 5 Set novaPDF SDK 8 Options PROCEDURE TForml CreateProfiles BEGIN Add a profile called Small size m_novaOptions AddProfile2 SMALL_SIZE_PROFILE PROFILE_IS_PUBL
233. ter driver novaPDF8COM x64 msi or novaPDF8COM x86 msi install 32 and 64 bit versions of the COM novaPDF8SDK x64 msi or novaPDF8SDK x86 msi install the custom licensed printer You can install the msi silently using the following command line msiexec i lt msi file name gt qn You can install the package bundle silently using the following command line lt setup name gt q To create the final release build you need to create an installation package bundle and run it See the Build an installation package bundle topic 4 Print without unlicensed notice Your printer should be licensed now so the generated PDF files should not have the unlicensed footer notice If the footer notice is still showing up you have to verify that you followed the steps from How to integrate correctly Customize your setup Each developer that integrates a novaPDF 8 SDK Developer license will receive a unique OEM ID so its novaPDF installation does not interfere with other developers installation In order to have an unique licensed printer you have to customize the setup that you will distribute with your application with the novaPDF Co Branding tool The novaPDF Co Branding tool copies the installer msi files in a new folder and modifies them with your license and installation parameters Here is the information requested by the tool wizard BRANDING FOLDER When starting the application you will be asked for the branding folder You
234. terop dco interop dco interop dco interop dco interop dco interop dco common JIException common JISystem core IJIComObject core JlIComServer core JlProgld core JISession core JIString core JIVariant impls JIObjectFactory impls automation IJIDispatch 3333333333 fail Ge E taa ls E a te public class Main implements Printable private static String PRINTER_NAME private static String MESSAGE Hell public static String PROFILE_NAME i public static int PROFILE IS PUBLI novaPDF SDK 8 o world from Java2 Test Java a 0 aunt o L public static long NOVAPDF_DOCINFO_SUBJECT 68 public static String NOVAPDF_INFO_SUBJECT Java Hello World Document Subject public static long NOVAPDF_SAVE_FILE_NAME 104 public static long NOVAPDF_SAVE_FILEEXIST_ACTION 108 public static long FILE_CONFLICT_STRATEGY_AUTONUMBER_NEW 1 public static long NOVAPDF_INFO_VIEWER_ENABLE 8 public static long NOVAPDF_SAVE_PROMPT_TYPE 101 public static long PROMPT_SAVE_SIMPLE 2 JIComServer comStub null IJIDispatch pNovaDispatch null IJIComObject pNova null novaPDF SDK 8 User Manual Copyright 2015 Softland 184 novaPDF SDK 8 Skk param args the command line arguments Ey public static void main String args thro
235. th the printer spooler queue the documents sent to the printer are added to the queue If there are already some other documents in the queue the current document is not processed until the previous ones are finished There are two PDF file names you can find out depending on the value of the p_bPrintStarted flag e the name of the PDF file that was just sent to the printer e the name of the PDF file that is currently processed by the printer This information is available only on the computer that starts the print job if the PDF file is saved local and not on the network 2 4 10 4 85 GetSignature The GetSignature method retrieves the signature and its layout object HRESULT GetSignature out string LPWSTR p_pwsSignatureld out string LPWSTR p_pwsLayoutId i Parameters p_pwsSignatureld novaPDF SDK 8 User Manual Copyright 2015 Softland 94 novaPDF SDK 8 out string signature id p_pwsLayoutld out string layout id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_PROFILE_ ERROR error reading profile Remarks There can be only one signature in a profile For layout options see Working with Layout objects 2 4 10 4 86 GetSignature2 The GetSignature2 method retrieves the signature and its layout object HRESULT GetSignature2 out string BSTR p_pwsSignatureld out
236. 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 SDK 8 using the ShellExecute function call When using this technique to convert a file to PDF you have to take care of 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 SDK 8 before calling ShellExecute using the SetDefaultPrinter method register Filesaved message or any other novaPDF SDK 8 message to be sure that the print job was started In this message handler restore the default printer with the RestoreDefaultPrinter method This way you made sure that the default printer was restored and your document is printed to novaPDF SDK 8 Source code snippets 1 Declare INovaPdfOptions variable create the NovaPdfOptions object Public m_NovaOptions As New NovaPdfOptions80 2 Register novaPDF SDK 8 messages Public wm_Nova_FileSaved As Long Public wm_Nova_PrintError As Long Sub Main Registering the messages send by the print in order to listen for them wm_Nova_FileSaved RegisterWindowMessage MSG_NOVAPDF2_FILESAVED wm_Nova_PrintError RegisterWindowMessage MSG_NOVAPDF2_PRINTERROR Forml Show End Sub Sub that will handle the windows messag
237. the console application int _tmain int argc _TCHAR argv CLSCTX 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 NovaPdfOptions8 NULL _INPROC_SERVER __uuidof INovaPdfOptions8 LPVOID amp pNova if SUCCEEDED hr add temporary printer pNova gt AddNovaPrinter PRINTER_NAME PORT_NAME L nPdtsaks Softland E8501 L set optional PDF settings LPWSTR pwsNewProfileID NULL create a new profile with default settings hr pNova gt AddProfile PROFILE_NAME PROFILE_IS_PUBLIC pwsNewProfilelID load the diia created profile if SUCCEEDED hr 88 pwsNewProfilelD hr pNova gt LoadProfile pwsNewProfilelD else MessageBox NULL L Failed to create profile L novaPDF MB_OK return hr set novaPDF options set PDF document Title pNova gt SetOptionString NOVAPDF_DOCINFO_TITLE L My Doc Title what type of save dialog to be shown none simple or extended pNova gt SetOptionLong NOVAPDF_SAVE_PROMPT_TYPE PROMPT_SAVE_SIMPLE you may choose a predefined folder like My Documents pNova gt SetOptionLong NOVAPDF_SAVE_FOLDER_TYPE novaPDF SDK 8 User Manual Copyright 201
238. tion index 2 4 10 4 122 ModifyBookmarkDefinition2 The ModifyBookmarkDefinition2 method modifies an existing bookmark definition having the characteristics specified by the method parameters HRESULT ModifyBookmarkDefinition2 in SHORT p_nDefinition in SHORT p_nHeading in BOOL p_bEnabled in BOOL p_bDetFont in string BSTR p_wsDetFont in BOOL p_bDetStyle in BOOL p_bDetBold in BOOL p_bDetItalic in BOOL p_bDetSize in FLOAT p_nDetSizeVal in FLOAT p_nDetSizePt in BOOL p_bDetColor in LONG p_nDetColor in BOOL p_bDispAsBold in BOOL p_bDispAsItalic in LONG p_nDispColor in string BSTR p_wsProfileName novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 113 in BOOL p_bPubli i Parameters p_nDefinition p_nHeading in Jheading index p_bEnabled in definition is p_bDetFont in detect font f p_wsDetFont in font name p_bDetStyle p_bDetBold in bold font p_bDetItalic in italic font p_bDetSize in detect font s p_nDetSizeVal in font size p_nDetSizePt in font size rou p_bDetColor in detect font c p_nDetColor p_bDispAsBold p_bDispAsItalic p_nDispColor p_wsProfileName in pointer toa p_bPublicProfile in Flag if the p Return values S_OK on success or CO NV_NOT_INITIALIZED NV_UNKNOWN_PROFILE NV_INVALID_BOOKMARK_DEF wrong bookm
239. tioned on the PDF page There is only one content object in the profile For layout options see Working with Layout objects 2 4 10 4 42 GetEmail The GetEmail method retrieves the email id for the specified email index HRESULT GetEmail in LONG p_nIndex out string LPWSTR p_pwsEmailld Parameters p_nIndex in email index p_pwsLayoutld out email id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_EMATL email not found 2 4 10 4 43 GetEmail2 The GetEmail2 method retrieves the email id for the specified email index HRESULT GetEmail2 in LONG p_nIndex out string BSTR p_pwsEmailld i Parameters p_nIndex in email index p_pwsLayoutld out email id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 71 NV_INVALID_EMATL email not found 2 4 10 4 44 GetEmailCount The GetEmailCount method retrieves the count of email objects in the loaded profile HRESULT GetEmailCount out LONG p_pnCount i Parameters p_pnCount out emails count Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no p
240. tive profile for printer pNova SetActiveProfile sNewProfilelD l Print Dim myPr For Each myPrinter In Printers If myPrinter DeviceNam Set Printer myPrinter End Next Printer Printer Printer Printer Printer Printer restore a test page inter As Printer Exit For if FontName Arial FontSize 16 CurrentX 20 CurrentY 20 Print novaPDF sa EndDoc default profile PRINTER_NAME Then Hello World from VB If Len sOldActiveProfileID gt 0 Then pNova SetActiveProfile2 sOldActiveProfilelID Ena If delete newly created profile pNova DeleteProfile2 sNewProfileID Exit Sub ErrorHandler Debug Pr End Sub 2 5 8 2 VB Converter int Err Number amp amp Err Description The VB Converter sample demonstrates how to convert an existing file by printing it to novaPDF SDK 8 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 novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 195 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
241. trings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 135 SetEmailOptionLong The SetEmailOptionLong method sets an option of long int type for an email HRESULT SetEmailOptionLong in string LPWSTR p_pwsEmailld in LONG p_nOption in LONG p_lValue y Parameters p_pwsEmaillIld in email id obtained with GetEmail or AddEmail p_wsOption in option constant p_lValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 119 NV_UNKNOWN_PROF NV_INVALID_EMAT ILE T I no profile loaded wrong email id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 136 SetEmailOptionLo ng2 The SetEmailOptionLong2 method sets an option of long int type for an email HRESULT SetEmailOptionLong2 lin
242. ts a watermark image option of float type HRESULT SetWatermarkImageOptionFloat in string LPWSTR p_pwsWatermarkId in LONG p_nOption in FLOAT p_fValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_nOption in option constant p_fValue in float value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas novaPDF SDK 8 User Manual Copyright 2015 Softland 136 novaPDF SDK 8 2 4 10 4 167 SetWatermarklmageOptionFloat2 The SetWatermarklmageOptionFloat2 method sets a watermark image option of float type HRESULT SetWatermarkImageOptionFloat2 in string BSTR p_pwsWatermarkld in LONG p_nOption in FLOAT p_fValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_fValue in float value to set Return values S_OK on s
243. ture or content p_pwsLayoutld in layout id obtained with GetLayout p_wsOption in option constant p_fValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 125 2 4 10 4 146 SetLayoutOptionFloat2 The SetLayoutOptionFloat2 method sets an option of boolean type for a layout object HRESULT SetLayoutOptionFloat2 in string BSTR p_pwsObjectld in string BSTR p_pwsLayoutld in LONG p_nOption in FLOAT p_fValue gt Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pwsLayoutld in layout id obtained with GetLayout2 p_wsOption in option constant p_fValue in the value of the option to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initiali
244. uccess or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 168 SetWatermarklmageOptionLong The SetWatermarklmageOptionLong method sets a watermark image option of long int type HRESULT SetWatermarkImageOptionLong in string LPWSTR p_pwsWatermarkId in LONG p_nOption in LONG p_lValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage p_nOption in option constant p_lValue in long integer value to set Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long novaPDF SDK 8 User Manual Copyright 2015 Softland novaPDF SDK 137 Remarks You
245. ull terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_NO_ACTIVE_PROFILE there is no active profile selected for the printer 2 4 10 4 36 GetActiveProfile2 The GetActiveProfile2 retrieves the id of the active profile i e the profile that is used for printing HRESULT GetActiveProfile2 out BSTR p_wsProfileld gt Parameters p_wsProfileld out pointer to a pointer to a null terminated Unicode string that will contai Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_NO_ACTIVE_PROFILE there is no active profile selected for the printer 2 4 10 4 37 GetBookmarkDefinition The GetBookmarkDefinition method retrieves an existing bookmark definition properties HRESULT GetBookmarkDefinition in SHORT p_nDefinition out SHORT p_pnHeading out BOOL p_pbEnabled out BOOL p_pbDetFont out string LPWSTR p_pwsDetFont out LONG p_pnDetFontType out BOOL p_pbDetStyle out BOOL p_pbDetBold out BOOL p_pbDetItalic out BOOL p_pbDetSize out INT p_pnDetSizeVal out FLOAT p_pnDetSizePt out BOOL p_pbDetColor out LONG p_pnDetColor out BOOL p_pbDispAsBold out BOOL p_pbDispAsItalic out LONG p_pnDispColor i Parameters p_nDefinition in definition index novaPDF SDK 8 User Manual Copyright 201
246. ut 100 80 Printer endDoc PDF_TEXT System Writeln Print job finished restore default profile pNova SetActiveProfile2 strOldActiveProfilelID pNova DeleteProfile2 strNewProfilelD resore default printer pNova RestoreDefaultPrinter release NovaPdfOptions pNova _Release ActiveX CoUninitialize end Word OLE Delphi Source code program WordOLEDelphi SAPPTYPE CONSOLE uses The Word OLE Delphi sample is a simple Windows console application that converts a MS Word document C Test doc to PDF using Word OLE automation novaPDF SDK 8 User Manual Copyright 2015 Softland 156 novaPDF SDK 8 ActiveX Printers ComObj SysUtils Dialogs novaOptions in include novaOptions pas novapiLIB80_TLB in include novapiLIB80_TLB pas const name of novaPDF Printer PRINTER_NAME novaPDF SDK 8 Print profile name PROFILE NAME Test OLE Delphi Profile PROFILE_IS_PUBLIC 0 T var hr HRESULT pNova INovaPdfOptions80 strOldActiveProfileID WideString strNewProfileID WideString Word VARIANT NewDoc VARIANT begin initialize COM hr ActiveX CoInitialize nil if FAILED hr then begin System Writeln Failed to initialize COM exit end create one NovaPdfOptions instance pNova nil hr ActiveX CoCreateInstance CLASS _NovaPdfOptionss80 CLSID_CNovaPdfSource nil
247. ut string LPWSTR p_pwsOverlaylId out string LPWSTR p_pwsLayoutId i Parameters p_pwsOverlayld out string overlay id p_pwsLayoutld out string layout id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_PROFILE_ERROR error reading profile Remarks There can be only one overlay in a profile novaPDF SDK 8 User Manual Copyright 2015 Softland 92 novaPDF SDK 8 For layout options see Working with Layout objects 2 4 10 4 82 GetOverlay2 The GetOverlay2 method retrieves the overlay and its layout object HRESULT GetOverlay2 out string BSTR p_pwsOverlayld out string BSTR p_pwsLayoutId i Parameters p_pwsOverlayld out string overlay id p_pwsLayoutId out string layout id Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_PROFILE_ERROR error reading profile Remarks There can be only one overlay in a profile For layout options see Working with Layout objects 2 4 10 4 83 GetPDFFileName The GetPDFFileName method retrieves the name of the last generated PDF file HRESULT GetPDFFileName in BOOL p_bPrintStarted out string LPWSTR p_pwsFileName i Parameters p_bPrintStarted in flag what file name to retrieve S Remarks p_pwsFileN
248. vaPDF pNova Initialize PRINT ER_NAM F wee try pNova GetActiveProfile out activeProfile catch System Runtime Intero ignore profile exis if NV_NO_ACTIVE ErrorCode _PROFILE pServices COMException ES error uint System Console W riteLine The printer novaPDF SDK 8 User Manual Copyright 2015 Softland 164 novaPDF SDK 8 does not have an active profile propagate it out _newProfilelD Hello document new Microsoft Office I else more serious error throw e add a new profile load the new profile Nova LoadProfile _newProfilelID and set some options Nova SetOptionString NOVAPDF_INFO_SUBJECT C T save profile Nova SaveProfile set the copy profile as active profile Nova SetActiveProfile _newProfilelID set nova default printer Nova SetDefaultPrinter initialize OLE usage in novaPDF Nova InitializeOLEUsage Word Application create Word application object terop Word Application ordApp DisplayAlerts 370p SSO ST ST SSO SS SO O Microsoft Office Interop Word WdAlertLevel wdAlertsNone Value license OLE server in novaPDF pNova LicenseOLEServer initializations object objMissing System Reflection Missing object objTrue true object objFalse false object strFile
249. ws JIException UnknownHostException if args length lt 4 System out printin Please provide address domain username password return new Main doPrint args public void doPrint String args throws JIException UnknownHostException disable J Interop Log try JISystem getLogger setlLevel Level INFO JISystem setInBuiltLogHandler false catch Exception e System out println e getMessage connecting to COM DCOM server JISession session JISession createSession args 1i args 2 args 31 session useSessionSecurity true JIProgld pid JIProgIid valueOf novapi80 NovaPdfOptionss80 pid setAutoRegistration true comStub new JIComServer pid args 0 session pNova comStub createInstance pNovaDispatch IJIDispatch JIObjectFactory narrowObject pNova queryInterface IJIDispatch IID JIString PRINTER new JIString PRINTER_NAME try pNovaDispatch callMethodA Initialize2 new Object PRINTER new JIString pNovaDispatch callMethodA LicenseShellExecuteFile new Object new JIString java catch JIException except System out printin Initialize LicenseShellExecuteFile a except printStackTrace wu String oldActiveProfile z try JIVariant ap pNovaDispatch callMethodA GetActiveProfile2 new Object new JIVariant true oldActiveProfile
250. xists in the destination folder append a counter to the end of the file name m_NovaOptions SetOptionLong2 NOVAPDF_SAVE_FIL FILE _CONFLICT_STRATEGY_AUTONUMBER_NEW don t detect URLs m_NovaOptions SetOptionLong2 NOVAPDF_URL_ANALIZE False T T EXIST_ACTION Set image compresion method to JPEG and quality to 75 possible values are from 10 to 100 m_NovaOptions SetOptionLong2 NOVAPDF_COMPRESS_ENABLE True m_NovaOptions SetOptionLong2 NOVAPDF_COMPRESS_HIGH_COLOR True m_NovaOptions SetOptionLong2 NOVAPDF_COMPRESS_HIGH_COLOR_TYPE COMPRESS_METHOD_JPEG m_NovaOptions SetOptionLong2 NOVAPDF_COMPRESS_HIGH_COLOR_LEVEL 75 make sure text compression is enabled and set compression level to 9 maximum posible values are 1 9 m_NovaOptions SetOptionLong2 NOVAPDF_COMPRESS_TEXT_GRAPHICS True m_NovaOptions SetOptionLong2 NOVAPDF_COMPRESS_TEXT_GRAPHICS_LEVEL 9 disable unused font embeding m_NovaOptions SetOptionLong2 NOVAPDF_FONTS_EMBED_ALL_USED_FONTS False MS m ve profile changes ovaOptions SaveProfile Zo Exit Sub ErrHandler If err Number lt gt NV_PROFILE_EXISTS Then Debug Print err Number amp amp err Description End Sub 5 Start a Print job Private Sub btnStartPrinting_Click m_NovaOptions SetActiv
251. ze was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas For layout options see Working with Layout objects 2 4 10 4 147 SetLayoutOptionLong The SetLayoutOptionLong method sets an option of long type for a layout object HRESULT SetLayoutOptionLong in string LPWSTR p_pwsObjectld in string LPWSTR p_pwsLayoutld in LONG p_nOption in LONG p_lValue i Parameters p_pwsObjectId in object id watermark text watermark image overlay signature or content p_pwsLayoutId in layout id obtained with GetLayout p_wsOption in option constant p_lValue in the value of the option to set Return values S_OK on success or COM error code novaPDF SDK 8 User Manual Copyright 2015 Softland 126 novaPDF SDK 8 NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can fin
252. ze was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK installation folder you can find the definitions for all options in the next files novaOptions h novaOptions pas Globals bas 2 4 10 4 99 GetWatermarklmageOptionString2 The GetWatermarkimageOptionString2 method retrieves a watermark image option of string type HRESULT GetWatermarkImageOptionString2 in string BSTR p_pwsWatermarkld in LONG p_nOption out BSTR p_pwsValue i Parameters p_pwsWatermarkId in watermark id obtained with GetWatermarkImage2 p_nOption in option constant p_pwsValue out the value of the retrieved option Return values S_OK on success or COM error code NV_NOT_INITIALIZED Initialize was not called NV_UNKNOWN_PROFILE no profile loaded NV_INVALID_WATERMARK_IMG wrong watermark id NV_INVALID_OPTION wrong option constant NV_PROFILE_ERROR cannot find option in profile NV_WRONG_OPTION_TYPE option is not of type long Remarks You can find the complete list of option names in the Profile option strings chapter In the Include folder of novaPDF SDK inst

Download Pdf Manuals

image

Related Search

Related Contents

BTTracer User`s Manual  Samsung U28E850R Korisničko uputstvo  Emerson FTA200 Brochures and Data Sheets  取扱説明書 - 岩谷産業  Allied Telesis 195 User's Manual    XC878 Class B Software Library  Sony STR-DE598 User's Manual  www.philips.com/welcome  Manual  

Copyright © All rights reserved.
Failed to retrieve file