Re: Bug reporting and patch for texlive-extra-utils: pdfxup
Dear Janis and Norbert,
> You might find the attached patch helpful.
>
> It contains a fix for filenames with spaces, but, as @Norbert noticed,
> also enables -dNOSAFER, of which I am not a very big fan. It seems that
> for some pdf inputs (one of which is a publicly available pdf, which I
> am attaching as input.pdf) a specific operation is required that is
> resulting in permission denial.
Thanks for the suggestions.
1) indeed, allowing spaces in file names is a nice addition;
2) regarding -dNOSAFER, indeed pdfxup apparently fails to work since
ghostscript-9.50. Apparently it affects all PDF files (at least all the
files I tried), and occurs because since 9.50, ghostscript has -dSAFER
as default option (which prevents programs from opening a file).
Instead of adding -dNOSAFER (which indeed allows much more than what we
need), there is an option --permit-file-read=... which is just what is
needed (allows read access to the listed file(s)). For instance:
gs -sDEVICE=bbox -dNOPAUSE -dQUIET -c "(input.pdf) (r) file
runpdfbegin pdfpagecount = quit"
fails but
gs --permit-file-read=input.pdf -sDEVICE=bbox -dNOPAUSE -dQUIET -c
"(input.pdf) (r) file runpdfbegin pdfpagecount = quit"
should work.
Thanks again for reporting this. I will patch pdfxup with a test for the
version of ghostscript being used, and the addition of the above option
when needed.
Best wishes,
--
Nico
Reply to: