how to set watermark font color and italic  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, 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
kyo
User
Posts: 130
Joined: Mon Oct 31, 2016 11:58 am

how to set watermark font color and italic

Post by kyo »

Dear All,

https://sdkhelp.pdf-xchange.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.
Sasha - Tracker Dev Team
User
Posts: 5522
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 »

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
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 »

Thanks very much for your sample.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: how to set watermark font color and italic

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Re: how to set watermark font color and italic

Post by DolphinMann »

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.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: how to set watermark font color and italic

Post by Sasha - Tracker Dev Team »

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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply