- Code: Select all
local cActiveProfile, nActiveProfilePublic
cActiveProfile = ''
nActiveProfilePublic = 0
oPDF = createobject('novapi.NovaPdfOptions')
oPDF.Initialize2( my initialization parameters )
oPDF.GetActiveProfile2(@cActiveProfile, @nActiveProfilePublic)
oPDF.SetOptionLong2("Prompt Save Dialog", 0, cActiveProfile, 0)
oPDF.SetOptionLong2('File Conflict Strategy', 5, cActiveProfile, 0)
oPDF.SetOptionLong2('Save Advanced Strategy', 5, cActiveProfile, 0)
oPDF.SetOptionString2('Save Folder', 'C:\ProgramData\Siriusware\', cActiveProfile, 0)
oPDF.SetOptionString2('Save File', 'TestPrint123.pdf', cActiveProfile, 0)
oPDF.SetOptionLong2("Post Save Open", 0, cActiveProfile, 0)
oPDF.SetOptionLong2('SilentPrint', 0, cActiveProfile, 0)
oPDF.SetOptionLong2('Embed All Fonts', 1, cActiveProfile, 0)
oPDF.RegisterNovaEvent2('NOVAPDF_EVENT_FILE_SAVED')
oPDF.SetDefaultPrinter()
set printer to default
** perform my PDF printing here
oPDF.WaitForNovaEvent(20000, @lTimeout)
oPDF.RestoreDefaultPrinter()
Printing to a PDF works great on various PCs running both Windows XP, Server and 7. However, there is one PC running Windows XP (SP3) where it generates a "OLE error code 0xd5da0008: Unknown COM status code" on every one of the SetOptionLong2 and SetOptionString2 statements. Also, it displays the novaPDF printer options dialog. This error happens when a non-administrator user is logged in. When a user with administrator privileges is logged in, the "Unknown COM status code" error does not appear, but the novaPDF printer options dialog still pops up. I can reproduce the "unknown COM status code" error if I pass an invalid profile name like so...
- Code: Select all
oPDF.GetActiveProfile2(@cActiveProfile, @nActiveProfilePublic)
oPDF.SetOptionLong2("Prompt Save Dialog", 0, 'Nonexistent profile name', 0)
Apparently GetActiveProfile is returning an invalid profile name or is somehow invalid. Why would GetActiveProfile2 be failing for this particular PC? Is the profile, which is typically "Default Profile" corrupted, or is it a Windows permissions problem? Thanks in advance.

News