Importing a PDF file into XeLaTeX yields "pdf_link_obj (): passed invalid object"

I am trying to import a PDF file into XeLaTeX using \includepdf{xyz.pdf} . The xyz.pdf file is a scan created by the Xerox 5755 machine and PDF version 1.3.

The error I am getting is:

  ** WARNING ** No valid name object found.
    ** WARNING ** Could not find a value in dictionary object.
    ** WARNING ** Didn't find "endobj".
    ** ERROR ** pdf_link_obj (): passed invalid object.

I tried normalizing the PDF by running pdftk xyz.pdf output xyz2.pdf and this fixes the problem - but only for some PDF files, without the obvious relationship between these pdftk fixes files and those that it doesn't have. There are always files normalized with pdftk that continue to show the same error as the unnormalized file.

I tried to find a solution to this problem and came up with this topic: XeLaTeX problems with embedded graphics , which suggests that the problem can be solved using -output-driver=xdv2pdf or, alternatively, using pdf(la)tex . Alas, I cannot use PdfLaTeX because I need Unicode XeLaTeX support. In addition, I use Linux, so I cannot use Mac-specific xdv2pdf .

I would be very grateful for any thoughts and materials on why this PDF does not load XeLaTeX and - even better; how to "fix" these PDF files.

Respectfully,

Brian

+4
source share
3 answers

Luatex (the successor to Pdftex) also supports Unicode natively. What happens when I try to compile with lualatex ?

+2
source

I had the same problem as XeLaTeX on Debian. PDF files exported from LibreOffice were imported properly, including scanning as PDF files that were created by my printer.

I could fix this problem by "recompiling" the PDF using Ghostscript. On Linux, this will be done with:

 gs -o repaired.pdf -sDEVICE=pdfwrite dPDFSETTINGS=/prepress corrupted.pdf 

(source: https://superuser.com/a/282056 , there is also a Ghostscript command for Windows)

Importing a “fixed” PDF using XeLaTeX worked fine.

0
source

I used \ includegraphics {} and ran into a similar problem with pdf (created by printing a file from Excel using Win2pdf). I opened the PDF using Adobe Reader and saved a copy. The copy was then successfully deployed using \ includgraphics {} and the xelatex compiler.

0
source

All Articles