Hi Im' using pdfcreator with the com interface, do you know alternatives products or ways to do the same need to generate without end-user interaction Thanks Dominique
Hi Dominique, We used gs (ghostscript) and redmon (redirecction port) . If i remenber correctly : - install redmon . - install a pdf printer with driver ghostpdf.inf - Modify printer port to RPT1: - Configure RPT1 to run gs.exe: D:\gs\gs9.00\bin\gswin64c.exe @d:\gs\gs.ini -sOutputFile="%1" - - Configure Uniface to use this printer .... Gilles.
Thanks Gilles worked ok when I put an output file direct into the port configuration -sDEVICE=pdfwrite -r300 -dBATCH -dNOPAUSE -dSAFER -sPAPERSIZE=a4 -sOutputFile="testpdf.pdf" -c .setpdfwrite -f - But using %1 as variable, how do you give this variable to the printer Dominique
Hi Dominique, we implement a similar solution using MultiFilePortMonitor instead of redmon. MultiFilePortMonitor con be found on SourceForge HERE. Regards, Gianni
Hi Dominique, Sorry , we have modify redmon to add one more option (Registry Value for Filename). We put the name of the file in a registry value (HKCU) before printing and redmon read this registry value . Gilles.
Hi Dominique, using MultiFilePortMonitor a long list of options is available to define output filename; for this reason different configurations can be used depending on various needs. The simplest one is: 1) MultiFilePortMonitor port config: define output filename as %t.pdf 2) Uniface basic code: call getDefaultPrinter(myActualDefaultPrinter) call getUniqueInstanceName("componentToBePrintedToPDF", myUniqueInstanceName) call setDefaultPrinter("GhostscriptPDF") ; GhostscriptPDF is the name of the installed ghostpdf printer using port configured with MultiFilePortMonitor newinstance "componentToBePrintedToPDF", myUniqueInstanceName activate myUniqueInstanceName.exec() ; print instruction in the exec trigger is generating myUniqueInstanceName.pdf in the configured folder call reuseGeneratedPdfFile(myUniqueInstanceName.pdf, actionToBeApplied, otherParams) call setDefaultPrinter(myActualDefaultPrinter) All $status/$procerror checks after each call instruction were obviously stripped out. This solution can be either implemented on each single PC or with a shared PDF server. Hope it helps. Regards, Gianni
6 Comments
Local Administrator
Hi Dominique, We used gs (ghostscript) and redmon (redirecction port) . If i remenber correctly : - install redmon . - install a pdf printer with driver ghostpdf.inf - Modify printer port to RPT1: - Configure RPT1 to run gs.exe: D:\gs\gs9.00\bin\gswin64c.exe @d:\gs\gs.ini -sOutputFile="%1" - - Configure Uniface to use this printer .... Gilles.
Author: Gilles (gls.tools@free.fr)
Local Administrator
Thanks Gilles worked ok when I put an output file direct into the port configuration -sDEVICE=pdfwrite -r300 -dBATCH -dNOPAUSE -dSAFER -sPAPERSIZE=a4 -sOutputFile="testpdf.pdf" -c .setpdfwrite -f - But using %1 as variable, how do you give this variable to the printer Dominique
Author: mpservices (mps59@orange.fr)
Local Administrator
Hi Dominique, we implement a similar solution using MultiFilePortMonitor instead of redmon. MultiFilePortMonitor con be found on SourceForge HERE. Regards, Gianni
Author: gianni (gianni.sandigliano@unifacesolutions.com)
Local Administrator
Hi Dominique, Sorry
, we have modify redmon to add one more option (Registry Value for Filename). We put the name of the file in a registry value (HKCU) before printing and redmon read this registry value . Gilles.
Author: Gilles (gls.tools@free.fr)
Local Administrator
Thanks to both of you is it possible to have an example of the code you are using ? Dominique
Author: mpservices (mps59@orange.fr)
Local Administrator
Hi Dominique, using MultiFilePortMonitor a long list of options is available to define output filename; for this reason different configurations can be used depending on various needs. The simplest one is: 1) MultiFilePortMonitor port config: define output filename as %t.pdf 2) Uniface basic code: call getDefaultPrinter(myActualDefaultPrinter) call getUniqueInstanceName("componentToBePrintedToPDF", myUniqueInstanceName) call setDefaultPrinter("GhostscriptPDF") ; GhostscriptPDF is the name of the installed ghostpdf printer using port configured with MultiFilePortMonitor newinstance "componentToBePrintedToPDF", myUniqueInstanceName activate myUniqueInstanceName.exec() ; print instruction in the exec trigger is generating myUniqueInstanceName.pdf in the configured folder call reuseGeneratedPdfFile(myUniqueInstanceName.pdf, actionToBeApplied, otherParams) call setDefaultPrinter(myActualDefaultPrinter) All $status/$procerror checks after each call instruction were obviously stripped out. This solution can be either implemented on each single PC or with a shared PDF server. Hope it helps. Regards, Gianni
Author: gianni (gianni.sandigliano@unifacesolutions.com)