rrthomas / pdfjam

The pdfjam package for manipulating PDF files
GNU General Public License v2.0
378 stars 28 forks source link

PDF inclusion: invalid ProcSet array type <dictionary> #52

Open rvernica opened 3 years ago

rvernica commented 3 years ago

I have a PDF document with two pages scanned with XSane:

> identify foo.pdf
foo.pdf[0] PDF 241x155 241x155+0+0 16-bit sRGB 95485B 0.000u 0:00.000
foo.pdf[1] PDF 242x155 242x155+0+0 16-bit sRGB 95135B 0.000u 0:00.001

Any sort of processing with pdfjam result in an error:

> pdfjam --no-tidy --paper letter --outfile 1.pdf -- foo.pdf
          ----
  pdfjam: This is pdfjam version 3.03.
  pdfjam: Reading any site-wide or user-specific defaults...
          (none found)
  pdfjam: Temporary directory for this job is
                    /var/tmp/pdfjam-WxYPgt
  pdfjam: Effective call for this run of pdfjam:
          /usr/bin/pdfjam --no-tidy --paper letter --outfile 1.pdf -- foo.pdf - 
  pdfjam: Calling /usr/bin/pdflatex...
  pdfjam: FAILED.
          The call to /usr/bin/pdflatex resulted in an error.
          If '--no-tidy' was used, you can examine the
          log file at
                  /var/tmp/pdfjam-WxYPgt/a.log
          to try to diagnose the problem.
  pdfjam ERROR: Run 1: Output file not written

I have multiple PDFs like this with the same page count and dimensions and they all fail. Other files from Xsane work fine.

Extra info:

> pdfjam --version
3.03
> dnf info texlive-pdfjam
Installed Packages
Name         : texlive-pdfjam
Epoch        : 9
Version      : 20200327
Release      : 30.fc34
Architecture : noarch
Size         : 184 k
Source       : texlive-base-20200327-30.fc34.src.rpm
Log file

``` This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2020.11.24) 20 OCT 2021 22:01 entering extended mode restricted \write18 enabled. %&-line parsing enabled. **/var/tmp/pdfjam-deeQuV/a.tex (/var/tmp/pdfjam-deeQuV/a.tex LaTeX2e <2020-02-02> patch level 5 L3 programming layer <2020-04-06> (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2019/12/20 v1.4l Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option) ) \c@part=\count167 \c@section=\count168 \c@subsection=\count169 \c@subsubsection=\count170 \c@paragraph=\count171 \c@subparagraph=\count172 \c@figure=\count173 \c@table=\count174 \abovecaptionskip=\skip47 \belowcaptionskip=\skip48 \bibindent=\dimen134 ) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty Package: inputenc 2018/08/11 v1.3c Input encoding file \inpenc@prehook=\toks15 \inpenc@posthook=\toks16 ) (/usr/share/texlive/texmf-dist/tex/latex/pdfpages/pdfpages.sty Package: pdfpages 2020/01/28 v0.5q Insert pages of external PDF documents (AM) (/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC) ) (/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ) \calc@Acount=\count175 \calc@Bcount=\count176 \calc@Adimen=\dimen135 \calc@Bdimen=\dimen136 \calc@Askip=\skip49 \calc@Bskip=\skip50 LaTeX Info: Redefining \setlength on input line 80. LaTeX Info: Redefining \addtolength on input line 81. \calc@Ccount=\count177 \calc@Cskip=\skip51 ) (/usr/share/texlive/texmf-dist/tex/latex/eso-pic/eso-pic.sty Package: eso-pic 2018/04/12 v2.0h eso-pic (RN) (/usr/share/texlive/texmf-dist/tex/generic/atbegshi/atbegshi.sty Package: atbegshi 2019/12/05 v1.19 At begin shipout hook (HO) (/usr/share/texlive/texmf-dist/tex/generic/infwarerr/infwarerr.sty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) ) (/usr/share/texlive/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty Package: ltxcmds 2019/12/15 v1.24 LaTeX kernel commands for general use (HO) ) (/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty Package: iftex 2020/03/06 v1.0d TeX engine tests )) (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty Package: keyval 2014/10/28 v1.15 key=value parser (DPC) \KV@toks@=\toks17 ) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg File: color.cfg 2016/01/02 v1.6 sample color configuration ) Package xcolor Info: Driver file: pdftex.def on input line 225. (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex ) Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348. Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1352. Package xcolor Info: Model `RGB' extended on input line 1364. Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366. Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367. Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368. Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369. Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370. Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371. )) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR) (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty Package: trig 2016/01/03 v1.10 sin cos tan (DPC) ) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: pdftex.def on input line 105. ) \Gin@req@height=\dimen137 \Gin@req@width=\dimen138 ) \AM@pagewidth=\dimen139 \AM@pageheight=\dimen140 (/usr/share/texlive/texmf-dist/tex/latex/pdfpages/pppdftex.def File: pppdftex.def 2020/01/28 v0.5q Pdfpages driver for pdfTeX (AM) ) \AM@pagebox=\box45 \AM@global@opts=\toks18 \AM@pagecnt=\count178 \AM@toc@title=\toks19 \c@AM@survey=\count179 \AM@templatesizebox=\box46 ) (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def File: l3backend-pdfmode.def 2020-03-12 L3 backend support: PDF mode \l__kernel_color_stack_int=\count180 \l__pdf_internal_box=\box47 ) LaTeX Warning: Unused global option(s): [letter]. No file a.aux. \openout1 = `a.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6. LaTeX Font Info: ... okay on input line 6. \AtBeginShipoutBox=\box48 (/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count181 \scratchdimen=\dimen141 \scratchbox=\box49 \nofMPsegments=\count182 \nofMParguments=\count183 \everyMPshowfont=\toks20 \MPscratchCnt=\count184 \MPscratchDim=\dimen142 \MPnumerator=\count185 \makeMPintoPDFobject=\count186 \everyMPtoPDFconversion=\toks21 ) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4 85. (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv e )) (/usr/share/texlive/texmf-dist/tex/latex/pdflscape/pdflscape.sty Package: pdflscape 2019/12/05 v0.12 Display of landscape pages in PDF (HO) (/usr/share/texlive/texmf-dist/tex/latex/graphics/lscape.sty Package: lscape 2000/10/22 v3.01 Landscape Pages (DPC) ) Package pdflscape Info: Auto-detected driver: pdftex on input line 81. ) File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf used on input lin e 7. (pdftex.def) Requested size: 241.90315pt x 153.57336pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf used on input lin e 7. (pdftex.def) Requested size: 241.90315pt x 153.57336pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 241.90315pt x 153.57336pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. File: /var/tmp/pdfjam-deeQuV/source-1.pdf Graphic file (type pdf) Package pdftex.def Info: /var/tmp/pdfjam-deeQuV/source-1.pdf , page1 used on in put line 7. (pdftex.def) Requested size: 313.20139pt x 198.83739pt. [1 ==> Fatal error occurred, no output PDF file produced! \```

DavidFirth commented 3 years ago

It looks like pdflatex (or else pdfpages or something else!) does not like those particular PDF files, for some reason. Have you tried already using xelatex or lualatex, instead of pdflatex for these files? See use of the --latex argument, by looking at output from pdfjam --help. If that solves your problem, please do report back here. It's my only idea, sorry.

rvernica commented 3 years ago

I'm not sure what the problem was, but I think it was related to the document having multiple pages. I went back to Xsane and split the scanned input into two PDFs of one page each. pdfjam worked fine afterwards. Maybe Xsane does not properly encode multiple pages. Or pdflatex does not like that way of encoding multiple pages.

2ndK16 commented 2 years ago

I've encountered the same issue, tried to merge a multipage PDF generated by xsane with other PDFs, got the same error message. Adding --latex /usr/bin/lualatex worked fine for me.