[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with .PDFPIC caused by pdfinfo
From: |
Heinz-Jürgen Oertel |
Subject: |
Re: Problems with .PDFPIC caused by pdfinfo |
Date: |
Tue, 21 Sep 2021 17:33:16 +0200 |
Am Dienstag, 21. September 2021, 15:23:40 CEST schrieb Tadziu Hoffmann:
> Is there a reason you need grep in there?
>
> You can work around the issue by removing the grep completely
> and do the filtering with sed: add the "-n" (no default output)
> command-line option when calling sed, and the "p" (print) flag
> to the substitute command:
>
> sed -ne 's/.../.../p'
I can not manage it with sed only, but this works as well, using awk instead:
. sy pdfinfo @$1 | \
awk '/Page size/ {print ".nr pdf-wid \\(p;" $3 "\\)\\n.nr pdf-ht \\(p;" $5i
"\\)\\n"}' \
> /tmp/pdfpic\n[$$]
It depends on pdfinfo putting the numbers at pos $3 and $5
If you don't like to change pdfpic.tmac I could make a small script "genpdf"
which calls convert and removes all \n : sed 's/\0//g'
Heinz