Skip to main content
Inspiring
November 13, 2018
Answered

pdfComments with commentType == UNDERLINE_TEXT_TYPE -- how to access

  • November 13, 2018
  • 2 replies
  • 2322 views

How can I get the relevant text? (same question applies to other comment types -- replace and delete.)

I suspected commentPathGeometry -- but that just returns object no longer exists

myDoc=app.activeDocument;

i=278; // random comment -- it's underlined

    c=myDoc.pdfComments;

    $.writeln(c.commentType); // returns correct type

    $.writeln(c.commentContent); // content is blank

    $.writeln(c.commentPathGeometry); // crashes here

Thanks

This topic has been closed for replies.
Correct answer Laubender

change underlined text to italics (underlining is the standard way of marking up PDFs by editors)


Thanks.

Hm. Just tried explicitely this commenting type, but there is no way to show the comments on the page:

From Acrobat Pro:

Comments imported. No widget on the page:

Properties of comments:

0    commentReviewer    ADMIN

0    commentContent   

0    commentDate    Wed Nov 14 2018 17:10:46 GMT+0100

0    commentType    SQUIGGLY_TEXT_TYPE

0    commentFilePath    F:\…\UnderlineCommentImported-CC-2019-14.0.1.209-Commented.pdf

0    commentPathGeometry    Die angeforderte Aktion konnte nicht ausgeführt werden, da das Objekt nicht mehr existiert.

0    commentStatus    OPEN_STATUS

0    commentIsOrphan    true

0    commentIsApplied    Die angeforderte Aktion konnte nicht ausgeführt werden, da das Objekt nicht mehr existiert.

0    id    248

0    label   

0    name   

0    isValid    true

0    parent    [object Document]

0    index    0

0    properties    [object Object]

0    events    [object Events]

0    eventListeners    [object EventListeners]

0    replies    [object Replies]

0    isValid    true

1    commentReviewer    ADMIN

1    commentContent   

1    commentDate    Wed Nov 14 2018 17:15:34 GMT+0100

1    commentType    SQUIGGLY_TEXT_TYPE

1    commentFilePath    F:\…\UnderlineCommentImported-CC-2019-14.0.1.209-Commented.pdf

1    commentPathGeometry    Die angeforderte Aktion konnte nicht ausgeführt werden, da das Objekt nicht mehr existiert.

1    commentStatus    OPEN_STATUS

1    commentIsOrphan    true

1    commentIsApplied    Die angeforderte Aktion konnte nicht ausgeführt werden, da das Objekt nicht mehr existiert.

1    id    250

1    label   

1    name   

1    isValid    true

1    parent    [object Document]

1    index    1

1    properties    [object Object]

1    events    [object Events]

1    eventListeners    [object EventListeners]

1    replies    [object Replies]

1    isValid    true

Sigh. I'll file a bug report on this.

Regards,
Uwe

2 replies

Robert at ID-Tasker
Legend
March 10, 2024

FDF file is required:

 

 

More play with margins is needed.

 

Community Expert
November 14, 2018

Hi akiva_atwood ,

I guess that some properties are not available with certain types of comments.

What will a code snippet like the one below reveal?

var doc = app.documents[0];

var pdfCommentsArray = doc.pdfComments.everyItem().getElements();

var pdfCommentsArrayLength = pdfCommentsArray.length;

for( var n=0; n<pdfCommentsArrayLength; n++ )

{

    for( x in pdfCommentsArray)

    {

        try

        {

        $.writeln( n +"\t"+ x +"\t"+ pdfCommentsArray.toString() );

        }catch(e){ n +"\t"+ x +"\t"+ e.message }

      

    }

  

};

Regards,
Uwe

Inspiring
November 14, 2018

Hi Uwe

I ran it for 5 comments to save time (getting the index takes a while):

275 commentReviewer משפחה

275 commentContent a

275 commentDate Thu Oct 25 2018 07:54:19 GMT+0300

275 commentType REPLACE_TEXT_TYPE

275 commentFilePath Macintosh HD:Users:akivaatwood:Documents:Documents - Akiva’s MacBook Air:books:Current Book Projects:Soskil:2019.pdf

275 commentStatus OPEN_STATUS

275 commentIsOrphan false

275 commentIsApplied false

275 id 11950

275 label

275 name

275 isValid true

275 parent [object Document]

275 index 275

275 properties [object Object]

275 events [object Events]

275 eventListeners [object EventListeners]

275 replies [object Replies]

275 isValid true

276 commentReviewer משפחה

276 commentContent

276 commentDate Thu Oct 25 2018 07:54:24 GMT+0300

276 commentType UNDERLINE_TEXT_TYPE

276 commentFilePath Macintosh HD:Users:akivaatwood:Documents:Documents - Akiva’s MacBook Air:books:Current Book Projects:Soskil:2019.pdf

276 commentStatus OPEN_STATUS

276 commentIsOrphan false

276 id 11958

276 label

276 name

276 isValid true

276 parent [object Document]

276 index 276

276 properties [object Object]

276 events [object Events]

276 eventListeners [object EventListeners]

276 replies [object Replies]

276 isValid true

277 commentReviewer משפחה

277 commentContent h

277 commentDate Thu Oct 25 2018 07:54:29 GMT+0300

277 commentType INSERT_TEXT_TYPE

277 commentFilePath Macintosh HD:Users:akivaatwood:Documents:Documents - Akiva’s MacBook Air:books:Current Book Projects:Soskil:2019.pdf

277 commentStatus OPEN_STATUS

277 commentIsOrphan false

277 commentIsApplied false

277 id 11971

277 label

277 name

277 isValid true

277 parent [object Document]

277 index 277

277 properties [object Object]

277 events [object Events]

277 eventListeners [object EventListeners]

277 replies [object Replies]

277 isValid true

278 commentReviewer משפחה

278 commentContent

278 commentDate Thu Oct 25 2018 07:54:35 GMT+0300

278 commentType UNDERLINE_TEXT_TYPE

278 commentFilePath Macintosh HD:Users:akivaatwood:Documents:Documents - Akiva’s MacBook Air:books:Current Book Projects:Soskil:2019.pdf

278 commentStatus OPEN_STATUS

278 commentIsOrphan false

278 id 11956

278 label

278 name

278 isValid true

278 parent [object Document]

278 index 278

278 properties [object Object]

278 events [object Events]

278 eventListeners [object EventListeners]

278 replies [object Replies]

278 isValid true

279 commentReviewer משפחה

279 commentContent

279 commentDate Thu Oct 25 2018 07:54:39 GMT+0300

279 commentType UNDERLINE_TEXT_TYPE

279 commentFilePath Macintosh HD:Users:akivaatwood:Documents:Documents - Akiva’s MacBook Air:books:Current Book Projects:Soskil:2019.pdf

279 commentStatus OPEN_STATUS

279 commentIsOrphan false

279 id 11948

279 label

279 name

279 isValid true

279 parent [object Document]

279 index 279

279 properties [object Object]

279 events [object Events]

279 eventListeners [object EventListeners]

279 replies [object Replies]

279 isValid true

Community Expert
November 14, 2018

Any idea why isValid is duplicated in the properties? Also a bug?


No. You'll find isValid two times with a lot of ( every? ) object in the DOM.

Hm. You mentioned color green for underline. Could be that I customized the color with my Acrobat Pro DC. And that could be the cause that InDesign CC 2019 is not showing the widgets. Just a guess…

Regards,
Uwe