Skip to content
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

Missing PDFDictionary entry "Parent" (Copying PDF page with some annotations) #138

Closed
tema4p opened this issue Jul 19, 2019 · 4 comments
Closed

Comments

@tema4p
Copy link

tema4p commented Jul 19, 2019

Hi guys, I really appreciate your efforts in making our world better, at least with PDF part.
I worked a lot with your library (as well as with PDFAssembler) and will add some feedback soon.

But I've met some strange error when trying to copy from or add to pages to PDF files with some annotations.
test_text_annot.pdf

I use pdf-lib (0.6.3) in browser, investigated the issue and reviewed your code, but still can't figure out the problem, please help.

ERROR Error: Missing PDFDictionary entry "Parent".

I'll continue investigating and any support here would be great, thanks!

@Hopding
Copy link
Owner

Hopding commented Jul 20, 2019

Hello @tema4p! I'm glad you are finding pdf-lib useful. I look forward to your feedback.

I was able to reproduce this issue. It looks like the problem is caused by some page objects missing a required key (/Parent). The file you shared has a couple couple of pages with another missing key as well (/Resources), though this isn't the cause of the error. Technically, these missing keys make the file you shared invalid.

I'll work on a fix for this. I'll try to get it published within a couple of days. However, the the beta release doesn't have this problem, and is able to copy the PDF without any errors. I'd recommend you try it out.

@Hopding
Copy link
Owner

Hopding commented Jul 21, 2019

I just released version 0.6.4. The full release notes are available here.

You can install it with npm:

npm install --save pdf-lib@0.6.4

or yarn:

yarn add pdf-lib@0.6.4

It's also available on the unpkg CDN:

@Hopding
Copy link
Owner

Hopding commented Jul 21, 2019

@tema4p Please let me know if the fix works for you.

@tema4p
Copy link
Author

tema4p commented Jul 25, 2019

@Hopding Thank you a lot!
That fixed my issue.
Sorry for the late response.
I'll try beta version and let you know!
Thanks again!

@tema4p tema4p closed this as completed Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants