How to remove PDF bookmarks (from terminal or programatically)?












4















I was surprised that there is no easy way to remove bookmarks from PDF.

pdftk can't do it, ghostscript same AFAIK, qpdf... and there are no other significant tools that I'm aware of



Easiest for me right now is PDF Mod GUI, which removes bookmarks one by one - user has to click on parent bookmark and press remove, so on for all top level nodes which is silly



Also I know there are probably some Java GUIs that can do it, but I don't want to load java just to remove bookmarks when I need to



I could also accept some programmatic solution, python, perl ...










share|improve this question























  • Related: How to import, export and edit bookmarks of a pdf file?

    – Ƭᴇcʜιᴇ007
    Dec 19 '11 at 18:19
















4















I was surprised that there is no easy way to remove bookmarks from PDF.

pdftk can't do it, ghostscript same AFAIK, qpdf... and there are no other significant tools that I'm aware of



Easiest for me right now is PDF Mod GUI, which removes bookmarks one by one - user has to click on parent bookmark and press remove, so on for all top level nodes which is silly



Also I know there are probably some Java GUIs that can do it, but I don't want to load java just to remove bookmarks when I need to



I could also accept some programmatic solution, python, perl ...










share|improve this question























  • Related: How to import, export and edit bookmarks of a pdf file?

    – Ƭᴇcʜιᴇ007
    Dec 19 '11 at 18:19














4












4








4








I was surprised that there is no easy way to remove bookmarks from PDF.

pdftk can't do it, ghostscript same AFAIK, qpdf... and there are no other significant tools that I'm aware of



Easiest for me right now is PDF Mod GUI, which removes bookmarks one by one - user has to click on parent bookmark and press remove, so on for all top level nodes which is silly



Also I know there are probably some Java GUIs that can do it, but I don't want to load java just to remove bookmarks when I need to



I could also accept some programmatic solution, python, perl ...










share|improve this question














I was surprised that there is no easy way to remove bookmarks from PDF.

pdftk can't do it, ghostscript same AFAIK, qpdf... and there are no other significant tools that I'm aware of



Easiest for me right now is PDF Mod GUI, which removes bookmarks one by one - user has to click on parent bookmark and press remove, so on for all top level nodes which is silly



Also I know there are probably some Java GUIs that can do it, but I don't want to load java just to remove bookmarks when I need to



I could also accept some programmatic solution, python, perl ...







linux pdf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 19 '11 at 16:59









zetahzetah

366513




366513













  • Related: How to import, export and edit bookmarks of a pdf file?

    – Ƭᴇcʜιᴇ007
    Dec 19 '11 at 18:19



















  • Related: How to import, export and edit bookmarks of a pdf file?

    – Ƭᴇcʜιᴇ007
    Dec 19 '11 at 18:19

















Related: How to import, export and edit bookmarks of a pdf file?

– Ƭᴇcʜιᴇ007
Dec 19 '11 at 18:19





Related: How to import, export and edit bookmarks of a pdf file?

– Ƭᴇcʜιᴇ007
Dec 19 '11 at 18:19










5 Answers
5






active

oldest

votes


















3














If you have Adobe Acrobat Pro you can remove all the bookmarks of your front PDF document using the following simple AppleScript:



tell application "Adobe Acrobat Pro"
delete bookmarks of document 1
end tell





