inReplyTo not updating in JS

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

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

[email protected]
User
Posts: 4
Joined: Wed Mar 13, 2024 5:41 pm

inReplyTo not updating in JS

Post by [email protected] »

When using JS I am attempting to, for example modify a lines color based on its State. /State in pdf nomenclature. As I understand it, a line doesn't have a /State so instead an invisible text object is created that contains a /IRT referring back to the /NM of the line. This /IRT value is being correctly written to the file structure of the pdf but not in this.getAnnots(). The key appears but is always left empty. My workaround for the time being is to write and then read an FDF which exposes more keys and values but it's pretty clunky
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3618
Joined: Thu Jul 08, 2004 10:36 pm

Re: inReplyTo not updating in JS

Post by Ivan - Tracker Software »

I'm not sure I clearly understood what exactly does not work.

Can you please provide a sample JS code with the issue?
PDF-XChange Co Ltd. (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
User avatar
Mathew
User
Posts: 952
Joined: Thu Jun 19, 2014 7:30 pm

Re: inReplyTo not updating in JS

Post by Mathew »

Hi Ivan,

[build 403] I realize it's a bit of an old topic, and maybe not exactly what the OP was asking about but .inReplyTo property is definitely acting weirdly.

page 1. If I assign the name of an annotation to another annotation's inReplyTo property, it sticks. However, after that, it's impossible to remove, or maybe I'm doing it wrong(?)

Code: Select all

this.getAnnots(this.pageNum).forEach(a => a.inReplyTo='')
image.png
page 2. If any of the annotations have the property .refType set to "Group" then pdf-xchange will always return an empty string for the inReplyTo property on that annotation.
image(1).png
The attached test pdf has a button that runs the following script to output the relevant properties of the annotations on that page

Code: Select all

console.show();
var anns = this.getAnnots(this.pageNum);
for (var k in anns) {
var ann = anns[k];
console.println(['name: ' + ann.name,'refType: ' + ann.refType,'inReplyTo: ' + ann.inReplyTo]);
}
test grouping.pdf


Also, once an annotation has inReplyTo set to another annotation's name, the fence selection method will select the other annotation (regardless of the refType value):
select fence.gif
From ISO 32000 (for reference)
image(2).png
image(3).png
image(4).png
You do not have the required permissions to view the files attached to this post.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 13315
Joined: Wed Jan 03, 2018 6:52 pm

Re: inReplyTo not updating in JS

Post by Daniel - PDF-XChange »

Hello, Mathew

Thank you for passing it along, I have let Ivan know that the requested details are here for review. We will get back to you as soon as he has some time.

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
[email protected]