ArtifexSoftware / Ghostscript.NET

Ghostscript.NET - managed wrapper around the Ghostscript library (32-bit & 64-bit)
https://ghostscript.com
GNU Affero General Public License v3.0
391 stars 152 forks source link

-dPreserveAnnotTypes NOT Working #116

Closed Geo-Van closed 11 months ago

Geo-Van commented 11 months ago

-dPreserveAnnotTypes NOT Working

Taking a look under the PreserveAnnots switch here: https://ghostscript.readthedocs.io/en/latest/VectorDevices.html#pdf-file-output-pdfwrite

Trying to apply the -dPreserveAnnotTypes is NOT working, for example lets try the following to preserve HYPERLINKS: Example: 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.

Also we try the following, and it doesn't work either: gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -dPreserveAnnots=false -c "/PreserveAnnotTypes [/Link] def" -f basic-link-1.pdf

Please see the relevant issue at: https://github.com/ArtifexSoftware/Ghostscript.NET/issues/113

Can you please examine where is the error regarding -dPreserveAnnotTypes switch ?

jhabjan commented 11 months ago

Hi Geo-Van, like I said, please report this to the core Ghostscript website: https://bugs.ghostscript.com/

This here is Ghostscript.NET wrapper repository.

Geo-Van commented 11 months ago

Thank you, please see:

https://bugs.ghostscript.com/show_bug.cgi?id=707198

Geo-Van commented 11 months ago

Hello, The latest version 10.02 works: gs -sDEVICE=pdfwrite -o output.pdf -c "/PreserveAnnotTypes [/Link] def" -f input.pdf

Thank you!