RE: drawPage for embedded PDF seems to lose hyperlink annotations
What were you trying to do?
Embed pdfs that contain hyperlink with custom text in one page
How did you attempt to do it?
// const truncatedPdUrl: path to partial pdfs that will be embedded into one large pdf
const pdfBuffer = await this.storageFacade.loadBuffer(truncatedPdfUrl);
const [embeddedPdfPage] = await pdfDoc.embedPdf(pdfBuffer);
const fullPdfUrl = await this.storageFacade.savePdfAttachment(pdfKeyPrefix, embeddedPdfPage);
Also mentioned in issue #606 and #798
What actually happened?
hyperlink annotations in the partial pdfs are lost, and the hyperlink no longer clickable after they were stitched onto the final pdf using page.embedPdf()
partial_pdf_with_clickable_annotated_hyperlink.pdf
What did you expect to happen?
Hyperlinks with annotations continue to work
How can we reproduce the issue?
- Create a pdf that contains a annotated hyperlink (clickable at this point)
- Use
pdfDoc.embedPdf()to embed this pdf into a new page with puppeteer - print the page to pdf
- -> hyperlink no longer clickable
Version
1.16.0
What environment are you running pdf-lib in?
Node
Checklist
- [X] My report includes a Short, Self Contained, Correct (Compilable) Example.
- [X] I have attached all PDFs, images, and other files needed to run my SSCCE.
Additional Notes
No response
+1
I've faced this issue either, the generated pdf losed all image annotations from embeded PDF.
BH
similar issue here but with form fields, tried to embed a page of PDF that had non-flatten form fields, but after calling the embedPdf command, the embedded PDF lost all fields entirely, as if they were never even there
I have same question. after i Convert HTML to PDF,all hyperlink lost. in html, click hyperlink and the page go to place where id are same. i hope have the same effect in pdf
@liulinqiang how did you convert html into PDF may i ask?