These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Sort Comments by Color in Acrobat X

smokiibear
Registered: Nov 29 2010
Posts: 10

I'm not sure if I'm missing it somewhere...but I can no longer sort comments by color, which was a hugely advantageous for my use. Have I missed this option somewhere?

My Product Information:
Acrobat Pro 10.0, Windows
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Correct, you cannot.
smokiibear
Registered: Nov 29 2010
Posts: 10
Again...another aweful step backward in lieu of forward progress. This was a sorting method I used almost dailey enabling me to quickly sort through various categories of notes. Very rediculus that the sort command is there, they just forgot the option.

This is a real big errrr!!!!! Outrageous!
smokiibear
Registered: Nov 29 2010
Posts: 10
Again...another aweful step backward in lieu of forward progress. This was a sorting method I used almost dailey enabling me to quickly sort through various categories of notes. Very rediculus that the sort command is there, they just forgot the option.

This is a real big errrr!!!!! Outrageous!
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Which annotation color do you want to sort by, 'fillColor', 'strokeColor'?

I do not believe Acrobat ever had a built in sort annotation by color.

The sort options for the 'getAnnots' methods are:

ANSB_None — (default) Do not sort; equivalent to not specifying this parameter.
ANSB_Page — Use the page number as the primary sort criteria.
ANSB_Author — Use the author as the primary sort criteria.
ANSB_ModDate — Use the modification date as the primary sort criteria.
ANSB_Type — Use the annotation type as the primary sort criteria.

This method was added with version 5 of Acrobat. I do not remember seeing an option to sort by color in version 5, 6, 7, or 8.

It should be possible for a user to crate a custom function to sort the annotations by color and create a report.

George Kaiser

smokiibear
Registered: Nov 29 2010
Posts: 10
mmm...I'm not sure how to implement what you're saying. I've posted a picture of how I sorted...it was by comment color, which I think is neither fill or stroke.

http://www.badongo.com/pic/11152851

George...if this custom command is avaiable, would you be kind enough to explain it to me?

Thanks.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
I believe George is talking about sorting the annotations through a script, and you are talking about doing it in the GUI of Acrobat.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

smokiibear
Registered: Nov 29 2010
Posts: 10
would this be an easy project for someone?
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Here's a simple script to generate a report of comments sorted by stroke color (which is what the comment properties color well sets):

function compareStrokes(a,b){return (a.strokeColor<b.strokeColor)? -1:1;} 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 by Color 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";a.sort(compareStrokes);for (var i = 0; i < a.length; i++) {rep.writeText(" ");rep.writeText(util.printf(msg,1 + a[i].page,a[i].author,a[i].creationDate));rep.color = a[i].strokeColor;rep.writeText("================================");rep.color = color.black;rep.indent(20);rep.writeText("Contents: " + a[i].contents);rep.outdent(20);}var docReport = rep.open("commentsByColor.pdf");docReport.info.Title = "Comments Summary by Color for " + this.documentFileName;}
OwenW
Registered: Oct 30 2006
Posts: 8
We recently migrated to Acrobat X after what I thought was a thorough testing phase. This issue is a deal-breaker for me. We have to be able to sort comments by color. We color code our comments so we can quickly identify which contractors to assign work to. Why have color if you cannot sort on it? This is just retarded. Why remove a very useful and needed feature? Was it too hard to maintain? I SO wish that someone would come along with another PDF software that would blow Acrobat out of the water.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Another way this could possibly be achieved is to create a script that will assign a value that can be sorted (Subject?) based on the color coding. You would run it in a batch process on your files and could then sort them based on that instead of the defunct color scheme.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

OwenW
Registered: Oct 30 2006
Posts: 8
We use the subject property already, and sorting by subject is not supported, either. Can a script group the comments by color so they can be manipulated all at once (like setting a status on all blue comments once they have been exported to the punchlist)?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Yes, that's possible. Basically you would create an array of all annotations and then filter it by removing the elements you don't want. You can then manipulate the remaining elements.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

