I've got a file that returns this error:
pdfcpu info ~/Downloads/1768430448_multipart-1768430447-453652560080-1.pdf
Watermark: unsupported in version 1.4
After hot-fixing the error myself, I was able to extract this metadata:
/Users/eugene/Downloads/1768430448_multipart-1768430447-453652560080-1.pdf:
Source: /Users/eugene/Downloads/1768430448_multipart-1768430447-453652560080-1.pdf
PDF version: 1.4
Page count: 1
Page sizes: 612.00 x 792.00 points
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Title:
Author:
Subject:
PDF Producer: EPSON Scan
Content creator:
Creation date:
Modification date: D:20180711225439-05'00'
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Tagged: No
Hybrid: No
Linearized: No
Using XRef streams: No
Using object streams: No
Watermarked: No
Thumbnails: No
Signatures: No
Outlines: No
Names: No
Form: No
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Encrypted: No
Permissions: Full access
Apparently, this is a scanned file from 2018, that claims to be a PDF 1.4 while using a feature from a later PDF spec version (PDF 1.6?).
The fix I ended up is this:
diff --git a/pkg/pdfcpu/validate/annotation.go b/pkg/pdfcpu/validate/annotation.go
index b225610e..8ca03389 100644
--- a/pkg/pdfcpu/validate/annotation.go
+++ b/pkg/pdfcpu/validate/annotation.go
@@ -1657,7 +1657,7 @@ func validateAnnotationDictConcrete(xRefTable *model.XRefTable, d types.Dict, di
"Screen": {validateAnnotationDictScreen, model.V15, model.V14, false},
"PrinterMark": {validateAnnotationDictPrinterMark, model.V14, model.V14, false},
"TrapNet": {validateAnnotationDictTrapNet, model.V13, model.V13, false},
- "Watermark": {validateAnnotationDictWatermark, model.V16, model.V16, false},
+ "Watermark": {validateAnnotationDictWatermark, model.V16, model.V14, false},
"3D": {validateAnnotationDict3D, model.V16, model.V16, false},
"Redact": {validateAnnotationDictRedact, model.V17, model.V17, true},
"RichMedia": {validateRichMediaAnnotation, model.V17, model.V14, false},
Could a patch for this be possibly accepted? It appears an issue relatively similar to the one here #73
I've got a file that returns this error:
After hot-fixing the error myself, I was able to extract this metadata:
Apparently, this is a scanned file from 2018, that claims to be a PDF 1.4 while using a feature from a later PDF spec version (PDF 1.6?).
The fix I ended up is this:
Could a patch for this be possibly accepted? It appears an issue relatively similar to the one here #73