share|improve this answer































    2














    The easy way I've found to remove all bookmarks from a PDF has been just opening the document and printing it as PDF into a new file.



    It works, it's fast, and it's simple.






    share|improve this answer































      1














      This worked for me:



      pdf2ps mypdf.pdf


      I get mypdf.ps, I rename it to mypdf2.ps



      ps2pdf mypdf2.ps


      The mypdf2.pdf file that I get has no bookmarks



      Both programs come with the ghostscript package






      share|improve this answer
























      • Despite thrashing my HD, calling ghostscript twice is slower and more memory intensive then loading worse java GUI to handle the problem. It's easier to just print the PDF to another PDF as I'll at least get PDF product with text layer, unlike your example, and faster

        – zetah
        Dec 21 '11 at 0:56



















      0














      Here is one easy (though not necessarily cheap) way.




      1. Use Adobe Acrobat DC (or Pro whatever version).

      2. Go here and install the Action "Remove hidden information".


      This action also allows you to remove other annoying hidden information other than bookmarks (see image below). This can help reduce the file size.



      Used in tandem with Adobe Acrobat's Action Wizard, you can also batch delete bookmarks from any number of PDFs.



      enter image description here






      share|improve this answer

































        0














        A solution with pdftk from www.witti.ws:




        The solution is to specify the page range of the PDF. The documented behavior of the cat operation is to only preserve bookmarks when no page range is specified. It also confirms that A1-end will always include the entire PDF. Testing confirms that this purges the PDF of any bookmarks.




        pdftk A=example_input.pdf cat A1-end output example_output.pdf


        That worked for me.






        share|improve this answer























          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f369556%2fhow-to-remove-pdf-bookmarks-from-terminal-or-programatically%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          If you have Adobe Acrobat Pro you can remove all the bookmarks of your front PDF document using the following simple AppleScript:



          tell application "Adobe Acrobat Pro"
          delete bookmarks of document 1
          end tell





          share|improve this answer




























            3














            If you have Adobe Acrobat Pro you can remove all the bookmarks of your front PDF document using the following simple AppleScript:



            tell application "Adobe Acrobat Pro"
            delete bookmarks of document 1
            end tell





            share|improve this answer


























              3












              3








              3







              If you have Adobe Acrobat Pro you can remove all the bookmarks of your front PDF document using the following simple AppleScript:



              tell application "Adobe Acrobat Pro"
              delete bookmarks of document 1
              end tell





              share|improve this answer













              If you have Adobe Acrobat Pro you can remove all the bookmarks of your front PDF document using the following simple AppleScript:



              tell application "Adobe Acrobat Pro"
              delete bookmarks of document 1
              end tell






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 23 '12 at 17:57









              organognosiorganognosi

              392




              392

























                  2














                  The easy way I've found to remove all bookmarks from a PDF has been just opening the document and printing it as PDF into a new file.



                  It works, it's fast, and it's simple.






                  share|improve this answer




























                    2














                    The easy way I've found to remove all bookmarks from a PDF has been just opening the document and printing it as PDF into a new file.



                    It works, it's fast, and it's simple.






                    share|improve this answer


























                      2












                      2








                      2







                      The easy way I've found to remove all bookmarks from a PDF has been just opening the document and printing it as PDF into a new file.



                      It works, it's fast, and it's simple.






                      share|improve this answer













                      The easy way I've found to remove all bookmarks from a PDF has been just opening the document and printing it as PDF into a new file.



                      It works, it's fast, and it's simple.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Sep 10 '18 at 14:08









                      sharcashmosharcashmo

                      1214




                      1214























                          1














                          This worked for me:



                          pdf2ps mypdf.pdf


                          I get mypdf.ps, I rename it to mypdf2.ps



                          ps2pdf mypdf2.ps


                          The mypdf2.pdf file that I get has no bookmarks



                          Both programs come with the ghostscript package






                          share|improve this answer
























                          • Despite thrashing my HD, calling ghostscript twice is slower and more memory intensive then loading worse java GUI to handle the problem. It's easier to just print the PDF to another PDF as I'll at least get PDF product with text layer, unlike your example, and faster

                            – zetah
                            Dec 21 '11 at 0:56
















                          1














                          This worked for me:



                          pdf2ps mypdf.pdf


                          I get mypdf.ps, I rename it to mypdf2.ps



                          ps2pdf mypdf2.ps


                          The mypdf2.pdf file that I get has no bookmarks



                          Both programs come with the ghostscript package






                          share|improve this answer
























                          • Despite thrashing my HD, calling ghostscript twice is slower and more memory intensive then loading worse java GUI to handle the problem. It's easier to just print the PDF to another PDF as I'll at least get PDF product with text layer, unlike your example, and faster

                            – zetah
                            Dec 21 '11 at 0:56














                          1












                          1








                          1







                          This worked for me:



                          pdf2ps mypdf.pdf


                          I get mypdf.ps, I rename it to mypdf2.ps



                          ps2pdf mypdf2.ps


                          The mypdf2.pdf file that I get has no bookmarks



                          Both programs come with the ghostscript package






                          share|improve this answer













                          This worked for me:



                          pdf2ps mypdf.pdf


                          I get mypdf.ps, I rename it to mypdf2.ps



                          ps2pdf mypdf2.ps


                          The mypdf2.pdf file that I get has no bookmarks



                          Both programs come with the ghostscript package







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 20 '11 at 10:26









                          golimargolimar

                          691420




                          691420













                          • Despite thrashing my HD, calling ghostscript twice is slower and more memory intensive then loading worse java GUI to handle the problem. It's easier to just print the PDF to another PDF as I'll at least get PDF product with text layer, unlike your example, and faster

                            – zetah
                            Dec 21 '11 at 0:56



















                          • Despite thrashing my HD, calling ghostscript twice is slower and more memory intensive then loading worse java GUI to handle the problem. It's easier to just print the PDF to another PDF as I'll at least get PDF product with text layer, unlike your example, and faster

                            – zetah
                            Dec 21 '11 at 0:56

















                          Despite thrashing my HD, calling ghostscript twice is slower and more memory intensive then loading worse java GUI to handle the problem. It's easier to just print the PDF to another PDF as I'll at least get PDF product with text layer, unlike your example, and faster

                          – zetah
                          Dec 21 '11 at 0:56





                          Despite thrashing my HD, calling ghostscript twice is slower and more memory intensive then loading worse java GUI to handle the problem. It's easier to just print the PDF to another PDF as I'll at least get PDF product with text layer, unlike your example, and faster

                          – zetah
                          Dec 21 '11 at 0:56











                          0














                          Here is one easy (though not necessarily cheap) way.




                          1. Use Adobe Acrobat DC (or Pro whatever version).

                          2. Go here and install the Action "Remove hidden information".


                          This action also allows you to remove other annoying hidden information other than bookmarks (see image below). This can help reduce the file size.



                          Used in tandem with Adobe Acrobat's Action Wizard, you can also batch delete bookmarks from any number of PDFs.



                          enter image description here






                          share|improve this answer






























                            0














                            Here is one easy (though not necessarily cheap) way.




                            1. Use Adobe Acrobat DC (or Pro whatever version).

                            2. Go here and install the Action "Remove hidden information".


                            This action also allows you to remove other annoying hidden information other than bookmarks (see image below). This can help reduce the file size.



                            Used in tandem with Adobe Acrobat's Action Wizard, you can also batch delete bookmarks from any number of PDFs.



                            enter image description here






                            share|improve this answer




























                              0












                              0








                              0







                              Here is one easy (though not necessarily cheap) way.




                              1. Use Adobe Acrobat DC (or Pro whatever version).

                              2. Go here and install the Action "Remove hidden information".


                              This action also allows you to remove other annoying hidden information other than bookmarks (see image below). This can help reduce the file size.



                              Used in tandem with Adobe Acrobat's Action Wizard, you can also batch delete bookmarks from any number of PDFs.



                              enter image description here






                              share|improve this answer















                              Here is one easy (though not necessarily cheap) way.




                              1. Use Adobe Acrobat DC (or Pro whatever version).

                              2. Go here and install the Action "Remove hidden information".


                              This action also allows you to remove other annoying hidden information other than bookmarks (see image below). This can help reduce the file size.



                              Used in tandem with Adobe Acrobat's Action Wizard, you can also batch delete bookmarks from any number of PDFs.



                              enter image description here







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Aug 19 '15 at 13:15

























                              answered Aug 19 '15 at 7:59









                              Kenny LJKenny LJ

                              1812924




                              1812924























                                  0














                                  A solution with pdftk from www.witti.ws:




                                  The solution is to specify the page range of the PDF. The documented behavior of the cat operation is to only preserve bookmarks when no page range is specified. It also confirms that A1-end will always include the entire PDF. Testing confirms that this purges the PDF of any bookmarks.




                                  pdftk A=example_input.pdf cat A1-end output example_output.pdf


                                  That worked for me.






                                  share|improve this answer




























                                    0














                                    A solution with pdftk from www.witti.ws:




                                    The solution is to specify the page range of the PDF. The documented behavior of the cat operation is to only preserve bookmarks when no page range is specified. It also confirms that A1-end will always include the entire PDF. Testing confirms that this purges the PDF of any bookmarks.




                                    pdftk A=example_input.pdf cat A1-end output example_output.pdf


                                    That worked for me.






                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      A solution with pdftk from www.witti.ws:




                                      The solution is to specify the page range of the PDF. The documented behavior of the cat operation is to only preserve bookmarks when no page range is specified. It also confirms that A1-end will always include the entire PDF. Testing confirms that this purges the PDF of any bookmarks.




                                      pdftk A=example_input.pdf cat A1-end output example_output.pdf


                                      That worked for me.






                                      share|improve this answer













                                      A solution with pdftk from www.witti.ws:




                                      The solution is to specify the page range of the PDF. The documented behavior of the cat operation is to only preserve bookmarks when no page range is specified. It also confirms that A1-end will always include the entire PDF. Testing confirms that this purges the PDF of any bookmarks.




                                      pdftk A=example_input.pdf cat A1-end output example_output.pdf


                                      That worked for me.







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Jan 31 at 11:13









                                      nevromenevrome

                                      1063




                                      1063






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to Super User!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f369556%2fhow-to-remove-pdf-bookmarks-from-terminal-or-programatically%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown