How to extract PDF size? (Dimensions, not file size)

I have many hundreds of small PDF images (created in Adobe Illustrator) that will be pasted into a Latex document. I need to know the size of these images in real sizes (e.g. 20 mm x 14 mm) or at least what latex can understand.

Is there a command line tool that can create these sizes? (I am running Mac OS X.)

The second best solution for Latex could be dimensioning.

[I tried pdftk, but his data dump command only seems to tell me the number of pages (1).]

+3
source share
2 answers

pdfinfo pdfinfo.exe ( XPDF suite):

pdfinfo ^
   -f 1 ^
   -l 10 ^
   -box ^
   20-pages.pdf

(MediaBox, CropBox, BleedBox, TrimBox, ArtBox) 1-10 PDF.

+2

LaTeX :

\setbox0 = \hbox{\includegraphics{small.pdf}}
width = \the\wd0, height = \the\ht0
0

Source: https://habr.com/ru/post/1768393/


All Articles