<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 21 Jun 2023 at 01:19, Reinhard Kotucha <<a href="mailto:reinhard.kotucha@gmx.de">reinhard.kotucha@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
when I execute the file<br>
<br>
-----------------------------------<br>
#!/usr/bin/env texlua<br>
<br>
local doc = pdfe.open ('rules.pdf')<br>
-----------------------------------<br>
<br>
luatex aborts with the messages:<br>
<br>
   warning  (pdfe lib): no valid pdf file 'rules.pdf'<br>
<br>
   warning  (pdfe lib): lua <pdfe document> expected<br>
<br>
<br>
This happens with many PDF files though they can be processd<br>
perfectly by other programs (PDF viewers).  I don't have a complete<br>
overview yet but at a first glance it seems that only PDF files<br>
*not* created by TeX are affected.<br></blockquote><div><br></div><div>in this case pdfe lib  doesn't load the xref and indeed  with latest mupdf I have</div><div><br></div><div>$ mupdf rules.pdf <br>error: cannot recognize xref format<br>warning: trying to repair broken xref<br>warning: repairing PDF document<br></div><div><br></div><div>With qpdf:</div><div>$  qpdf --show-xref rules.pdf</div>WARNING: rules.pdf: file is damaged<br>WARNING: rules.pdf (offset 9808): xref not found<br>WARNING: rules.pdf: Attempting to reconstruct cross-reference table<br>1/0: uncompressed; offset = 15<br>2/0: uncompressed; offset = 82<br>3/0: uncompressed; offset = 8272<br>4/0: uncompressed; offset = 141<br>5/0: uncompressed; offset = 7196<br>6/0: uncompressed; offset = 7229<br>7/0: uncompressed; offset = 326<br>8/0: uncompressed; offset = 6309<br>9/0: uncompressed; offset = 6356<br>10/0: uncompressed; offset = 6539<br>11/0: uncompressed; offset = 7476<br>12/0: uncompressed; offset = 6812<br>13/0: uncompressed; offset = 6969<br>14/0: uncompressed; offset = 8176<br>15/0: uncompressed; offset = 7274<br>16/0: uncompressed; offset = 9676<br>qpdf: operation succeeded with warnings<br><div><br></div><div>Several viewers try to fix damaged pdf, but in this way it's not clear if what you are viewing is correct or not.</div><div>--</div><div>luigi</div></div></div>