I'm working with PxPlus2017eComm on Windows Server 2019 system with this client.
I generate a PDF report and email it (to internal staff). No issues. The PDF report consists of images (logos & signatures) as well as text in various fonts.
What I would like to do is take the same PDF report and hard copy print it to a local networked printer.
What's the best way to print the same PDF report to a local (Networked) printer within PxPlus?
Currently, to print the PDF I run similar program but open a networked printer and print the same report. The issue is that the PDF report may be printed to different printers and I get different (spacing) results. When I print the saved (email version) of the PDF report to different printers, output results are perfect.
TIA, Bruno@BrunoBiancucci.com
You can open the pdf then have them manually print it.
Another way is quite involved:
invoke wait "[wdx]"+quo+EXE$+quo+" /h /n /t "+quo+F$+quo ! +" "+quo+"Microsoft Print to PDF"+quo
EXE$ = executable
F$ = File
You need the EXE for acrobat reader may be able to read registry. Or can set executable manually.
check for executable
let CC=unt; open (CC,err=*next)"[wdx]C:\program Files\Adobe\Acrobat DC\Acrobat"; close (CC); let EXE$="C:\program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe";
I think you should try to fix the print (OUT) of your report. Are you sure you have the correct sequence of 'DF' mneumonics, you should be able to get them to match.
print (REP)'font'("Arial",-12),'DF','cpi'(10),'lpi'(6),
SYSTEM_HELP PRINT "pdffile" should work.
Thanks for that SYSTEM_HELP PRINT. I never knew of this neat PDF print trick interesting... Interesting it used my adobe printer default rather than windows printer. I'll have to play with this some more.
EDIT: This simulates right clicking pdf and selecting print
I use SumatraPDF to print pdf files to a printer. Create the pdf on the server and copy it to the client, print it like this:
LET sumatra_exe$="""C:\PVX Plus Technologies\SumatraPDF\SumatraPDF.exe"""
LET sumatra_cmd$=sumatra_exe$+" -print-to """+printer$+""" -print-settings """+STR(copies)+"x"" """+pdf_client$+""""
INVOKE HIDE "[LCL]cmd.exe /C """+sumatra_cmd$+""""
For more options: https://www.sumatrapdfreader.org/docs/Command-line-arguments
I personnally use 2 methods:
1- If the document is created from PVX, instead of creating a PDF, I write to the printer channel via "*WINPRT*"
2- If the printer is already built and just want to print it, I use a little program installed on the client machine or on the server (in your case your are printing from the server directly) called PDFtoPrinter and would call it from command line:
invoke hide "[lcl]c:\pathtoprogram\PDFtoPrinter.exe "+quo+FileName$+quo+" "+quo+PrinterInfo$+quo
Obviously, for either methods I need a database to keep the printers configuration for each workstations. For example, you could need to print to printer1 for invoices, but print to printer2 for purchase orders.