[luatex] warning (pdfe lib): no valid pdf file

luigi scarso luigi.scarso at gmail.com
Wed Jun 21 06:45:04 CEST 2023


On Wed, 21 Jun 2023 at 01:19, Reinhard Kotucha <reinhard.kotucha at gmx.de>
wrote:

> Hi,
> when I execute the file
>
> -----------------------------------
> #!/usr/bin/env texlua
>
> local doc = pdfe.open ('rules.pdf')
> -----------------------------------
>
> luatex aborts with the messages:
>
>    warning  (pdfe lib): no valid pdf file 'rules.pdf'
>
>    warning  (pdfe lib): lua <pdfe document> expected
>
>
> This happens with many PDF files though they can be processd
> perfectly by other programs (PDF viewers).  I don't have a complete
> overview yet but at a first glance it seems that only PDF files
> *not* created by TeX are affected.
>

in this case pdfe lib  doesn't load the xref and indeed  with latest mupdf
I have

$ mupdf rules.pdf
error: cannot recognize xref format
warning: trying to repair broken xref
warning: repairing PDF document

With qpdf:
$  qpdf --show-xref rules.pdf
WARNING: rules.pdf: file is damaged
WARNING: rules.pdf (offset 9808): xref not found
WARNING: rules.pdf: Attempting to reconstruct cross-reference table
1/0: uncompressed; offset = 15
2/0: uncompressed; offset = 82
3/0: uncompressed; offset = 8272
4/0: uncompressed; offset = 141
5/0: uncompressed; offset = 7196
6/0: uncompressed; offset = 7229
7/0: uncompressed; offset = 326
8/0: uncompressed; offset = 6309
9/0: uncompressed; offset = 6356
10/0: uncompressed; offset = 6539
11/0: uncompressed; offset = 7476
12/0: uncompressed; offset = 6812
13/0: uncompressed; offset = 6969
14/0: uncompressed; offset = 8176
15/0: uncompressed; offset = 7274
16/0: uncompressed; offset = 9676
qpdf: operation succeeded with warnings

Several viewers try to fix damaged pdf, but in this way it's not clear if
what you are viewing is correct or not.
--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20230621/f4f44a28/attachment.htm>


More information about the luatex mailing list.