OwenW
Registered: Oct 30 2006
Posts: 8
I could use some help here. According the to AJS documentation, the nSortBy method does not have a 'color' parameter, just as George indicated. Nevertheless, we could sort by color in 7, 8 and 9.

I don't need a report, but I do need to sort the comments list by color. I know the functionality did exist, but I'm not sure how to replicate it in JavaScript.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
I've written a method that allows you to easily get annotations of just of a certain color from a document...

  1. function getAnnotsByColor(doc, c) {
  2. doc.syncAnnotScan();
  3. var annots = doc.getAnnots();
  4. if (annots==null) return;
  5. for (var i=annots.length-1; i>=0; i--) {
  6. if (!color.equal(annots[i].strokeColor,c)) {
  7. annots.splice(i,1);
  8. }
  9. }
  10. return annots;
  11. }
Usage examples:
  1. var justYellowAnnots = getAnnotsByColor(this, color.yellow);
  2. var justGreenAnnots = getAnnotsByColor(this, color.green);

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

OwenW
Registered: Oct 30 2006
Posts: 8
try67,

We're getting closer, but I don't want to specify which color I want, I just want to see the comments in the Comments List grouped by color. We used to be able to apply that sorting criteria, and it would collapse the comments list to a list of colors with a plus symbol next to each. If you clicked the plus symbol, all the comments that were of that color expanded to show individually.

I'm not really a JavaScript guy, just getting my feet wet with this. If I can get my head around how to sort the comments inside the comments list, then I think I could cobble together a toolbar button to make the script accessible.

Thanks!
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can't use a script to influence the built-in comments list in Acrobat.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

OwenW
Registered: Oct 30 2006
Posts: 8
They had to go and make this hard. Is there a way to influence the appearance of the comments in the Comments List? I suppose they don't make those methods and properties public.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
No, they don't.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

OwenW
Registered: Oct 30 2006
Posts: 8
I've been doing a little bit of looking and it seems like this should be doable. There are methods out there for creating custom buttons in the toolbar (which Acrobat X may have killed), so forcing the Comments List to do what it used to do should be fairly simple.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Good luck... let us know if you manage.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
OwenW wrote:
I've been doing a little bit of looking and it seems like this should be doable. There are methods out there for creating custom buttons in the toolbar (which Acrobat X may have killed), so forcing the Comments List to do what it used to do should be fairly simple.
Toolbar buttons and menu items can still be added in Acrobat X.

The problem is you can not modify the comments pane in Acrobat to sort by color. You can create a report with the comments sorted by color. But that will be a separate document form the document is reporting on. This will require you to write a custom sort script and generate the report all in JavaScript.

Generating Reports with JavaScript by Dave Wraight, Planet PDF Contributing Editor.

George Kaiser

try67
Expert
Registered: Oct 30 2008
Posts: 2398
I've created a script that allows you to show just comments of a certain color through a simple selection menu under Edit. I think this is the closest you can get to the functionality that existed in earlier versions.
See here for more info and some screenshots: http://try67.blogspot.com/2011/11/acrobat-filter-comments-by-color.html

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

OwenW
Registered: Oct 30 2006
Posts: 8
Gilad,

Neat idea....use JavaScript to grab all comments of a particular color and set their 'hidden' property to 'true'. This should indeed hide them on the Commments List. Let me turn this around in my head a bit...I think this could work out for us!
codywohlers
Registered: Nov 24 2011
Posts: 3
So disappointing that that the major changes from 9 to X seem to be removing features. Very sad... (and stupid)
maxwyss
Registered: Jul 25 2006
Posts: 255
I have developed a tool to sort and manipulate comments in many ways. Sorting by color would be not a very big deal (however, one has to find a convention on how the sorting order of colors should be). So, this tool could be customized. Feel free to contact me in private for more information and quotes.

Hope this can help.

Max Wyss.