This is what I do: SET CURRENT PRINTER(<>FormPrinter) ` where <>FormPrinter is "Microsoft Print to PDF" SET PRINT OPTION(Destination option;2;$FileName) SET PRINT OPTION(Orientation option;2)
Then, I just print. To print a patient chart, I open a print job, and print forms, images, PDF’s by page, 4D Write letters, then close the print job. All ends up in one PDF. For 4D Write letters, $Area:=WR New offscreen area WR PICTURE TO AREA ($Area;[LettersSent]Letter_) WR PRINT ($Area) WR DELETE OFFSCREEN AREA ($Area) > On Mar 1, 2019, at 9:01 AM, Bill Hutten via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Hi all - Apologies in advance - if this has been discussed and I'm just > missing it, please point me to the archives. > > I need to print 4D Write docs (not 4D Write Pro), on Windows 10, to PDF, > using the built-in "Microsoft Print to PDF" printer. This is the code I > curently have, cobbled togeather from various sources: > > SET CURRENT PRINTER("Microsoft Print to PDF") > SET PRINT OPTION(Spooler document name option;$fname) > SET PRINT OPTION(Destination option;2;$path) > WR SET PRINT OPTION ($area;wr spooler document name option;$fname) > WR SET PRINT OPTION ($area;wr destination option;wr send to file;0;$path) > OPEN PRINTING JOB > WR PRINT ($area;0;1) > CLOSE PRINTING JOB > > It works, in that a PDF is created, with the right $fname, at the right > $path. It doesn't work, in that the PDF is 0 bytes in size. > > > Anyone have tested code that solves this problem? > > - bill > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ********************************************************************** _________________________________________ Bob McKeever http://www.mswl.com <http://www.mswl.com/> McKeever's Software Wizardry Port Coquitlam, B.C. bobmckee...@mac.com ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************