Hi!
I am trying to change word documents to PDF by changing the active printer to the PDF Creator one. It works fine, but I have to deal with the options programatically because in some cases I want the PDF to be shown and in some cases I want it to be just saved as a file. This is the code that is supposed to do this:
CREATE "PDFCreator.clsPDFCreator" hPDFJob.
/*IF hPDFJob:cStart('/NoProcessingAtStartup',-1) = 0 THEN DO:
MESSAGE "error"
VIEW-AS ALERT-BOX ERROR TITLE CURRENT-WINDOW:TITLE.
RELEASE OBJECT hPDFJob NO-ERROR.
RETURN.
END. */
ASSIGN hPDFJob:cOption("UseAutosave") = 1
hPDFJob:cOption("AutoSaveFormat") = 0
hPDFJob:cOption("AutosaveStartStandardProgram") = 0
hPDFJob:cOption("AutosaveDirectory") = SESSION:TEMP-DIRECTORY
chTexto = STRING(TODAY,"99-99-9999") + STRING(TIME) + ".pdf"
hPDFJob:cOption("AutosaveFilename") = chTexto
hPDFJob:cClearCache.
RELEASE OBJECT hPDFJob NO-ERROR.
wNomAplic:ActivePrinter = "PDFCreator".
{wImpDoc.i} /* Prints out through word */
The portion of code hPDFJob:cOption("UseAutosave") = 1 should select the autosave mode and hPDFJob:cOption("AutosaveStartStandardProgram") = 0 is the responsible one to select whether the document will be opened or not after autosaving.
But none of this options set programatically seems to work and the behaviour of the PDFCreator is the standard one.
Do you know how to set this options properly?
I am using Open Edge 10.1C and PDFCreator 0.9.9.
Many thanks in advance!
I am trying to change word documents to PDF by changing the active printer to the PDF Creator one. It works fine, but I have to deal with the options programatically because in some cases I want the PDF to be shown and in some cases I want it to be just saved as a file. This is the code that is supposed to do this:
CREATE "PDFCreator.clsPDFCreator" hPDFJob.
/*IF hPDFJob:cStart('/NoProcessingAtStartup',-1) = 0 THEN DO:
MESSAGE "error"
VIEW-AS ALERT-BOX ERROR TITLE CURRENT-WINDOW:TITLE.
RELEASE OBJECT hPDFJob NO-ERROR.
RETURN.
END. */
ASSIGN hPDFJob:cOption("UseAutosave") = 1
hPDFJob:cOption("AutoSaveFormat") = 0
hPDFJob:cOption("AutosaveStartStandardProgram") = 0
hPDFJob:cOption("AutosaveDirectory") = SESSION:TEMP-DIRECTORY
chTexto = STRING(TODAY,"99-99-9999") + STRING(TIME) + ".pdf"
hPDFJob:cOption("AutosaveFilename") = chTexto
hPDFJob:cClearCache.
RELEASE OBJECT hPDFJob NO-ERROR.
wNomAplic:ActivePrinter = "PDFCreator".
{wImpDoc.i} /* Prints out through word */
The portion of code hPDFJob:cOption("UseAutosave") = 1 should select the autosave mode and hPDFJob:cOption("AutosaveStartStandardProgram") = 0 is the responsible one to select whether the document will be opened or not after autosaving.
But none of this options set programatically seems to work and the behaviour of the PDFCreator is the standard one.
Do you know how to set this options properly?
I am using Open Edge 10.1C and PDFCreator 0.9.9.
Many thanks in advance!