javascript: possible bug in .alignment annotation property?

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

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
Mathew
User
Posts: 188
Joined: Thu Jun 19, 2014 7:30 pm

javascript: possible bug in .alignment annotation property?

Post by Mathew »

If you get the alignment of a FreeText annotation, it always returns 0, regardless of the actual alignment. To reproduce:

Create a textbox with a text in it, right aligned. Select it and duplicate this annotation within javascript, the resulting annotation will be left aligned. This snippet will reproduce the annotation, and the new annotations will be left aligned:

Code: Select all

var a = this.selectedAnnots[0].getProps();
a.contents="This should have same alignment as the selected annotation."
delete a.richContents; // workaround for empty richContents bug
this.addAnnot(a);
(You'll need to move the selected annotation to see the new one). If the annotation has richContents, and the alignment varies, then it reports correctly. It's only the .alignment property that's not being returned properly.
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: javascript: possible bug in .alignment annotation property?

Post by Paul - Tracker Supp »

Hi Mathew,

I do see the same here. I have asked the devs to take a look at this and they tell me it will be fixed for the initial Version 10 release currently slated for Spring.

I hope that helps.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
Post Reply