mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-11 00:15:26 +00:00
PDF Optimizer > Discard User Data gets "Discard external cross-references", off by default. It takes GoToR, GoToE, Launch and ImportData actions, and Thread actions with an /F, out of the actions of link annotations and bookmarks, and the actions chained after one through /Next take its place in order. Other annotations, such as form fields, keep their actions. A link left with no action and no /Dest is removed from its page; when the link is an indirect object, that object is rewritten without the action for anything else that refers to it. A bookmark keeps its title, place and children, including a bookmark stored directly inside another one. Links within the document and web links stay. An indirect action that changes is written as a new indirect object, except the first action left at the head of an /A, which is copied into the /A directly when other actions follow it. Objects that use the old action keep it. An /A with more than 100,000 values to check, or one that opens another document and needs more than 100,000 values to rewrite, stops the optimization with OptimizeError::ExternalRefLimit, and so does an outline of more than 100,000 bookmarks. doc_optimize takes discard_external_refs and reports external_links and external_bookmarks.