[Solution Memo] tex inserts pdf compilation prompt "no BoundingBox"

This is a problem encountered recently when submitting a revised draft of an article. Two pdf images are inserted into the tex file. The local compilation is pdflatex, and there is no problem. However, the journal submission system is pdftex, which cannot process pdf images, and the error is as follows:

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

After a simple search, it basically means to remove the options added when referencing the graphicx package or to use pdflatex to compile. But I didn't add this item, and I can't change the engine for online compilation, so I can only choose the third solution: set the required box when inserting the pdf image.

First you need to know the size of the pdf you want to insert. Open the pdf file with vim in the terminal, there will be a line indicating the Box range of this pdf before a lot of garbled characters that I can't understand. For a file I use, the line is as follows:

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

So insert the pdf image like this:

\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 occupies the page space, and bb is used to set the range of the box, which should be a little larger than the box given by the pdf, and the specific value depends on the actual effect adjustment. Note that if the box height is too small, the top of the picture may block the header at the top of the page. At this time, the fourth parameter (indicating how high the box is) can be set larger.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325482930&siteId=291194637
TEX