Timolution
Banded Mongoose
Yes, can confirm that this works perfectly!I found another solution.
This requires that you install homebrew (https://brew.sh). Once you install Homebrew, you install the package Poppler.
Bash:brew install poppler
The from the command line, you run:
Bash:pdftocairo -pdf mongoose_pdf.pdf mongoose_pdf_repaired.pdf
It is true that you lose the TOC/Bookmarks this, but it is in fact very easy to restore these from the original PDF! You will need the following:Pdftocairo worked well for me, only it killed the bookmarks and hyperlinks. And then I ran it through a PDF compressor. PDF Expert to be precise. Will have to look at some of the PDFs I had issues with and re-mux and compress them and see how important the bookmarks are..
- The original Mongoose PDF (mong.pdf in explanation below)
- Your 'fixed' pdf using apastuszak's pdftocairo method (fixed.pdf in explanation below)
- pdftk
Code:
brew install pdftk-java
This will also install any necessary dependencies (mainly openjdk).
When this is installed it becomes a matter of extracting the TOC/bookmark data (well, there's a bit more in there than just that, but we're mainly interested in the bookmarks) for the original Mongoose PDF and merging this data with the fixed pdf file.
First you extract the data*:
Code:
pdftk /path/to/mong.pdf dump_data_utf8 output data.txt
Then you merge the extracted data with the pdftocairo output file:
Code:
pdftk /path/to/fixed.pdf update_info_utf8 /path/to/data.txt output Fixed_Bookmarks.pdf
Et voilà, the Fixed_Bookmarks.pdf will now be your desired fixed pdf with all the original bookmarks intact!
*Note that you can now easily manipulate this data file in a text editor in order to add your own bookmarks or to change the nesting level of existing bookmarks.
Last edited: