Closed xssworm closed 3 years ago
You need to copy the Outlines (which store what you call "Table of contents" or sometimes "Bookmarks") from the original document over. Outlines are stored separately, need something like:
outlineTree := reader.GetOutlineTree()
writer.AddOutlineTree(outlineTree)
Description
Can successfully replace text, but will lose the table of contents.
Expected Behavior
replace the text '取扱説明書' in page 1 use this example: https://github.com/unidoc/unipdf-examples/blob/development/text/pdf_search_replace_advanced.go
Actual Behavior
Steps to reproduce the behavior: $ go run pdf_search_replace_advanced.go quietcontrol-30_ja.pdf output.pdf "取扱説明書" "xxxxxx" Successfully created output.pdf The text was successfully replaced, but the table of contents was lost, and the text becomes invisible.
before:
after:
Attachments
quietcontrol-30_ja.pdf