Hello,
I would like to place my FreeText annotation on specific position (where mouse been clicked), however this js does not paint
my annotation in the right place. If I change FreeText annotation to Text, then the position is working right,
but I cant use Text because it looks like a StickyNote, but I need text box. Could you please take a look, maybe there are some other properties I can use to set position right.
var annot = this.addAnnot ({
page:0,
type: "FreeText",
point: [226, 404],
rect: [0,18,157,0],
width: 0,
textFont:"Arial",
fillColor: color.transparent
});
var spans = new Array();
spans[0] = new Object();
spans[0].textSize = 12;
spans[0].text = "Test Value";
FreeText position does not work
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: FreeText position does not work
My calculations of the rectangle were wrong, my bet 

-
- Site Admin
- Posts: 5223
- Joined: Tue Jun 29, 2004 10:34 am
Re: FreeText position does not work

If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.
Best regards
Tracker Support
http://www.tracker-software.com
Best regards
Tracker Support
http://www.tracker-software.com
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: FreeText position does not work
Hi, TatianaS.
Your script for adding the textboxes is incorrect. The correct script would be as follows:
var annot = this.addAnnot ({
page:0,
type: "FreeText",
rect: [0,100,200,0],
width: 1.0,
textFont:"Arial",
textSize: 20,
fillColor: color.transparent
});
if (annot != null)
annot.contents = "Test Text";
HTH.
Your script for adding the textboxes is incorrect. The correct script would be as follows:
var annot = this.addAnnot ({
page:0,
type: "FreeText",
rect: [0,100,200,0],
width: 1.0,
textFont:"Arial",
textSize: 20,
fillColor: color.transparent
});
if (annot != null)
annot.contents = "Test Text";
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.