Set font of a FreeText annotation

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

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

Post Reply
prosozial_schmitt
User
Posts: 52
Joined: Tue Dec 28, 2004 9:49 am

Set font of a FreeText annotation

Post by prosozial_schmitt » Mon Jun 06, 2016 12:45 pm

Hello,

I want to create a FreeText annotation by JavaScript. I Need to create this annotation with a monospaced font. My script is working - but the annotation is always drawn in font.Helv(?) and not in font.Cour.
How can I change this to the needed behaviour?

Greetings
Hans-Peter

Script:

var annot = this.addAnnot
({
type: "FreeText",
page: 0,
textFont: font.Cour,
textSize: 12,
rect: [235.4114,631.2243,308.9114,644.7243],
width: 0,
fillColor: color.transparent,
strokeColor: ["RGB", 0.00,0.00,0.00],
alignment: 0,
opacity: 1,
rotate: 0,
contents: "_iMi_"
});

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13557
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Set font of a FreeText annotation

Post by Tracker Supp-Stefan » Mon Jun 06, 2016 2:58 pm

Hello prosozial_schmitt,

Your code worked for me in the stand alone portable Viewer, though the font used for the annotation was CourierPS.
Please try changing the following line:

Code: Select all

textFont: "Courier New",
And see if using the non post script uniform font will work better for your needs?

Also please make sure that you have the latest version of the dlls to make sure this is not an issue with an older build.

Regards,
Stefan

prosozial_schmitt
User
Posts: 52
Joined: Tue Dec 28, 2004 9:49 am

Re: Set font of a FreeText annotation

Post by prosozial_schmitt » Tue Jun 07, 2016 5:54 am

Hi Stefan,

I've tried it with textFont: "Courier New" and it works. Using "Arbitrary font" font.Cour seems not to work - but this is now not a real problem for me.

Great :)


Thank you very much
Hans-Peter

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13557
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Set font of a FreeText annotation

Post by Tracker Supp-Stefan » Tue Jun 07, 2016 12:19 pm

Glad I could assist Hans-Peter!

Cheers,
Stefan

Post Reply