Annotation details

A forum for questions or concerns related to the PDF-XChange Core API SDK

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Annotation details

Post by whoit »

I thought I'd start a new thread since the other is getting a bit long.

I have a few questions about Fonts and Alignment when using the Annotation "FreeText"
First, I assume this is the same as a "Text Box" when in the editor.

Here is a screenshot from the editor:

Image

And here are the questions:

1) I cannot get Alignment to work properly using the ENUM PXC_TextJustification.
Only two values work: TJ_Left, and TJ_Center
All others produce this error: "Value does not fall within the expected range." yet they work in the editor.

Code: Select all

TextMUData.DefaultTextAlign = (int)PXC_TextJustification.TJ_Right; //ERROR
TextMUData.DefaultTextAlign = (int)PXC_TextJustification.TJ_Justify;  //ERROR
2) Font styling - Underline, Strikethrough, Sub- and super-script
Where are these being set when using the editor?
There is no comparable setting for the Annotation in CoreAPI.
I can only assume that you are wrapping the text in <body><p> tags and using CSS - is this true?

Thanks,
Wayne
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Annotation details

Post by Sasha - Tracker Dev Team »

Hello Wayne,

1) It seems that there is a typo in the code for that one - I've asked a developer who implemented this - waiting for response.
2) From what I see there is no direct way of setting these values for the font - the only thing, that you can do is setting the XFA (not CSS) formatted text into the annotation - something like here:
viewtopic.php?f=66&t=26483&p=102933&hilit=rich#p105962

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: Annotation details

Post by whoit »

Hi Alex -

Ok, so:

1) We wait to hear about the code typo and fix so that PXC_TextJustification works properly
2) I can implement code based on your link to insert the necessary text-align setting into the existing text.
3) Is there any way to use "JustifyAll" in an annotation?

Correct?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Annotation details

Post by Sasha - Tracker Dev Team »

Hello Wayne,

That is correct. About number 2 - you should use the XFA formatted text as you were using in the ShowTextBlock method - should work.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: Annotation details

Post by whoit »

Hi Alex -

I've runs some tests and it appears that there is a typo in the XFA spec regarding "justifyall"

XFA claims to support it, but it does not work in the TextBlock or in the Annotation.
(see page 1190, Horizontal Alignment in XFA spec)
I've tried "text-align:justifyall;" and "text-align:justify-all;" - neither works.

However, with more digging the spec I found "justifyAll" described in the doc for "halign" - and it works.

I'd still like to hear back as you indicated in my original #1 above.

Thanks,
Wayne
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Annotation details

Post by Sasha - Tracker Dev Team »

Hello Wayne,

I will fix the typo for the right alignment, though the Justify flag will be removed - as it's not a valid flag for the plain text Free Text annotations (we are having a dev conference and I've asked about this). The XFA should be used for this one.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: Annotation details

Post by whoit »

Hi Alex -
Ok, it seems odd to me that you'd remove Justify, but as long as it can be done in one way or another....

-Wayne
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Annotation details

Post by Sasha - Tracker Dev Team »

Hello Wayne,

That should be done due to the PDF specification as I've been told by our lead dev.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply