You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating system and its version: Arch Linux ca. 2019-02-08
PDF.js version: pdfjs-dist 2.0.943
Is a browser extension: No
I looked into using pdf.js for writing a program that takes a PDF with empty form fields, fills in the fields with values from a CSV file, and prints it into another PDF file [*] with now-unchangeable fields. (Not attaching the PDF as it's a template for tax receipts.)
[*] The Node canvas based on cairo, as demonstrated in your pdf2png example, crashes on me when I try to switch it to a PDF canvas, but that's a different issue and may eventually be solvable somehow.
My current hacky bash script is using pdftk, approximately like this (I'd like to replace it so I don't have to redistribute pdftk):
However, I can't find functionality to programmatically set the fieldValue like with the mentioned FDF - after loading, before printing - so that the rendered canvas primitives would include the filled-in text. I saw that annotation layers are a thing, but that appears to be based on HTML divs and may thus open a whole other can of worms.
Is my use case something that's in scope for pdf.js, and what's missing to make it happen?
The text was updated successfully, but these errors were encountered:
Closing since this is a duplicate of #7613. Basically, we are looking into adding support for this, but it doesn't exist yet and it's also not a high priority since PDF.js is mainly a reader.
Configuration:
I looked into using pdf.js for writing a program that takes a PDF with empty form fields, fills in the fields with values from a CSV file, and prints it into another PDF file [*] with now-unchangeable fields. (Not attaching the PDF as it's a template for tax receipts.)
[*] The Node canvas based on cairo, as demonstrated in your pdf2png example, crashes on me when I try to switch it to a PDF canvas, but that's a different issue and may eventually be solvable somehow.
My current hacky bash script is using pdftk, approximately like this (I'd like to replace it so I don't have to redistribute pdftk):
pdf.js gives me
page.getAnnotations()
which shows me a nice list of all my fields:However, I can't find functionality to programmatically set the
fieldValue
like with the mentioned FDF - after loading, before printing - so that the rendered canvas primitives would include the filled-in text. I saw that annotation layers are a thing, but that appears to be based on HTML divs and may thus open a whole other can of worms.Is my use case something that's in scope for pdf.js, and what's missing to make it happen?
The text was updated successfully, but these errors were encountered: