groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with .PDFPIC caused by pdfinfo


From: Heinz-Jürgen Oertel
Subject: Problems with .PDFPIC caused by pdfinfo
Date: Wed, 15 Sep 2021 13:23:56 +0200

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

[Prev in Thread] Current Thread [Next in Thread]