tavinus / pdfScale

Bash Script to Scale and Resize PDFs using Ghostscript
MIT License
246 stars 37 forks source link

pdfScale doesn't preserve hyperlinks #14

Closed psiccardi closed 5 years ago

psiccardi commented 5 years ago

Using pdfscale to scale a page doesn't preserve hyperlinks. Could you add the possibility to pass the "-dPrinted=false" parameter to gs? Now i'm using this script with the addition of this parameter (i edited the script in my local machine) to achieve my goal. Anyway, nice work! This script saved me hours of life!

tavinus commented 5 years ago

Thanks for letting me know.
I will try to add and test that soon.

tavinus commented 5 years ago

Possible solutions:

More info:

Problems:

GS manual info

image

Conclusions

I will probably just set an optional flag for dPrinted=false.
Still not sure what should be the default though.
What is more important? Preserving URLs or preserving print annotations?

tavinus commented 5 years ago

Implemented on v2.4.9 ( https://github.com/tavinus/pdfScale/commit/e3d826d14ae245f8b1d127082b9054c800158dc9 )

Created parameter --print-mode <screen|printer> to control the dPrinted parameter on GS calls.

Default behavior is unchanged, it is left empty which will use a print profile if there is an output file set (which we always do at this point).

Otherwise

Forcing print mode is kind of useless at this point, but can become useful in the future.

Cheers!
Gus