Can a textblock have a color background?

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

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, 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: 271
Joined: Tue Jul 07, 2015 3:30 pm

Can a textblock have a color background?

Post by whoit » Tue Jul 24, 2018 7:41 pm

I'm using ContentCreator, and ShowTextBlock.

Is it possible to set the background of the textblock color ?

For example, if I create a textblock with the intent of covering existing text, I would want the text to be black, and the background to be white...
Or if want, white text on a black background, etc..

Thanks.

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

Re: Can a textblock have a color background?

Post by Sasha - Tracker Dev Team » Wed Jul 25, 2018 8:57 am

Hello Wayne,

You should fill the rectangle first and then draw the text on top. The rectangle can be calculated when you output the text itself with DTF_CalcSizeOnly flag.
For more, please refer to the https://github.com/tracker-software/PDF ... oreAPIDemo project.
Look into the 4.3 Text Rendering Mode and 4.7 Patterns sample for more info.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

whoit
User
Posts: 271
Joined: Tue Jul 07, 2015 3:30 pm

Re: Can a textblock have a color background?

Post by whoit » Wed Jul 25, 2018 1:43 pm

OK, thanks - I'll dig around.

BTW I've downloaded and run the new Demo - nice!

Only one issue: While running, after I select any sample from the left side, the "Go To Source" button does nothing,
nor does the code show in the window below the button.

(I'm running VS 2017)

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

Re: Can a textblock have a color background?

Post by Sasha - Tracker Dev Team » Wed Jul 25, 2018 1:48 pm

Hello Wayne,

Please check the NuGet packages for the project - the FCTB package should be installed for the text coloring (just for a test to ensure that they did).
As for the problem, please check the toolStripButton2_Click implementation - and read the exception codes if they occur.
I think you can experience the problem here:

Code: Select all

EnvDTE.DTE dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE");
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply