简体   繁体   中英

Generate a pdf from a pdf “template” in Meteor

I'm looking to generate a pdf from an existing pdf "template". For example, the pdf "template" would have the, text, fields, and layout -- all that would be left to do is fill in "fields" with data.

I would like to populate these fields with the appropriate data from a mongo collection, and generate a new pdf from it.

I am looking at the pascoual/meteor-pdfkit package, but I only read about how to generate a pdf from scratch. Also, I reviewed http://pdfkit.org/ but found no examples of my approach.

Is the above possible with an existing meteor pdf package? What's the best way to go about this?

For example, the following is part of a pdf document, the "fields" need to be populated with data I get from a collection: 在此处输入图片说明

UPDATE: I'm looking into using pdftk server: https://www.pdflabs.com/tools/pdftk-server/ (the command line) to do form fill pdf (fdf). This seems to do what I want, and runs on all platforms.

Ended up using FDFs (actually XFDFs) to do the PDF form fills. PDFtk server was the tool I ended up using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM