[Tool] Generate a report summary of markups  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Mathew
User
Posts: 567
Joined: Thu Jun 19, 2014 7:30 pm

[Tool] Generate a report summary of markups  SOLVED

Post by Mathew »

For markups in pdfs I don't know of a built-in tool to generate a simple text summary of the markups. This tool will generate a text report, summarized by any of the markup parameters. It can either output the text (contents property) of the markup, or count them (and for the dimension, perimeter, and area tools add up the totals).
image(1).png
This tool is inspired by forum posts viewtopic.php?t=45812 and viewtopic.php?t=27327

Usage
If you only want to summarize select markups, first select the markups, and run the tool (Comments > Report Comments...)
image(2).png
It will open a dialog:
image.png
Summarize By
  • You can add or remove the summary levels. In the picture above, the summary will be first by comment author, then by the strokeColor of the markup.
Action
  • This option is to either count the number of markups for this particular summary item (or add up lengths, areas), or to output the contents (text) of the markups.
Options
  • Use Color Names: If checked, it tries to get a plain-text description of the color (ie "Orange"). Otherwise it will output the color in hexadecimal (web) format.
    You can also adjust the amount each level of the summary indents, and the relative text size. I think this is a multiplier on 11pt text.
    Decimal and Thousands separators: If your locale uses different separators, change them here. The script needs to change the text of the dimensions to a number, so if these are wrong, it won't know that 1.000 = 1000 not 1 for instance.
Installation
Extract (unzip) the zip file and save the files into the JavaScript folder (either in %APPDATA%\Tracker Software\PDFXEditor\3.0\JavaScripts or in the application folder). After restarting PDF XChange it will add a menu item "Report Comments…" to the Comment ribbon and to the Comment menu (in the classic UI)
image(3).png
If you want to minimize the number of files: At an absolute minimum, you need "annotReport.js". "1ang.js" enables translation files, and "xutil.colorUtils.js" enables the text version of colors.
annotReport v0.1.zip
Translations
This tool can be translated into other languages. Here's the language file (the tool at viewtopic.php?p=186101#p186101 will help editing it)
translationData.annotReport.json.zip
You do not have the required permissions to view the files attached to this post.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10998
Joined: Wed Jan 03, 2018 6:52 pm

[Tool] Generate a report summary of markups

Post by Daniel - PDF-XChange »

:)
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
PHK
User
Posts: 1394
Joined: Tue Nov 24, 2020 4:02 pm

Re: [Tool] Generate a report summary of markups

Post by PHK »

As a Java neophyte, I am having a problem getting the tool operative.

I have downloaded and saved the zipped files as instructed but when I try to open the main file, I get this:
image.png
Advice?
You do not have the required permissions to view the files attached to this post.
All best,

FringePhil
Mathew
User
Posts: 567
Joined: Thu Jun 19, 2014 7:30 pm

Re: [Tool] Generate a report summary of markups

Post by Mathew »

Don’t open the file inside the .zip file. Copy it to the JavaScripts folder. You may need to create it. See the instructions at the end of the first post
User avatar
PHK
User
Posts: 1394
Joined: Tue Nov 24, 2020 4:02 pm

Re: [Tool] Generate a report summary of markups

Post by PHK »

Right! I got it working and it looks great. From this the user can use the Accounting Calculator (cutting and pasting) to sum up the data. Again, thank you, Mathew!
All best,

FringePhil
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10998
Joined: Wed Jan 03, 2018 6:52 pm

[Tool] Generate a report summary of markups

Post by Daniel - PDF-XChange »

:)
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
User avatar
PHK
User
Posts: 1394
Joined: Tue Nov 24, 2020 4:02 pm

Re: [Tool] Generate a report summary of markups

Post by PHK »

PHK wrote: Sun May 11, 2025 2:22 pm Right! I got it working and it looks great. From this the user can use the Accounting Calculator (cutting and pasting) to sum up the data. Again, thank you, Mathew!
[/quote/]

...or perhaps even better yet, convert to an spreadsheet (Excel or other) format and use the Sum function to calculate.
All best,

FringePhil
Mathew
User
Posts: 567
Joined: Thu Jun 19, 2014 7:30 pm

Re: [Tool] Generate a report summary of markups

Post by Mathew »

PHK wrote: Sun May 11, 2025 2:22 pm Right! I got it working and it looks great. From this the user can use the Accounting Calculator (cutting and pasting) to sum up the data. Again, thank you, Mathew!
I’m thinking the tool should be able to do the summing and eliminate the second step. Let me stew on this a bit: there should be a way to recognize currency as well as just plain numbers in the content. What else?
User avatar
PHK
User
Posts: 1394
Joined: Tue Nov 24, 2020 4:02 pm

Re: [Tool] Generate a report summary of markups

Post by PHK »

Mathew wrote: Tue May 13, 2025 5:36 pm ...
I’m thinking the tool should be able to do the summing and eliminate the second step. Let me stew on this a bit: there should be a way to recognize currency as well as just plain numbers in the content. What else?
Gosh, man, that's a bit ambitious! There are so many possible input variables, I would be amazed if you could produce something with the flexablility to do that. I find that even dumping the output into an Excel file requires a fair amount of fine-tuning depending on the nature of the content. For instance, summing linear feet (of OP's original example) will be a great deal different from summing square footage or, heaven forbid, currency amounts. Fortunately, that is doable with Excel formulae.
All best,

FringePhil
Mathew
User
Posts: 567
Joined: Thu Jun 19, 2014 7:30 pm

Re: [Tool] Generate a report summary of markups

Post by Mathew »

I made a new version with quite a few changes. I won't update the first post yet, just in case there are problems with this -- I've not had time to test it much. It now has a lot of options, so I moved them to a separate dialog:
image.png
Briefly:
  • You can pick whether to include blank, text or currency in sums, and whether any text inside a comment disqualifies it as a number. "Summing" text just makes a long string of all the text items.
  • For Accounting/Currency format, there's a dropdown menu at the left with some presets that will load into the three settings. Easiest is to find one that's closest to what you use, and modify the regular expression. The currency is found in text using the regular expression shown, with two matching groups, one for negative numbers | another for positive numbers. RE group is the index on the array returned by RegExp.exec(). When the total is output, it uses util.printf() and the format strings for negative,positive numbers is in the lower right corner.
annotReport v1.0.zip
changes since v0.1
  • add a separate dialog for settings;
  • separate sum, count and output actions;
  • sum currency & numbers;
  • enter page numbers to include in report;
  • sort properties list alphabetically;
  • separate sums by length, area, number, text, blank;
  • add newline when combining text;
  • get text from richContents if there is any;
  • option whether to include blank, text, currency contents in sums;
  • get multiple numbers or currency inside a single comment;
  • user editable regex for currency and some presets
You do not have the required permissions to view the files attached to this post.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10998
Joined: Wed Jan 03, 2018 6:52 pm

Re: [Tool] Generate a report summary of markups

Post by Daniel - PDF-XChange »

Hello, Mathew

Thank you once again for a hard work you put into these areas. It is muchly appreciated! :D

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com