Hi All

Anyone using PDFCreator to produce a PDF File from within a VFP
application.

I am using the following Code to create a pdf from Excel.

pdfjob = ""
pdfjob = Createobject("PDFCreator.clsPDFCreator")
pdfjob.cOption("UseAutosave") = 1
pdfjob.cOption("UseAutosaveDirectory") = 1
pdfjob.cOption("AutosaveDirectory") = "C:\PurchaseOrders\PDFs\"
pdfjob.cOption("AutosaveFilename") = lcFileName && Current Excel
Workbook saved file name
pdfjob.cOption("SaveFilename") = "C:\PurchaseOrders\PDFs\" +
Alltrim(lcFileName)
pdfjob.cOption("AutosaveFormat") = 0  && save as pdf
pdfjob.cClearCache
oleExcel.ActiveSheet.PrintOut(,,1,.F.,"PDFCreator on NE00:",,.T.,) &&
Print current Excel file to "C:\PurchaseOrders\PDFs\" using The Excel
Saved Filename

This code saves a PDF OK but prompts for the File Name and folder to
save it.  Then shows a preview of the file in Adobe.

I want to avoid the save dialogues and the preview from appearing.

After some research I replaced some of the code with code below

*!*     oPDFoptions = pdfJob.cOptions
*!*     oPDFoptions.UseAutosave(1)
*!*     oPDFoptions.UseAutosaveDirectory(1)
*!*     oPDFoptions.AutosaveFilename(lcFileName)
*!*     oPDFoptions.AutosaveDirectory("C:\PurchaseOrders\PDFs\")
*!*     oPDFoptions.AutosaveFormat(0)
*!*     pdfjob.cOptions(oPDFoptions)
*!*     pdfjob.cSaveOptions()

This did not work at all although it did prevent the dialog and preview
showing.

I next looked at the registry and found under
HKEY_CURRENT_USER/Software/PDFCreator/Program
all the settings I wanted so after stopping the code in the debugger at
the last line
oleExcel.ActiveSheet.PrintOut(,,1,.F.,"PDFCreator on NE00:",,.T.,)
I manually change the registry Keys then ran the last line.  This works
as required.
I then used the registry class to change the registry settings from the
application and again it works as required.

Question: Does anyone know the correct syntax to get PDFCreator to work
without hacking the registry

TIA

Peter Hart
Peter Hart Computers



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to