Re: PDF problem - Help needed

Tobias Hoffmann <[email protected]> Fri, 12 Sep 2025 18:51:10 +0200
Newsgroups dev.linux.lists.printing-architecture
Message-ID <[email protected]>
Hello Uddhav,

Your PDF has multiple issues:

1. (Unrelated to the problem at hand:) needtrue-text.pdf ends with just =
=E2=80=9E%EOF=E2=80=9C instead of the correct =E2=80=9E%%EOF=E2=80=9C

2. Already when opening the file with xpdf / poppler I am greeted with:

$ xpdf needtrue-test.pdf=20
Syntax Error (59908): Unknown operator 'x<9c><d3><0f><a9>Pp<f2>u<e6>*Tp'
Syntax Error (59910): Unknown operator '<e1>2P'
Syntax Error (59916): Unknown operator =
'<c1><a2>t<05><fd><a8>D<97>L<05>CC=3DC<85><90>4.C=3D<0b><05><10><0e>IQ<d0>=
<b0><d0>T<08><c9><e2>r'
Syntax Error (59920): Unknown operator '<e1>'
Syntax Error: Unknown operator '<e4>r<05>j<03>'
Syntax Error: Unknown operator '<cf><fe><0e><02>'
Syntax Error: Unknown operator 'x<9c><d3><0f><a9>Pp<f2>u<e6>r<05>b'
Syntax Error: Unknown operator '<14>&<02><d7>'
Syntax Error (60377): Unknown operator 'x<9c><d3><0f><a9>Pp<f2>u<e6>*Tp'
Syntax Error (60379): Unknown operator '<e1>2P'
Syntax Error (60385): Unknown operator =
'<c1><a2>t<05><fd><a8>D<97>L<05>CC=3DC<85><90>4.C=3D<0b><05><10><0e>IQ<d0>=
<b0><d0>T<08><c9><e2>r'
Syntax Error (60389): Unknown operator '<e1>'
Syntax Error: Unknown operator '<e4>r<05>j<03>'
Syntax Error: Unknown operator '<cf><fe><0e><02>'
Syntax Error: Unknown operator 'x<9c><d3><0f><a9>Pp<f2>u<e6>r<05>b'
Syntax Error: Unknown operator '<14>&<02><d7>'
Syntax Error (60846): Unknown operator 'x<9c><d3><0f><a9>Pp<f2>u<e6>*Tp'
Syntax Error (60848): Unknown operator '<e1>2P'
Syntax Error (60854): Unknown operator =
'<c1><a2>t<05><fd><a8>D<97>L<05>CC=3DC<85><90>4.C=3D<0b><05><10><0e>IQ<d0>=
<b0><d0>T<08><c9><e2>r'
Syntax Error (60858): Unknown operator '<e1>'
[=E2=80=A6]

which suggests that there is something very wrong, probably some =
butchered content streams (operators are usually part of a content =
stream, and you did not mess with e.g. fonts=E2=80=A6).

3. Two fields ARE actually displayed correctly, Gender =E2=80=9EMan=E2=80=9C=
 and Height =E2=80=9E150=E2=80=9C.

4. Although the resource dictionary of the first (only) page contains =
XObjects /Fxo9 =E2=80=A6 /Fxo1 /Fxo17 =E2=80=A6 /Fxo10 only /Fxo9 =E2=80=A6=
 /Fxo16 are actually drawn on the page (with /=E2=80=A6 Do, as Michael =
Sweet already pointed out)=20

5. It turns out that =E2=80=9EMan=E2=80=9C is /Fxo9 and =E2=80=9E150=E2=80=
=9C is /Fxo10; /Fxo11 =E2=80=A6 /Fxo16 seem to be the check boxes, which =
seem to use images in their appearance, and their content stream is =
broken (dict + hex dump):

<</BBox[ 0 0 11.1 11.1]/Length 18        /Resources<</Font 18 0 =
R/ProcSet[/PDF/Text/ImageC/ImageI/ImageB]/XObject<</Im4 19 0 =
R>>>>/Subtype/Form/Type/XObject>>

00000000  78 9c d3 0f a9 50 70 f2  75 e6 72 05 62 00 14 26  =
x....Pp.u.r.b..&
00000010  02 d7

This looks like random memory (all the other appearance content streams =
are not compressed, either, which makes a missing /Filter unlikely).

6. The not-drawn XObjects, e.g. /Fxo1 do not seem to have obvious =
errors.

> I can now confirm that this stream is indeed being appended to the =
page content stream.=20

This is only true /Fxo9 =E2=80=A6 /Fxo16, but not for /Fxo1 .. /Fxo8 and =
/Fxo17 in the file I received from Till.

HTH
  Tobias
=20


> Am 11.09.2025 um 16:50 schrieb Till Kamppeter =
<[email protected]>:
>=20
> [ This mail is addressed to people from whom I know that they have =
konwledge on
>  the inner workings of the PDF file format due to the projects they =
are working
>  on. ]
>=20
> Hi,
>=20
> Uddhav Phatak (CCed) has done a GSoC 2024 project on eliminating C++ =
in libcupsfilters, mainly by replacing the PDF manipulator QPDF by Mike =
Sweet's PDFio.
>=20
> His project report:
>=20
> =
https://medium.com/@uddhavphatak/gsoc-2024-final-report-the-refactor-repor=
t-a46756e9d6ce
>=20
> His code as PR #71 on libcupsfilters:
>=20
> https://github.com/OpenPrinting/libcupsfilters/pull/71
>=20
> Some parts he did not succeed to complete withing the GSoC time frame =
due to their complexity.
>=20
> What is remaining to be completed is flattening filled forms and =
annotations into static content of the PDF, so that the filled in text =
is correctly taken into account by doing page manipulations (like N-up) =
and that it is assured that the text gets printed.
>=20
> On this step Uddhav ran into a problem:
>=20
> -----
> Hi Till,
> I am not able to debug one issue, could you help me where I might be =
going wrong,
>=20
> form_english_filled.pdf and needtrue.pdf, both have needAppearances =
set as true.
>=20
> form_english_filled.pdf is successfully flattened as shown in test.pdf
>=20
> but when converting needtrue.pdf into needtrue-test.pdf, even though =
all the annotation objects are successfully converted to Xobjects and =
added into the page dict, I am not understanding why aren't they =
visible.
>=20
> Can you look through this and tell me where I might be going wrong, =
and what value is missing from the Xobject Dictionary.
> -----
>=20
> The files mentioned here are all attached.
>=20
> Anybody has an idea what can be wrong here?
>=20
> Thanks in advance.
>=20
>   Till
> <test.pdf><needtrue-test.pdf><needtrue.pdf><form_english_filled.pdf>