pdfcpu validate fails on a valid PDF where a page resource dictionary contains a /Properties entry pointing to a stream dictionary.
Problem
pdfcpu validate failss on a valid PDF where a page resource dictionary containing a /Properties entry pointing to a stream dictionary.
The stream content itself is not relevantm, the important structure is:
/Resources << /Font << /F1 6 0 R >> /Properties << /P1 5 0 R >> >>
...
5 0 obj
<< /MCID 0 /Length 0 >>
stream
endstream
endobjReproducer
I attached a minimal synthetic PDF:
properties-streamdict-resource.pdf
It is a one-page PDF 1.4 file with visible explanatory text. The text uses a normal font resource. The failing object is only the /Properties /P1 stream dictionary.
Command:
pdfcpu -c disable validate --mode strict properties-streamdict-resource.pdfActual Result
validating(mode=strict) properties-streamdict-resource.pdf ...
validate properties-streamdict-resource.pdf: validation error (obj#:5) (try --mode=relaxed): document catalog: catalog Pages: page tree: page obj#3: propertiesResourceDict.P1 obj#5: propertiesDict obj#5: dereference: obj#5 gen#0: expected types.Dict, got types.StreamDictThe same also fails in relaxed mode and when using split.
Expected Result
Validation should succeed.
A PDF stream object has a stream dictionary, and in this case the dictionary part is what the /Properties validation needs.
Environment
Tested from a checkout of current master:
commit: 105c0c28727afe7f85eb3179d03e9810d8774981
describe: v0.15.0-1-g105c0c28
nearest release: v0.15.0Command used against the source checkout:
go run ./cmd/pdfcpu -c disable validate --mode properties-streamdict-resource.pdfOS:
macOS 15.7.9 (Build 24G830), darwin/arm64Source: pdfcpu/pdfcpu