Output Filename Changes

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
Scharbach
Posts: 6
Joined: Tue Nov 07 2006

Output Filename Changes

Post by Scharbach »

I am having problems writing to a single output file in a Citrix environment. I am concatenating MS Word and Excel files to a single PDF file. The problem seems to be isolated to the Word documents. The output file layout is created inside a loop, with the following order of documents: Word, Excel, Excel, Word, and Word. Below is the sample of code that I am using in the Word section and comments about the underlying environment.

Code: Select all

goWord.Documents.Open FileName:=sSourceFile, ConfirmConversions:=False
goWord.Options.PrintBackground = False
goWord.ActivePrinter = PDFPRINTERNAME

lRetVal = gPDFPrinter.Lock(sSourceFileName)	‘--  Returns 0

lRetVal = gPDFPrinter.SetDocFileProps(sSourceFileName, _
                                      NoPrompt + UseFileName + EmbedFonts + Concatenate, _
                                      "", _
                                      sOutputFileName)	‘--  Returns 0
goPDFPrinter.EnablePrinter LICENSEDTO, ACTIVATIONCODE
HKEY_CURRENT_CONFIG\Software\Amyuni Document Converter\GeneratedFile value is equal to sOutputFileName

Code: Select all

goWord.ActiveDocument.PrintOut Background:=False, Range:=wdPrintAllDocument
HKEY_CURRENT_CONFIG\Software\Amyuni Document Converter\GeneratedFile value is changed to sSourceFileName after the user is prompted with the dialog box titled “Output File Name”. This dialog box has a checkbox on it titled “Concatenate”.
Scharbach
Posts: 6
Joined: Tue Nov 07 2006

Post by Scharbach »

I believe this is a timing issue. If I run the Process Monitor in the background to capture system activity I don't get the Output File Name dialog box, but if I turn capture off the dialog box is displayed.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please check what is the value of NoPrompt+UseFileName+FontEmbedding+Concatenate. it shoujld be 23 decimal.

Also please note that sSourceFileName should be the print job name as it appears in the printers folder for each print job.

Hope this helps.

Joanna
Scharbach
Posts: 6
Joined: Tue Nov 07 2006

Post by Scharbach »

Joan,

Then FileNameOptions are set to decimal 23 and the sSourceFilename is what appears in the printers folder when I set the Printer to pause. Also, the sOutputFileName is the fully qualified path and filename of the output PDF.


Is there anything else I could be missing :?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

You are printing different office files to the PDF Printer, please check the following:

1 - sSourceFilename is changed each time a different document is printed to the printer.

2 - is the selection of the office documents done programmatically or the user decides on which documents he or she wants to print?

3 - If this is a timing issue it would be solved by calling EnablePrinter when cathing the EnablePre event fired by the driver.
Scharbach
Posts: 6
Joined: Tue Nov 07 2006

Post by Scharbach »

1. The sSourceFilename is changed for each office document by calling the SetFileDocProps method.

2. The end user is presented with a listview of all the available office documents to assemble in the <OutputFileName>.pdf and once they select the desired documents, the program begins a loop to start opening, printing, and closing those documents thru code.

3. We are using the .dll interface of the control in a code module and are unable to drop the activeX object onto it. This is only available with the form object, so we are therefore unable to capture events. If I understand the documentation correctly, by setting the CaptureEvents property to true will cause the PDF control to broadcast messages to all active PDF controls on the network. This could potentialy be over 100 controls sending their messages to all 100+ controls. This is a lot of traffice and could cause performance degredation for the application and network.


Could the PDF control have problems communicating correctly with the word object model under a Citrix environment? I ask this question because the excel objects are successfully printed to the <OutputFileName>.pdf in the Citrix environment and the word objects are successfully printed when ouside of the Citrix environment.
Post Reply