Page 1 of 2
COM errors when setting options to default profile
Posted: Mon May 23, 2011 6:34 pm
by jtappero
I have a Visual FoxPro app which prints to the novaPDF SDK by redirecting the default printer. Here is a simplified version of what it does...
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.
Re: COM errors when setting options to default profile
Posted: Tue May 24, 2011 9:28 am
by Claudiu (Softland)
Hello,
The 0xd5da0008 exception is raised by novaPDF and it means that the profile name is not found. From your description it seems that on this computer there is no profile defined. This is probably related with some permissions restrictions. novaPDF keeps the profiles in a ini-like file in the "Application Data" folder for the logged in user. Please check if the profiles file is created there and if the user has options to read / write in this folder.
Thank you.
Re: COM errors when setting options to default profile
Posted: Tue May 24, 2011 5:50 pm
by jtappero
Thanks. Our client verified the permissions to the Application Data folder (it was a default Windows XP installation which didn't have any permissions altered). He deleted the NVL file and tried to print from our app again. The COM errors no longer appear, however, the "Save As" dialog still appears. As you can see in my example code above, we explicitly set the "Prompt Save Dialog", "Save Folder" and "Save File" options. Could another NVL file be interfering with this? Thanks.
Re: COM errors when setting options to default profile
Posted: Wed May 25, 2011 8:18 am
by Claudiu (Softland)
Hello,
Please let us know what version and build of novaPDF is installed on the computer and also what type of Windows XP you have on it meaning if it is on 32 bit or 64 bit.
Thank you.
Re: COM errors when setting options to default profile
Posted: Wed May 25, 2011 5:28 pm
by jtappero
Thank you. I am waiting to hear back from the client, but I am pretty sure it is running 32-bit Windows XP (SP3) and novaPDF 7.3.355. Here is some more information from the client. After he deleted the SiriuswareNovaPDF.nvl file and re-ran the application, the COM errors went away, but the novaPDF "Save As" dialog incorrectly appeared. He sent me a copy of the NVL file which got recreated when my application instantiated the novaPDF object. Here is the contents...
Code: Select all
[Default Profile]
Prompt Save Dialog = 0
File Conflict Strategy = 5
Save Advanced Strategy = 5
Post Save Open = 0
Margin Top = 5000
Margin Bottom = 5000
Margin Left = 5000
Margin Right = 5000
PDFVersion = 4
SilentPrint = 1
Save Folder = C:\DOCUMENTS AND SETTINGS\KADAMS\DESKTOP
Save File = LAKE SHIRTS.PDF
Notice that it is not a complete NVL file. It contains only the options my application explicitly set with the SetOptionLong and SetOptionString functions. When I delete my NVL file on my development machine (running 64-bit Win7 and novaPDF SDK 7.1.334), the novaPDF driver creates a new one in the same folder that is complete and prints correctly...
Code: Select all
[###SECTION_NOVA_PROFILEINFO###]
ActiveProfilePublic = 0
ActiveProfile = Default Profile
AskSaveProfile = 1
[Default Profile]
Page Form = A4
Page Orientation = 1
Page Scale = 100
Page Resolution = 300
Page Width = 210000
Page Height = 297000
Page Units = 1
Page Size = 0
Margin Left = 0
Margin Right = 0
Margin Top = 0
Margin Bottom = 0
Origin Left = 0
Origin Top = 0
Align Right Margin = 0
Align Bottom Margin = 0
Center Horizontally = 0
Center Vertically = 0
Fit Zoom to Margins = 1
Page Zoom = 100000
Calculate CropBox = 0
Custom Forms =
Standard Forms Visibility Flags = 1111111111100000000000000000000000000000000000000000
Prompt Save Dialog =0
Save Use Advanced Dialog = 1
Save Advanced Strategy = 3
File Conflict Strategy = 0
Save Use Folder Ask = 4
Save Folder =
Save File = [N]
Save Folder Ask =
Save File Ask = [N]
Save Local = 1
Save File Password =
Save Advanced Password =
Save Allow Change Folder = 1
Save Net User Name =
Save Net Password =
Document Author = <Default>
Document Creator = <Default>
Document Keywords =
Document Subject =
Document Title = <Default>
Document Page Layout = 1
Document Page Scaling = 0
Document Page Mode = 0
Document Page Number = 1
Document Use Page Number = 0
Document Page Magnification = 0
Document Magnification Percent = 100
Document Creation Day = 0
Document Creation Hour = 0
Document Creation Minute = 0
Document Creation Month = 0
Document Creation Second = 0
Document Creation Year = 0
Document Modify Day = 0
Document Modify Hour = 0
Document Modify Minute = 0
Document Modify Month = 0
Document Modify Second = 0
Document Modify Year = 0
Post Save Open = 1
Use Default Viewer = 1
Action Application =
Action Arguments = %1
Action Net User Name =
Action Net Password =
Use Text Compression = 1
Text Compression Method = 0
Text Compression Level = 5
Use Image Compression = 1
Image Compression Method = 0
Image Compression Level = 77
Use Indexed Image Compression = 1
Indexed Compression Method = 0
Indexed Compression Level = 5
Use Monochrome Image Compression = 1
Monochrome Compression Method = 0
Monochrome Compression Level = 5
Image Optimization = 0
Correct Line Widths = 0
Correct Fill Colors = 0
Ignore Empty Pages = 0
Optimize Text = 1
Embed All Fonts = 0
Embed Font Subset = 1
Force Embed Protected = 0
Always Embed Fonts List =
Never Embed Fonts List = Arial;Courier;Times New Roman;
Use Embed Fonts List = 0
Use Never Embed Fonts List = 1
Downsample High Color Img = 0
Downsample High Color Img DPI = 96
Downsample High Color Img Type = 3
Downsample Indexed Img = 0
Downsample Indexed Img DPI = 96
Downsample Indexed Img Type = 3
Downsample Monochrome Img = 0
Downsample Monochrome Img DPI = 96
Downsample Monochrome Img Type = 3
Convert High Color Img = 0
Convert Indexed Img = 0
Convert High Color Img Type = 0
Dither High Color Img = 1
Dither High Color Img Method = 0
Convert Indexed Img Type = 0
Dither Indexed Img = 1
Dither Indexed Img Method = 0
Convert Text and Graphics = 0
Convert Text and Graphics Type = 0
Convert Monochrome Text Trashold = 128
Convert High Color Img Trashold = 128
Convert Indexed Img Trashold = 128
Graphics Configuration = 0
Enable Watermarks = 0
Number of Text Watermarks = 0
Number of Image Watermarks = 0
AnalyzeUrl = 1
DetectFiles = 0
CheckFileExists = 0
BorderType = 0
BorderStyle = 0
BorderWidth = 1000
BorderColor = 13369344
UseLinkColor = 0
Bookmarks Detection Enabled = 0
Bookmarks Allow Multi-Line = 0
Bookmarks Match Nodes Regardless of Level = 0
Bookmarks Number of Levels to Consider = 0
Bookmarks Open up to Level = 0
Bookmark Items Number = 0
User Password =
Owner Password =
AllowAnnotForms = 0
AllowCopyExtract = 0
AllowExtractRev3 = 0
AllowFillFormsRev3 = 0
AllowModify = 0
AllowModPagesRev3 = 0
AllowPrint = 0
AllowPrintRev3 = 0
Level = 0
Send Email = 0
Email Type = 0
Email Compress PDF = 0
Email To Address =
Email CC Address =
Email BCC Address =
Email Subject =
Email Body =
Email From Address =
Email SMTP Server =
Email SMTP Port = 25
Email SMTP User =
Email SMTP Authentification = 0
Email SMTP SSL = 0
Email Lookup Address = 1
Email SMTP Password =
Email Delete PDF = 0
Enable Overlay = 0
Overlay File Name =
Overlay Password =
Overlay Net User Name =
Overlay Net Password =
Overlay Repeat Type = 0
Overlay File As Background = 1
Overlay Fit To Margins = 1
Overlay Margin Left = 0
Overlay Margin Right = 0
Overlay Margin Top = 0
Overlay Margin Bottom = 0
Overlay Center Horizontally = 0
Overlay Center Vertically = 0
Overlay Align Right = 0
Overlay Align Bottom = 0
Overlay Origin Left = 0
Overlay Origin Top = 0
Overlay Zoom = 100000
Enable Signatures = 0
Signature Certificate Type = 1
Signature Cert IssuedBy =
Signature Cert IssuedTo =
Signature Cert Subject =
Signature Cert Expire Year = 0
Signature Cert Expire Month = 0
Signature Cert Expire Day = 0
Signature Cert Expire Hour = 0
Signature Cert Expire Minute = 0
Signature File Name =
Signature Cert Password =
Signature Cert Net User =
Signature Cert Net Password =
Signature Sign On = 0
Signature Sign Page = 1
Signature Width = 177000
Signature Height = 50000
Signature Rotation = 0
Signature Show Graphic Name = 1
Signature Show Graphic Image = 0
Signature Image File Name =
Signature Image Net User =
Signature Image Net Password =
Signature Image Keep Ratio = 1
Signature Image Opacity = 100
Signature Name Opacity = 100
Signature Font Color = 0
Signature Show Name = 0
Signature Show Date = 0
Signature Show Location = 0
Signature Show Reason = 0
Signature Show Labels = 0
Signature Show Dist Name = 1
Signature Show Contact Info = 0
Signature Use Font Size = 0
Signature Font Size = 8
Signature Reason =
Signature Location =
Signature Contact Info =
Signature Center Horizontally = 0
Signature Center Vertically = 0
Signature Align Right = 1
Signature Align Bottom = 1
Signature Origin Left = 0
Signature Origin Top = 0
Signature Visible View = 1
Signature Visible Print = 1
Signature Visible Export = 1
OverridePaper = 0
TemporaryProfile = 0
PDFVersion = 5
PDFA1BCompliant = 0
AllowChangeProfile = 0
SilentPrint = 0
PublicProfile = 0
So, it is as if the novaPDF driver on the WinXP machine is using 2 different NVL files or the NVL is not created correctly when instantiated? I still don't know what happened in the first place to cause the COM errors on that client's machine. We also have a second client which is now reporting the same COM error and I'm awaiting more information from them. I am trying to get a copy of an NVL file which gives a client the COM error so I can see exactly what the corruption is. This is our first rollout of our applications with novaPDF and these problems have me extremely concerned as you can imagine.
Re: COM errors when setting options to default profile
Posted: Wed May 25, 2011 6:07 pm
by jtappero
Just a small correction. The client is running Windows XP (SP3) and the installed novaPDF driver is 7.4, not 7.3. That was installed using the silent installer utility. Thanks.
Re: COM errors when setting options to default profile
Posted: Thu May 26, 2011 8:11 am
by Claudiu (Softland)
Hello,
We will contact you shortly for further troubleshooting at the e-mail address you have used to create this account on the forum.
Please confirm the mail address is the correct one we should use.
Thank you.
Re: COM errors when setting options to default profile
Posted: Fri May 27, 2011 9:13 pm
by jtappero
Thank you. I have some more information from one of our clients (3 other clients are experiencing these same errors). This client is a pretty capable IT person and is assisting me in troubleshooting this problem. Here is what he said and hopefully is will be useful information. A big clue to the error I highlighted in red...
“I have figured out how to temporarily fix this problem and where the bug exists within the software.
If I copy a working SiriuswareNovaPDF.nvl file into the %appdata%\softland\novapdf folder, the user can then create PDFs successfully. It seems as though the code (I guess it is the novaPDF driver?) that creates a new .nvl file does not create a successful one but the installation of the novaPDF silent installer does. This meant that the user under which the silent installer was installed could successfully create PDFs but as other users logged in and tried to create one at application runtime, the .nvl file that was created for them would not work. I have verified it on XP and 7.
I have given my users a batch file that copies the correct .nvl file to their appdata folder but it is a temporary fix. I have two examples of files below, one is what we see when the pdf printing job works and the other is what we see when it doesn’t.”
Here is the working nvl file...
Code: Select all
[###SECTION_NOVA_PROFILEINFO###]
ActiveProfilePublic = 0
ActiveProfile = Default Profile
AskSaveProfile = 1
[Default Profile]
Page Form = Letter
Page Orientation = 1
Page Scale = 100
Page Resolution = 300
Page Width = 215900
Page Height = 279400
Page Units = 1
Page Size = 1
Margin Left = 0
Margin Right = 0
Margin Top = 0
Margin Bottom = 0
Origin Left = 0
Origin Top = 0
Align Right Margin = 0
Align Bottom Margin = 0
Center Horizontally = 0
Center Vertically = 0
Fit Zoom to Margins = 1
Page Zoom = 100000
Calculate CropBox = 0
Custom Forms =
Standard Forms Visibility Flags = 1111111111100000000000000000000000000000000000000000
Prompt Save Dialog = 0
Save Use Advanced Dialog = 0
Save Advanced Strategy = 5
File Conflict Strategy = 5
Save Use Folder Ask = 4
Save Folder = C:\ProgramData\Siriusware\Sales\PDF
Save File = Res#23480210002011-05-26 12.47.06.pdf
Save Folder Ask =
Save File Ask = [N]
Save Local = 1
Save File Password =
Save Advanced Password =
Save Allow Change Folder = 1
Save Net User Name =
Save Net Password =
Document Author = <Default>
Document Creator = <Default>
Document Keywords =
Document Subject =
Document Title = <Default>
Document Page Layout = 1
Document Page Scaling = 0
Document Page Mode = 0
Document Page Number = 1
Document Use Page Number = 0
Document Page Magnification = 0
Document Magnification Percent = 100
Document Creation Day = 0
Document Creation Hour = 0
Document Creation Minute = 0
Document Creation Month = 0
Document Creation Second = 0
Document Creation Year = 0
Document Modify Day = 0
Document Modify Hour = 0
Document Modify Minute = 0
Document Modify Month = 0
Document Modify Second = 0
Document Modify Year = 0
Post Save Open = 0
Use Default Viewer = 0
Action Application =
Action Arguments = %1
Action Net User Name =
Action Net Password =
Use Text Compression = 1
Text Compression Method = 0
Text Compression Level = 5
Use Image Compression = 1
Image Compression Method = 1
Image Compression Level = 77
Use Indexed Image Compression = 1
Indexed Compression Method = 0
Indexed Compression Level = 5
Use Monochrome Image Compression = 1
Monochrome Compression Method = 0
Monochrome Compression Level = 5
Image Optimization = 0
Correct Line Widths = 0
Correct Fill Colors = 0
Ignore Empty Pages = 0
Optimize Text = 1
Embed All Fonts = 1
Embed Font Subset = 1
Force Embed Protected = 0
Always Embed Fonts List =
Never Embed Fonts List = Arial;Courier;Times New Roman;
Use Embed Fonts List = 0
Use Never Embed Fonts List = 1
Downsample High Color Img = 0
Downsample High Color Img DPI = 96
Downsample High Color Img Type = 3
Downsample Indexed Img = 0
Downsample Indexed Img DPI = 96
Downsample Indexed Img Type = 3
Downsample Monochrome Img = 0
Downsample Monochrome Img DPI = 96
Downsample Monochrome Img Type = 3
Convert High Color Img = 0
Convert Indexed Img = 0
Convert High Color Img Type = 0
Dither High Color Img = 1
Dither High Color Img Method = 0
Convert Indexed Img Type = 0
Dither Indexed Img = 1
Dither Indexed Img Method = 0
Convert Text and Graphics = 0
Convert Text and Graphics Type = 0
Convert Monochrome Text Trashold = 128
Convert High Color Img Trashold = 128
Convert Indexed Img Trashold = 128
Graphics Configuration = 0
Enable Watermarks = 0
Number of Text Watermarks = 0
Number of Image Watermarks = 0
AnalyzeUrl = 1
DetectFiles = 0
CheckFileExists = 0
BorderType = 0
BorderStyle = 0
BorderWidth = 1000
BorderColor = 13369344
UseLinkColor = 0
Bookmarks Detection Enabled = 0
Bookmarks Allow Multi-Line = 0
Bookmarks Match Nodes Regardless of Level = 0
Bookmarks Number of Levels to Consider = 0
Bookmarks Open up to Level = 0
Bookmarks Add Root = 0
Bookmarks Root Name = [T]
Bookmarks Display Root Bold = 0
Bookmarks Display Root Italic = 0
Bookmarks Display Root Color = 0
Bookmark Items Number = 0
User Password =
Owner Password =
AllowAnnotForms = 0
AllowCopyExtract = 0
AllowExtractRev3 = 0
AllowFillFormsRev3 = 0
AllowModify = 0
AllowModPagesRev3 = 0
AllowPrint = 0
AllowPrintRev3 = 0
Level = 0
Send Email = 0
Email Type = 0
Email Compress PDF = 0
Email To Address =
Email CC Address =
Email BCC Address =
Email Subject =
Email Body =
Email From Address =
Email SMTP Server =
Email SMTP Port = 25
Email SMTP User =
Email SMTP Authentification = 0
Email SMTP SSL = 0
Email Lookup Address = 1
Email SMTP Password =
Email Delete PDF = 0
Email Attach PDF = 1
Email Attach Other = 0
Email Change Zip Extension = 0
Email Other Attachment =
Email Change Extensions = txt
Email Change To Extension =
Enable Overlay = 0
Overlay File Name =
Overlay Password =
Overlay Net User Name =
Overlay Net Password =
Overlay Repeat Type = 0
Overlay File As Background = 1
Overlay Fit To Margins = 1
Overlay Margin Left = 0
Overlay Margin Right = 0
Overlay Margin Top = 0
Overlay Margin Bottom = 0
Overlay Center Horizontally = 0
Overlay Center Vertically = 0
Overlay Align Right = 0
Overlay Align Bottom = 0
Overlay Origin Left = 0
Overlay Origin Top = 0
Overlay Zoom = 100000
Enable Signatures = 0
Signature Certificate Type = 1
Signature Cert IssuedBy =
Signature Cert IssuedTo =
Signature Cert Subject =
Signature Cert Expire Year = 0
Signature Cert Expire Month = 0
Signature Cert Expire Day = 0
Signature Cert Expire Hour = 0
Signature Cert Expire Minute = 0
Signature File Name =
Signature Cert Password =
Signature Cert Net User =
Signature Cert Net Password =
Signature Sign On = 0
Signature Sign Page = 1
Signature Width = 177000
Signature Height = 50000
Signature Rotation = 0
Signature Show Graphic Name = 1
Signature Show Graphic Image = 0
Signature Image File Name =
Signature Image Net User =
Signature Image Net Password =
Signature Image Keep Ratio = 1
Signature Image Opacity = 100
Signature Name Opacity = 100
Signature Font Color = 0
Signature Show Name = 0
Signature Show Date = 0
Signature Show Location = 0
Signature Show Reason = 0
Signature Show Labels = 0
Signature Show Dist Name = 1
Signature Show Contact Info = 0
Signature Use Font Size = 0
Signature Font Size = 8
Signature Reason =
Signature Location =
Signature Contact Info =
Signature Center Horizontally = 0
Signature Center Vertically = 0
Signature Align Right = 1
Signature Align Bottom = 1
Signature Origin Left = 0
Signature Origin Top = 0
Signature Visible View = 1
Signature Visible Print = 1
Signature Visible Export = 1
OverridePaper = 0
TemporaryProfile = 0
PDFVersion = 4
PDFA1BCompliant = 0
AllowChangeProfile = 0
SilentPrint = 1
PublicProfile = 0
Here is the broken nvl file...
Code: Select all
[Default Profile]
Prompt Save Dialog = 0
File Conflict Strategy = 5
Save Advanced Strategy = 5
Post Save Open = 0
Margin Top = 0
Margin Bottom = 0
Margin Left = 0
Margin Right = 0
PDFVersion = 4
SilentPrint = 1
Embed All Fonts = 1
Save Folder = C:\ProgramData\Siriusware\Sales\PDF
Save File = Res#46180060002011-05-26 12.32.30.pdf
Re: COM errors when setting options to default profile
Posted: Mon May 30, 2011 11:55 am
by Claudiu (Softland)
Hello,
The file "<printer name>.nvl" is created by novaPDF printer driver in the user's application data folder. If the file is not created it means that the printer driver does not have rights to create this file for the currently logged in user. novaPDF setup runs with administrator rights, and the nvl file is created when installing novaPDF for the user under which the setup is run. But for the other users that log in the computer, novaPDF printer driver will run the logged in user context.
The "broken nvl file" contains only the settings made from COM, so your application application seems to have rights to write in this folder, but novaPDF printer driver has not.
For a standard Windows installation this is working, there are no restrictions for the printer. On the computer where this happens there are probably defined some security restrictions for users that prevents novaPDF to work properly.
Thank you.
Re: COM errors when setting options to default profile
Posted: Mon May 30, 2011 3:42 pm
by jtappero
Support wrote:Hello,
The file "<printer name>.nvl" is created by novaPDF printer driver in the user's application data folder. If the file is not created it means that the printer driver does not have rights to create this file for the currently logged in user. novaPDF setup runs with administrator rights, and the nvl file is created when installing novaPDF for the user under which the setup is run. But for the other users that log in the computer, novaPDF printer driver will run the logged in user context.
The "broken nvl file" contains only the settings made from COM, so your application application seems to have rights to write in this folder, but novaPDF printer driver has not.
For a standard Windows installation this is working, there are no restrictions for the printer. On the computer where this happens there are probably defined some security restrictions for users that prevents novaPDF to work properly.
Thank you.
This beta rollout of our application is the first version which uses novaPDF and we now have several beta clients reporting this same problem. Everything our clients told us is they did in fact a "standard Windows installation" as you put it. They did not change any security for users on these PCs, except to create non-administrator users for which our application runs under. These user accounts should have standard Windows rights to their own appdata folder. Why your novaPDF driver cannot write to this folder, but your COM methods can, seems odd and frankly sounds like a bug in the driver. Please help us figure this out. If it is in fact a security issue, it is not because our clients did anything special beyond a standard Windows installation. The novaPDF driver was installed with your silent installer.
We have several hundred more clients awaiting this upgrade after the beta period, and we are now in a panic that PDF printing will fail all over the place and are starting to regret our decision to go with your product. Any help you can give us would be most appreciated. Thanks.