-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
placeholder-pdfkit stops the pdf stream emitting the "end" event #240
Comments
Hi, |
I managed to get this working with pdfkit 0.14.0 by removing the While I am getting signed pdf-s out of it, I don't currently understand what's happening well enough to recommend this solution to others (hence no PR). It would be good if someone who knows the system could have a looks to see why this worked |
I'm actually using I guess that pdfkit no longer needs the |
We just don't have a pdfkit example. We have the pdfkit010 ones and I'm guessing that's what @Dmitrijs-Sakovics here based his example on. The pdfkit010 is obviously a legacy one so... yes, an example using pdfkit > 10 is needed. |
Yes, my attempts were based on the pdfkit010 example since the pdfkit >0.10 helper readme states "This works in an identical way to the pdfkit010 package and the pdfkit010.js example is still relevant." |
Describe the bug and the expected behaviour
Using a very slightly modified example based on
packages\examples\src\pdfkit010.js
to create a signed pdf (code below, calling the function from an external file)The program is not throwing any errors, but gets stuck waiting for the
pdfReady
promise to resolve. thepdf
stream emits the "data" event 59 times, but does not emit the "end" event (hence the promise not resolving). The "error" event does not get emitted either.Commenting out the call to
pdfkitAddPlaceholder
(and the.end()
-ing of the new refs) resolves the problem (but the signing process fails because the placeholder is missing)Tried with pdfkit 0.11.0 and 0.14.0; under nodeJS 18.17.0 and 20.11.1
Is it a bug in signing or in the helpers?
Helper: placeholder-pdfkit
To Reproduce
The text was updated successfully, but these errors were encountered: