Eliminate PDF inclusion warning during documentation build?

Building the documentation currently throws a bunch of warnings whenever a PDF graphic is included. Sample warning is

pdfTeX warning: pdfetex (file /home/rik/wip/Projects_Mine/octave-dev/doc/interp
reter/spmatrix.pdf): PDF inclusion: found PDF version <1.7>, but at most versio
n <1.5> allowed
 </home/rik/wip/Projects_Mine/octave-dev/doc/interpreter/spmatrix.pdf> [671]

This seems to be rather innocuous. But, warnings thrown during the build can also consternation and make people believe there is something wrong.

Two discussions which are relevant are:

  1. pdf - pdfTeX warning: "version allowed" - TeX - LaTeX Stack Exchange
  2. Why is 1.5 the default pdf version? - TeX - LaTeX Stack Exchange

Does anyone have a strong conviction that we should fix this? If so, how should we do it? Do we want to ship a file pdfconfig.tex with Octave? Can we handle this by changing how we invoke Ghostscript?

I don’t get those warnings. This is my TeX Live version if it helps, and I’m not passing anything to build docs other than --enable-docs during configure:

$ pdflatex --version
pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022/Arch Linux)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.38
Compiled with zlib 1.2.12; using zlib 1.2.12
Compiled with xpdf version 4.03

The only warnings I get building Octave (hg id 18fac4a92fa6) are these:

clang-14: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]

libtool: warning: '/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../lib64/libGraphicsMagick++.la' seems to be moved
libtool: warning: '/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../lib64/libGraphicsMagick.la' seems to be moved

warning: latex_renderer: a run-time test failed and the 'latex' interpreter has been disabled.
warning: called from
    text at line 218 column 10
    plotimages at line 107 column 7

EDIT: I checked the file spmatrix.pdf. This is the result:

$ file doc/interpreter/spmatrix.pdf 
doc/interpreter/spmatrix.pdf: PDF document, version 1.7, 1 pages

Unless TeX just fixed this, you probably build incremental and docs don’t get rebuilt.
Try to delete doc/interpreter/spmatrix.pdf
and rebuild. Fedora buildbots have

$ pdflatex --version
pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021)
kpathsea version 6.3.3
Copyright 2021 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.12; using zlib 1.2.12

and you see those warnings e,g.: http://buildbot.octave.org:8010/#/builders/24/builds/11/steps/6/logs/stdio
(just search for “1.7”).

My previous test had indeed been with a completely new configure and build, but I did it again and this time I passed V=1 to make, and was able to get the PDF 1.7 messages. I then repeated it with V=0 and again with no verbosity flag at all, and in both cases I didn’t get anything regarding PDF 1.7.

Btw, the other warnings I pasted above from Clang etc were on the stderr stream, so the usual redirecting >out 2>err allows for easy separation of those. But the PDF warnings about 1.7 are on stdout, so they don’t show up if browsing the stderr stream afterwards.

I think the best way is to add

\pdfminorversion=7

into build-aux/texinfo.tex. I just did and I do not see any warnings and:

$ pdfinfo ./doc/interpreter/octave.pdf
Creator:        TeX
Producer:       pdfTeX-1.40.22
CreationDate:   Sun Oct 30 16:00:27 2022 EDT
ModDate:        Sun Oct 30 16:00:27 2022 EDT
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          1168
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      4789763 bytes
Optimized:      no
PDF version:    1.7
1 Like

Or, alternatively, we can set GS_OPTIONS="-dCompatibilityLevel=1.5" before building figures for the documentation. This way we can keep resulting pdf at 1.5 level (for some obscure compatibility issues).

octave:1> sombrero
octave:2> print("t1.pdf")
octave:3> setenv("GS_OPTIONS","-dCompatibilityLevel=1.5")
octave:4> print("t2.pdf")
octave:5> 

$ pdfinfo t1.pdf 
Title:          Figure 1
Author:         Octave
Creator:        GL2PS 1.4.2, (C) 1999-2020 C. Geuzaine
Producer:       GPL Ghostscript 9.56.1
CreationDate:   Sun Oct 30 17:18:11 2022 EDT
ModDate:        Sun Oct 30 17:18:11 2022 EDT
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          1
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      256335 bytes
Optimized:      no
PDF version:    1.7

$ pdfinfo t2.pdf 
Title:          Figure 1
Author:         Octave
Creator:        GL2PS 1.4.2, (C) 1999-2020 C. Geuzaine
Producer:       GPL Ghostscript 9.56.1
CreationDate:   Sun Oct 30 17:19:01 2022 EDT
ModDate:        Sun Oct 30 17:19:01 2022 EDT
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          1
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      256360 bytes
Optimized:      no
PDF version:    1.5
1 Like

This seems reasonable. On my system, build-aux/texinfo.tex is a symbolic link to a file in gnulib. Is it a bad idea to be editing that file rather than appending this command in some way? I tried creating a file texinfo.tex in the doc/interpreter directory but Texinfo then used only the local version which caused errors when building the documentation for lack of some important definitions.

Now I am thinking that setting -dCompatibilityLevel=1.5 may be a cleaner solution.
Add setenv("GS_OPTIONS","-dCompatibilityLevel=1.5") to plotimages.m ?

p.s. I guess it would also need to be added to geometryimages.m interpimages.m sparseimages.m splineimages.m. So may be not very clean…