Closed ghost closed 6 years ago
Hi @ltenzil ,
Thank you for opening this question.
Here's one possible hack, it accesses a protected method that returns the outline object and clears it. Try it with PDF number 2....:
pdf2.instance_variable_get(:@outlines).clear
If it works out well enough, I might add a public accessor for the next version.
Let me know how it goes and good luck!
Bo.
A quick update:
In the upcoming version, the protected outlines_object
accessor method will be deprecated in favor of a public outlines
accessor.
I've updated the example code I gave you so it directly accessed the internal variable.
pdf2.instance_variable_get(:@outlines).clear
I recommend that you use the public methods once version 1.0.8 is out.
B.
Hey @boazsegev ,
Sorry for late reply. I was out of town. Thank you Bo, it worked like a charm. Will definitely use the accessor, once the version is out. Take care. Hope you had great weekend.
Thanks buddy, LT.
First of all, I appreciate your efforts. Is there an option which i can use to remove the outline/bookmarks while merging with another pdf.
Scenario: I have a pdf A1, with outline/bookmark Title, Cover, Author. In my second pdf A2, also has the same outline/bookmark. As of now after merging, the combined pdf has the same outlines repeated. Expectation: After merging, the combined pdf should have outlines only from the first pdf A1.