how to set watermark font color and italic  SOLVED

PDF-XChange Editor SDK for Developers

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

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
kyo
User
Posts: 130
Joined: Mon Oct 31, 2016 11:58 am

how to set watermark font color and italic

Post by kyo » Thu Dec 01, 2016 9:00 am

Dear All,

http://sdkhelp.tracker-software.com/vie ... FontParams

I am working on adding watermark .And I use the operation "op.document.addWatermarks" to do this, however,I encounter some trouble with setting some properties of the Font dictionary.

I have listed my problems as follows:
1.As you can see from the link above,it does not mention any property like "Italic" at all.If I need to set the italic style of the font,how can I do this?

2.As you can see from the link above,there is a property "FColor" which is used to set the color of the font.But how to set it with a correct format,make me a little bit confused.
So,I want to known that how to set FColor property correctly from a RGB color instance(e.g. C# Color object).

I am waiting for your response.
Thanks.

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

Re: how to set watermark font color and italic  SOLVED

Post by Sasha - Tracker Dev Team » Fri Dec 02, 2016 12:29 pm

Hello kyo,

Here's how you can do this:

Code: Select all

options["Font.FColor"].v = "RGB(255,0,0)";
options["Font.Name"].v = "Arial Bold Italic";
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

kyo
User
Posts: 130
Joined: Mon Oct 31, 2016 11:58 am

Re: how to set watermark font color and italic

Post by kyo » Mon Dec 05, 2016 6:11 am

Thanks very much for your sample.

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

Re: how to set watermark font color and italic

Post by Sasha - Tracker Dev Team » Mon Dec 05, 2016 7:18 am

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

DolphinMann
User
Posts: 157
Joined: Mon Aug 04, 2014 7:34 pm

Re: how to set watermark font color and italic

Post by DolphinMann » Fri May 04, 2018 4:22 pm

Sorry to necro an old thread, but it seemed related.

How can we set the font style if the font is generated from: this.pdf.CreateNewFont(fontName, 0, 400);

The documentation page seems to be down and I couldn't quite figure it out from the available intellisense options.

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

Re: how to set watermark font color and italic

Post by Sasha - Tracker Dev Team » Mon May 07, 2018 6:16 am

Hello DolphinMann,

Here's an example of the italic and bold font (weight == 700 is bold by specification):

Code: Select all

coreDoc.CreateNewFont("Source Sans Pro", (uint)PXC_CreateFontFlags.CreateFont_Italic, 700);
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply