1

I am trying to create a PDF with the pre-defined template with this particular library called PDFKIT. The server is written in Nodejs, may I know is there any good example I could refer to? What I want to achieve is to have a User Interface as an entry form, and then there is a pre-defined PDF file in-place on the server.When the user hits the submit button, the pdf rendering engine will pick-up the data and embedded into the pdf template file.

Paul Jowett
  • 6,513
  • 2
  • 24
  • 19
DavidB
  • 313
  • 1
  • 8
  • 23

2 Answers2

2

Take a look at the PSPDFKit for Web / PSPDFKit Server API docs for handling forms which let you retrieve and update all form fields. You can then use the document APIs for downloading a PDF with the form fields set to whatever values your user submitted.

So to recap, the steps are:

  1. Upload the template PDF to the server storing the document id in your database or in the user's session.
  2. Fill in the form fields using the data your user submitted.
  3. Download the PDF with the updated form fields and e.g. email it or store it somewhere.

Alternatively you can create a signed URL so that you can directly redirect your user to the generated PDF.

Martin S.
  • 556
  • 4
  • 11
0

Have you heard about PhantomJS? There is a package which name is phantom-html-to-pdf. You may give it a try.

  • I have but I can not access the repo right now but I think you can follow this page http://phantomjs.org/api/webpage/method/render.html – Murat Tüfekçi Apr 27 '18 at 13:23