Re: Printing Excel Document to PDF from 4D - Windows
The best PDF generation I have found is using Chrome headless via Puppeteer (https://developers.google.com/web/tools/puppeteer). For most reports, I generate a single source document in HTML that works with web browsers, Excel, and PDF. Since you are already generating Excel documents, perhaps Excel -> HTML -> Puppeteer/PDF might be an option. I guess it all depends on Excel automation options. I have not done much on that end other than asking Excel to open HTML documents. Side note: 4D 18 includes some nice Zip commands. If you are willing to slog through a lot of details, 4D 18 can create Excel files using the XML and Zip commands without any plugins. John DeSoi, Ph.D. > On Feb 21, 2020, at 4:18 PM, rooftop99--- via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > From within 4D, programmatically I need to grab an existing Excel document > and print it to PDF… (or “magically" transform it to PDF, if that option is > available.) > > We create Excel documents from 4D using Rob Laveaux’s powerful XL Plugin. We > print PDFs in 4D using the plugin: 4D PDF Printer. We now want to > automatically create both Excel and PDFs of the same data using the same > format. Rather than building two processes (forms, methods, etc) to handle > each flavor of a report, I would like to create and save the Excel doc first > then use that doc to create a PDF…. Anyone doing this or have ideas on how > this could be done? ** 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 **
Re: Printing Excel Document to PDF from 4D - Windows
if speed id not an issue, libreoffice headless mode generates the best pdf. otherwise you could script excel to export pdf but timing is a bit tricky and you need to account for sandboxing on mac. different versions of excel behave differently, so that is an issue too. quicklook on mac is also capable of performing the conversion but rendering is not as robust as libreoffice. there are tonnes of other solutions if you google. but the fact that there seems to be no definitive solutions is kind of telling. ** 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 **
Printing Excel Document to PDF from 4D - Windows
Hi All, system: 4D v16, All Windows Client/Server From within 4D, programmatically I need to grab an existing Excel document and print it to PDF… (or “magically" transform it to PDF, if that option is available.) We create Excel documents from 4D using Rob Laveaux’s powerful XL Plugin. We print PDFs in 4D using the plugin: 4D PDF Printer. We now want to automatically create both Excel and PDFs of the same data using the same format. Rather than building two processes (forms, methods, etc) to handle each flavor of a report, I would like to create and save the Excel doc first then use that doc to create a PDF…. Anyone doing this or have ideas on how this could be done? Thanks in advance! Kirk ** 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 **