[solution note] tex insert PDF compilation prompt “no boundingbox”

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

This is a problem encountered in submitting a revised version of an article recently. Two PDF images have been inserted into the Tex file. The local compilation is pdflatex, and there is no problem. However, the journal submission system is pdftex, which can’t process PDF images

pdfTeX Error: Cannot determine size of graphic in xxx.pdf (no BoundingBox).

After a simple search, it is basically to remove the options added when referring to the graphicx macro package or compile with pdflatex instead. But I didn’t add this item, and the online compiler can’t change the engine, so I can only choose the third scheme: set the required box when inserting the PDF image

First, you need to know the size of the PDF to insert. Open the PDF file with VIM at the terminal, and there will be a line indicating the box range of the PDF in front of a lot of incomprehensible garbled codes. The line of a file I used is as follows:

/MediaBox [ 0 0 929.10375 471.60375 ] /Annots [ ] /Resources 8 0 R

So insert the PDF image:

\begin{figure}
\centering
\includegraphics[width=\textwidth, bb=0 0 930 475]{xx.pdf}
\caption{xxxxx\label{fig:xx}}
\end{figure}

Among them, the width setting takes up the page space, and the range of box setting with BB should be a little larger than the box given by PDF. The specific value depends on the actual effect. Note that if the box height is too small, the top of the picture may block the top header of the page. At this time, the fourth parameter (indicating how high the box is) can be set larger

Similar Posts: