LockW and SetDocFileProps does not work with certain chars

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

LockW and SetDocFileProps does not work with certain chars

Post by Aldus@Monitor »

Hi!

LockW/UnlockW/SetDocFileProps does not work with certain characters (during Excel export):
If the print name is "Report 1/2" you will get the following:
  • Set output filename to "c:\temp\Report.pdf" by SetDocFileProps(PDFPrinter, ls_doctitle, NoPrompt + UseFileName, is_default_directory, ls_filename)
  • be prompted with a file dialog for the PDF-filename (eventhou you have already set this by code)
    Filename suggested is: "Report 1_2.pdf" (probably from print job title which is "Report 1/2" but with the slash replaced with underscore)
  • You get the following lock registry key : "DOC_Report 1/2" (which seems correct)
  • If you accept that file name you will end up with "Report 1_2.xls" and not "Report.xls"
  • If you change to Report.pdf you will end up with the correct "Report.xls".
This only happens with some special characters like the slash. Seams to be a bug with LockW and UnlockW and SetDocFileProps.

When can this problem be fixed? Any workaround?

Regards
Aldus@Monitor
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Re: LockW and SetDocFileProps does not work with certain chars

Post by Jose »

Hello,

The Amyuni “SaveAs” dialog box is generated when an incorrect document title is passed to the Lock() function of the PDF Converter. The document name gets generated by the printing application and it is passed to the printer spooler. The Amyuni PDF Converter replaces certain characters by “_” (underscores) and uses this document name to temporally lock the system registry.

Example: In your case the "/" character is not a valid character for a filename and this is why it is being replaced by “_” (underscores).

Hope this helps?
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: LockW and SetDocFileProps does not work with certain chars

Post by Aldus@Monitor »

Hello again!

I am afraid this does not help. We are clearly passing a correct filename "Report.pdf" (via SetDocFileProps) and for the spooler (which accepts any Unicode characters) we have "Report 1/2" as print job name.
"Report 1/2" is not a valid filename but it is a valid Document Title and a valid printer job name.
The LockW function correctly sets the lock-name to "DOC_Report 1/2" in the registry.

The bug is that the File dialog pops up for wrong "Lock-name" instead of a wrong filename! I think someone internally mixed up the Filename and LockName when checking the intermediate PDF filename.
If I use "Report_12" as Document title and choose "Report.pdf" as the filename I will end up with "Report.xls" when the final Excel stage is done which is correct. (If the document title was used as filename instead I would end up with "Report_12.xls" and this does not happen.)

Regards
Aldus@Monitor
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: LockW and SetDocFileProps does not work with certain chars

Post by Aldus@Monitor »

Hello again,

We would be very pleased if you could confirm this bug with the DevTeam and maybe give us a time-frame on fixing the problem.
Can a fix be included in 5.0.0.7?

With kind regards
Aldus@Monitor
Aldus@Monitor
Posts: 28
Joined: Thu Apr 05 2012
Location: Sweden

Re: LockW and SetDocFileProps does not work with certain chars

Post by Aldus@Monitor »

Any news of when this problem can be fixed?

With regards
Aldus@Monitor
Post Reply