• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Print comments only

New Here ,
Jun 15, 2012 Jun 15, 2012

Copy link to clipboard

Copied

Is there a way to print comments only in a continuous fashion, not just one per page?  I have many short comments and need to print these out on just a few sheets.

I've looked at a similar question from 2010 with one answer suggesting Java Script, but no link or details, and unfortunately I don't know how to pursue this.

I have tried several possibilities including converting to Word, but this results in individual pages as well.  Also, since the PDF page numbers are in a header, it isn't possibly to replace the "section break--new page" with just a line break!  I tried using small paper size to print multiple pages on one sheet, but each page shrinks so that it is unreadable.  Is there a way to put multiple pages on one sheet without any reduction in the original font size?

Thanks for any help.  Using Acrobat X Pro in Windows XP Pro.

Views

30.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jun 17, 2012 Jun 17, 2012

The best way to do it is by scripting a new PDF Report. Open the JS console (ctrl-J) and clear it, then paste in the following code:

this.syncAnnotScan();

var a = this.getAnnots();

if (a) {

  var rep = new Report();

  rep.size = 1.8;

  rep.color = color.blue;

  rep.writeText("Summary of Comments for " + this.documentFileName);

  rep.color = color.black;

  rep.writeText(" ");

  rep.size = 1.2;

  rep.writeText("Total of " + a.length + " comments in this file");

  rep.writeText(" ");

  rep.writeText(" ");

  rep.

...

Votes

Translate

Translate
LEGEND ,
Jun 17, 2012 Jun 17, 2012

Copy link to clipboard

Copied

The best way to do it is by scripting a new PDF Report. Open the JS console (ctrl-J) and clear it, then paste in the following code:

this.syncAnnotScan();

var a = this.getAnnots();

if (a) {

  var rep = new Report();

  rep.size = 1.8;

  rep.color = color.blue;

  rep.writeText("Summary of Comments for " + this.documentFileName);

  rep.color = color.black;

  rep.writeText(" ");

  rep.size = 1.2;

  rep.writeText("Total of " + a.length + " comments in this file");

  rep.writeText(" ");

  rep.writeText(" ");

  rep.indent(20);

  var msg = "\200 page %s by %s on %s";

  for (var i = 0; i < a.length; i++) {

    rep.writeText(" ");

    rep.writeText(util.printf(msg,1 + a.page,a.author,a.creationDate)); 

    rep.indent(20);

    rep.writeText(a.contents);

    rep.outdent(20);

  }

  var docReport = rep.open("commentSummary.pdf");

  docReport.info.Title = "Comments Summary for " + this.documentFileName;

}

Select it all and press ENTER on your numeric keypad (or ctrl+Return on the main keypad). A new PDF will appear with all your comments in. You can customize the code to set how the Report is laid out, see the Acrobat SDK documentation for what the commands are, but it's relatively simple to work it out from the example above.

You can also drop the code into an Action (using a JavaScript step) and set the Action to run against the current file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 17, 2012 Jun 17, 2012

Copy link to clipboard

Copied

Dave,

Thanks VERY much. I will definitely give this a try. I appreciate your

taking time to do this.

Sincerely, Michele

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 06, 2014 Mar 06, 2014

Copy link to clipboard

Copied

Yes thanks. Wierd that this isn't already one of Adobe's options.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2014 Mar 13, 2014

Copy link to clipboard

Copied

thanks a ton your code has helped me a ton!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 02, 2016 Oct 02, 2016

Copy link to clipboard

Copied

Hi

I keep getting an error when i try this - could be latest (Oct 2016) update to Adobe Acrobat or could be i am missing something? It was working a few weeks ago.

Error:

SyntaxError: syntax error

1:Console:Exec

undefined

ANy help would be appreciated - Win10, Acrobat XI Pro, v 11.0.17

Thanks

Mike

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 02, 2016 Oct 02, 2016

Copy link to clipboard

Copied

Figured it out - i was not highlighting the text when pushing ctrl+enter.

Mike

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

Thank you for the code, BUT when I run the script it does return a new pdf that says it has a total of 87 comments, BUT then the supposedly listed comments all show up on the document as follows:

  • page NaN by undefined on undefined 

 

Any idea what I am doing wrong?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 17, 2014 Aug 17, 2014

Copy link to clipboard

Copied

A slight modification, provided by the moderator (Dave Merchant) in a private message to me, on the above code that orders the comments from oldest to newest (usually this occurs in sync with the document as you read it--unless you read it backwards.

--

this.syncAnnotScan();

var a = this. getAnnots({nSortBy:ANSB_ModDate,bReverse:true});

if (a) {

  var rep = new Report();

  rep.size = 1.8;

  rep.color = color.blue;

  rep.writeText("Summary of Comments for " + this.documentFileName);

  rep.color = color.black;

  rep.writeText(" ");

  rep.size = 1.2;

  rep.writeText("Total of " + a.length + " comments in this file");

  rep.writeText(" ");

  rep.writeText(" ");

  rep.indent(20);

  var msg = "\200 page %s by %s on %s";

  for (var i = 0; i < a.length; i++) {

    rep.writeText(" ");

    rep.writeText(util.printf(msg,1 + a.page,a.author,a.creationDate));

    rep.indent(20);

    rep.writeText(a.contents);

    rep.outdent(20);

  }

  var docReport = rep.open("commentSummary.pdf");

  docReport.info.Title = "Comments Summary for " + this.documentFileName;

}


Jim

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 02, 2015 Feb 02, 2015

Copy link to clipboard

Copied

Wish I had the time to learn more about this...really adds functionality to adobe.  Does anyone know how to make it sort by page?  I'd like the comments in the order of the document not the date I added them.

Would really appreciate it

Corina

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 03, 2015 Feb 03, 2015

Copy link to clipboard

Copied

Did a little research and figured it out! Easy to alter.  Here it is if anyone wants:

this.syncAnnotScan();

var a = this. getAnnots({nSortBy:ANSB_Page});

if (a) {

  var rep = new Report();

  rep.size = 1.8;

  rep.color = color.blue;

  rep.writeText("Summary of Comments for " + this.documentFileName);

  rep.color = color.black;

  rep.writeText(" ");

  rep.size = 1.2;

  rep.writeText("Total of " + a.length + " comments in this file");

  rep.writeText(" ");

  rep.writeText(" ");

  rep.indent(20);

  var msg = "\200 page %s by %s on %s";

  for (var i = 0; i < a.length; i++) {

    rep.writeText(" ");

    rep.writeText(util.printf(msg,1 + a.page,a.author,a.creationDate));

    rep.indent(20);

    rep.writeText(a.contents);

    rep.outdent(20);

  }

  var docReport = rep.open("commentSummary.pdf");

  docReport.info.Title = "Comments Summary for " + this.documentFileName;

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2015 Mar 13, 2015

Copy link to clipboard

Copied

Hi, thanks for your code! there is a way to save the javascript code not only for one session, but for every time i open a pdf? thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 13, 2015 Mar 13, 2015

Copy link to clipboard

Copied

It was someone else's code, I just edited it to make it print by page number

Sorry I don't know the answer to your question.  I'd also like to know how to save scripts, so I hope someone else sees this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 14, 2015 Mar 14, 2015

Copy link to clipboard

Copied

I hope that too!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2015 Mar 14, 2015

Copy link to clipboard

Copied

It is possible to use JavaScript to set up a custom toolbar button or menu item that executes the code when needed. You'd have to place the code in a folder-level JavaScript file in the correct directory. If there's any interest I could provide more details.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2015 Mar 15, 2015

Copy link to clipboard

Copied

Yes, please! You really save my day

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2015 Mar 15, 2015

Copy link to clipboard

Copied

I'd love to know too

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 15, 2015 Mar 15, 2015

Copy link to clipboard

Copied

Here's a revised script that you can place in a folder-level JavaScript file that adds a new menu item (Edit > Comments Report) to the Edit menu. I changed the date/time format of the original to something less wordy, added some page sizes/orientations to select from, and included a variable for the reverse sort (bReverseSort) parameter. Instructions for installing a folder-level JavaScript file can be found here:

https://acrobatusers.com/tutorials/folder_level_scripts

For Windows users of Acrobat 10/11, see: User JavaScript Changes for 10.1.1 (Acrobat | Reader)

// Install this JavaScript file in the user JavaScript folder, which is given by:

//

// app.getPath("user", "javascript");

//

// in Acrobat's interactive JavaScript console: Ctrl + J

// Place the cursor on the line of code and press: Ctrl/Cmd + Enter   -or-   Enter on the numeric keypad

//


// Add a separator bar at the end of the Edit menu

app.addMenuItem({

    cName: "-",

    cParent: "Edit",

    cExec: " "

});

// Add a menu item for the comments report function

app.addMenuItem({

    cName: "AS_comments_report",

    cUser: "Comments Report",

    cParent: "Edit",

    cExec: "AS_comments_report(this);",

    cEnable: "event.rc = app.doc;"

});

AS_comments_report = app.trustedFunction (function (doc) {

    if (app.viewerType === "Reader") {

        app.beginPriv();

        app.alert({

            cMsg: "This comment report utility cannot be used with Adobe Reader. It requires Acrobat Pro or Acrobat Standard.",

            nIcon: 1,  // Warning

            cTitle: "Acrobat required"

        });

        app.endPriv();

        return;

    }

    // Prompt the user for the sorting type

    var aSortTypes = [];

    aSortTypes.push({cName: "Select a sort type below", bEnabled: false});

    aSortTypes.push({cName: "-"});

    aSortTypes.push({cName: "None", cReturn: ANSB_None});

    aSortTypes.push({cName: "Page #", cReturn: ANSB_Page});

    aSortTypes.push({cName: "Author", cReturn: ANSB_Author});

    aSortTypes.push({cName: "Date", cReturn: ANSB_ModDate});

    aSortTypes.push({cName: "Type", cReturn: ANSB_Type});

    var nSortType = app.popUpMenuEx.apply(app, aSortTypes) || ANSB_None;

    // Change to true to reverse the sort order

    var bReverseOrder = false;

    // Specify some page sizes

    var PageSize = {

        letter_portrait: [0, 11 * 72, 8.5 * 72, 0],

        letter_landscape: [0, 8.5 * 72, 11 * 72, 0],

        legal_portrait: [0, 14 * 72, 8.5 * 72, 0],

        legal_landscape: [0, 8.5 * 72, 14 * 72, 0],

        A4_portrait: [0, 11.69 * 72, 8.27 * 72, 0],

        A4_landscape: [0, 8.27 * 72, 11.69 * 72, 0]

    };

    doc.syncAnnotScan();

    var a = doc.getAnnots({nSortBy: nSortType, bReverse: bReverseOrder});

    if (a) {

        var rep = new Report(PageSize.letter_portrait);

        rep.size = 1.8;

        rep.color = color.blue;

        rep.writeText("Summary of Comments for " + doc.documentFileName);

        rep.color = color.black;

        rep.writeText(" ");

        rep.size = 1.2;

        rep.writeText("Total of " + a.length + " comments in this file");

        rep.writeText(" ");

        rep.writeText(" ");

        rep.indent(20);

        var msg = "\200 page %s by %s on %s";

        for (var i = 0; i < a.length; i++) {

            rep.writeText(" ");

            rep.writeText(util.printf(msg, 1 + a.page, a.author, util.printd("yyyy/mm/dd HH:MM:ss", a.creationDate)));

            rep.indent(20);

            rep.writeText(a.contents);

            rep.outdent(20);

        }

        var docReport = rep.open("commentSummary.pdf");

        docReport.info.Title = "Comments Summary for " + doc.documentFileName;

    }

});

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 15, 2015 Mar 15, 2015

Copy link to clipboard

Copied

I had to fix some typos that resulted from some formatting problems, so please use the lasted edited version and not one you may have received via email.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 01, 2015 Apr 01, 2015

Copy link to clipboard

Copied

I am sorry, I am not much of a wizz on this. I seem to understand what the script does but am not an expert on JS at all. I have followed George's instructions:

1 - Navigated to C:\Users\..\AppData\Roaming\Adobe\Acrobat\10.0\JavaScripts\

2 - Opened glob.js (mine was empty) and pasted lines 1 thru 92 from George's post above and saved it.

3 - Also opened glob.settings.js and did same here (when the earlier action yielded below SynthaxError)

4 - Opened a 100 page pdf with 69 of my comments with Acrobat Xpro

5 - pressed CTRL+J (Javascript Debugger) and pasted same into the View frame (Console)

6 - pressed CTRL+Enter

7 - Got the following return: SyntaxError: syntax error

                                        1:Console:Exec

                                        undefined

Can someone tell me what i did wrong? Several attempts with different approaches resulted in the same return. And no new button under the Edit menu. Thanks for your help.

Regards,

Thiemen

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 02, 2015 Apr 02, 2015

Copy link to clipboard

Copied

You should remove what you added to the glob.js and glob.settings.js files if they still contain what you added. You should place the code in a separate file that you create, and you have an updated version of Acrobat 10 on Windows you will have to manually create a folder and place the JavaScript file in it. For more information, see: User JavaScript Changes for 10.1.1 (Acrobat | Reader)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

When I tried to locate the local user folder:

app.getPath("user", "javascript");

GeneralError: Operation failed.

App.getPath:1:Console undefined:Exec

2

undefined

So I just try to run the whole thing from the console manually but pasting it in, selecting all, then hitting enter on the number pad. The first time nothing happens.  It just selects everything from line 1-92. Second time it says:

SyntaxError: function statement requires a name

93:Console:Exec

undefined

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

It won't work from the console. The reason for your other problem with the getPath statement is the user JavaScript folder doesn't exist, so you have to manually create it. If you need help creating it. post again and include what OS and version of Acrobat you're using.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2015 Sep 11, 2015

Copy link to clipboard

Copied

George, if you could provide this solution, that would be awesome. Thanks. Scott

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2015 Sep 11, 2015

Copy link to clipboard

Copied

oops/  I see it. Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines