Closed Geo-Van closed 11 months ago
You can use -dPreserveAnnotTypes
Take a look under the PreserveAnnots switch here: https://ghostscript.readthedocs.io/en/latest/VectorDevices.html#pdf-file-output-pdfwrite
If you preserve Link annotations then hyperlinks should continue to work.
Thank you very much! This gives me the correct explanation. Thank you! Please note that before Ghostscript version 9.27 (included), the following Ghostscript command assumes separate "thing" annotations AND Hyperlinks : -dPreserveAnnots=true So, when applied to a pdf file, it gives ----> Annotations Flatten & Hyperlinks not Flatten
But as your answer, Ghostscript after version 9.27, "CHANGE POLICY" and correctly assumes annotations AND hyperlinks "same thing".
But is there an extra COMMAND to can use in order to "separate" annotations from hyperlinks as versions 9.27 and before do?
You can use -dPreserveAnnotTypes
Take a look under the PreserveAnnots switch here: https://ghostscript.readthedocs.io/en/latest/VectorDevices.html#pdf-file-output-pdfwrite
If you preserve Link annotations then hyperlinks should continue to work.
Thank you very much! Very interesting info. Please help me to do it work with an example - Lets say i have the following command: gs.exe -o output.pdf -dPreserveAnnots=false -sDEVICE=pdfwrite input.pdf
According to your answer, now, i must add the follow to the command line in order to flatten annotations but keep hyperlinks alive: -c "/PreserveAnnotTypes [/Link] def" -f
I try to "marry" the above two in the correct command format, but with no success: gs.exe -o output.pdf -dPreserveAnnots=false -c "/PreserveAnnotTypes [/Link] def" -f -sDEVICE=pdfwrite input.pdf
Can you please show us how to do it correct, please?
It should look something like this:
gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -c "/PreserveAnnotTypes [/Link] def" -f basic_link_1.pdf
there should not be any more switches after -f, only input filenames
Thanks for your reply,
I try:
gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -c "/PreserveAnnotTypes [/Link] def" -f basic_link_1.pdf
BUT, please note that this is NOT working, unfortunately..... it flatten NOTHING, all annotations are NOT flatten, and hyperlinks are also NOT flatten.
Where is the error regarding the above command SYNTAX, please?
I've tried this and it doesn't work for me either.
gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -dPreserveAnnots=false -c "/PreserveAnnotTypes [/Link] def" -f basic-link-1.pdf
You can report core Ghostscript bugs here: bugs.ghostscript.com
Thank you, Report is done at:
https://github.com/ArtifexSoftware/Ghostscript.NET/issues/116 https://bugs.ghostscript.com/show_bug.cgi?id=707198
Hello, The latest version 10.02 works: gs -sDEVICE=pdfwrite -o output.pdf -c "/PreserveAnnotTypes [/Link] def" -f input.pdf
Thank you!
Please let me ask regarding the wonderful feature -dPreserveAnnots :
Applying { -dPreserveAnnots=false } on a PDF file, it flattens ANNOTATIONS, but also it flattens all the HYPERLINKS contained in the initial pdf file. Is there a way to flatten annotations but keep HYPERLINKS alive, please?