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

Cannot list annotations (version error) #680

Closed
little-flag opened this issue Aug 23, 2023 · 3 comments
Closed

Cannot list annotations (version error) #680

little-flag opened this issue Aug 23, 2023 · 3 comments
Assignees

Comments

@little-flag
Copy link

little-flag commented Aug 23, 2023

Getting this error:

> pdfcpu annot list test.pdf
dict=annotDict entry=NM: unsupported in version 1.3
This file could be PDF/A compliant but pdfcpu only supports versions <= PDF V1.7

The PDF in question is v1.3, produced by macOS (13.5.1) Quartz PDFContext. It's very simple, just some placeholder text and an underline annotation.

Is this a known/intended limitation? (Using pdfcpu CLI v0.5.0, though I had the same problem with previous version too.)

My use case is that I'd like to use pdfcpu to replace a bunch of non-Go code that I need to extract annotations (particularly pdfannots, which relies on pdfminer.six/Python). Just testing to see how plausible this is.

@hhrutter
Copy link
Collaborator

This file is in violation of the PDF specification.
The optional NM entry in annotation dicts is defined for PDF Versions 1.4 and beyond only.

@little-flag
Copy link
Author

little-flag commented Aug 23, 2023

Thanks. I guess this is a problem with macOS.

Edit: In fact it seems that any PDF produced with either macOS or iOS/iPadOS (using Apple tech; Quartz, presumably) produces this same problem. Will try to log this as feedback for Apple…

hhrutter added a commit that referenced this issue Aug 23, 2023
@hhrutter
Copy link
Collaborator

True and good idea to report this 👍🏻
Nevertheless, the latest commit relaxes validation of that attribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants