Hello,

some time ago already reported, there still exists a small problem with the 
.PDFPIC Macro. To get the size of an PDF image it is using the following 
command pipeline

.  sy pdfinfo @$1 | \
grep "Page *size" | \
sed -e 's/Page *size: *\\([[:digit:].]*\\) *x *\\([[:digit:].]*\\).*$/\
.nr pdf-wid (p;\\1)\\n\
.nr pdf-ht  (p;\\2)/' \
> /tmp/pdfpic\n[$$]


For some reasons, which I don't know, pdfinfo puts some code in the output, so 
it seems for the following grep not to be an text file. Example:

$ pdfinfo Tschukurowa_OSM.pdf | grep  "Page *size" 
grep: (standard input): binary file matches

but

$ pdfinfo Tschukurowa_OSM.pdf | grep -a "Page *size" 
Page size:      928.403 x 484.45 pts

I'm using OpenSuse Tumbleweed 

$ pdfinfo -v       
pdfinfo version 21.08.0
Copyright 2005-2021 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2011 Glyph & Cog, LLC

If you can see, adding -a to the grep command solves the problem.

 -a, --text
              Process a binary file as if it were text; this is equivalent to  
the  --binary-files=text
              option.


That said, the lines in pdfpic.tmac sould be:


.  sy pdfinfo @$1 | \
grep -a "Page *size" | \
   ...



regards
 Heinz



Reply via email to