Font Size not right in PlaceWatermark method
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.
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.
-
- User
- Posts: 101
- Joined: Fri Sep 18, 2015 9:49 pm
Font Size not right in PlaceWatermark method
Hi,
I am using the Tracker Core Api 6.0.318.1.
I am setting the FontSize property of the IPXC_WatermarkParams object that is being passes to the PlaceWatermark method but the font size is not coming out correctly. If i set the font to 36 it comes out to be something like 18-20 and if I set it to 18, it is something like 9-10. I have attached the code that I am using. There also a sample pdf file in the folder that I am using for testing.
Regards,
M
I am using the Tracker Core Api 6.0.318.1.
I am setting the FontSize property of the IPXC_WatermarkParams object that is being passes to the PlaceWatermark method but the font size is not coming out correctly. If i set the font to 36 it comes out to be something like 18-20 and if I set it to 18, it is something like 9-10. I have attached the code that I am using. There also a sample pdf file in the folder that I am using for testing.
Regards,
M
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Font Size not right in PlaceWatermark method
Hello mmasood,
I've tested your sample - you are using 50% scale value thus the font size is smaller.
Cheers,
Alex
I've tested your sample - you are using 50% scale value thus the font size is smaller.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 101
- Joined: Fri Sep 18, 2015 9:49 pm
Re: Font Size not right in PlaceWatermark method
Hi Alex,
I looked at the code and have the following questions:
1. Where exactly in the code is it scaling to 50%?
2. Is it a default value?
3. How can I set it to be 100%?
4. Are there any other default values that I need to be aware of?
Regards,
M
I looked at the code and have the following questions:
1. Where exactly in the code is it scaling to 50%?
2. Is it a default value?
3. How can I set it to be 100%?
4. Are there any other default values that I need to be aware of?
Regards,
M
-
- Site Admin
- Posts: 17957
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Font Size not right in PlaceWatermark method
Hello mmasood,
Alex finished for the day already, but while we wait for him to answer tomorrow - I downloaded your sample project and ran it I was asked to select a file - and did so. I picked the PDF that came with the project and after converting the file - I can't see any differences in the font size between the original and the new PDF document. Nor, between the new PDF and the Word doc.
Or am I missing something obvious?
Cheers,
Stefan
Alex finished for the day already, but while we wait for him to answer tomorrow - I downloaded your sample project and ran it I was asked to select a file - and did so. I picked the PDF that came with the project and after converting the file - I can't see any differences in the font size between the original and the new PDF document. Nor, between the new PDF and the Word doc.
Or am I missing something obvious?
Cheers,
Stefan
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 101
- Joined: Fri Sep 18, 2015 9:49 pm
Re: Font Size not right in PlaceWatermark method
Hi Stefan,
I have attached a sample outcome file. I don't know you are not getting any banners on the output file. The header banners in this file are 36 font and the footer banners are 18 font but they do not look like that.
Regards,
M
I have attached a sample outcome file. I don't know you are not getting any banners on the output file. The header banners in this file are 36 font and the footer banners are 18 font but they do not look like that.
Regards,
M
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 17957
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Font Size not right in PlaceWatermark method
Hello mmasood,
I extracted the whole folder from the archive in your original post, then ran the .exe inside, selected the existing PDF file - and got the result as attached above. I see the "XForm" objects are there - but there's no text in them. Do I need anything else to run this sample properly?
Regards,
Stefan
I extracted the whole folder from the archive in your original post, then ran the .exe inside, selected the existing PDF file - and got the result as attached above. I see the "XForm" objects are there - but there's no text in them. Do I need anything else to run this sample properly?
Regards,
Stefan
-
- User
- Posts: 101
- Joined: Fri Sep 18, 2015 9:49 pm
Re: Font Size not right in PlaceWatermark method
Hi Stefan,
Can you try compiling the project? The exe in the folder might be older and not working properly.
Regards,
M
Can you try compiling the project? The exe in the folder might be older and not working properly.
Regards,
M
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Font Size not right in PlaceWatermark method
Hello mmasood,
In your case the correct code looks like this:
Cheers,
Alex
In your case the correct code looks like this:
Code: Select all
private void PlaceWatermark(PDFXEdit.IPXC_Document Doc, PDFXEdit.IPXC_Inst Inst)
{
PDFXEdit.IAUX_Inst aInst = (PDFXEdit.IAUX_Inst)Inst.GetExtension("AUX");
PDFXEdit.IBitSet bs = aInst.CreateBitSet(Doc.Pages.Count);
PDFXEdit.IPXC_WatermarkParams wp = Inst.CreateWatermarkParams();
bs.Set(0, 4); //We will place watermarks on first 4 pages
wp.Text = "QWERTY";
wp.Scale = 100;
wp.FontSize = Convert.ToSingle(50);
Doc.PlaceWatermark(bs, wp);
}
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 101
- Joined: Fri Sep 18, 2015 9:49 pm
Re: Font Size not right in PlaceWatermark method
Hi Alex,
So this means that the default value of Scale watermark parameter is 50%. Do you have the list of the default value of all the other parameters as it is not on the help site?
Regards,
M
So this means that the default value of Scale watermark parameter is 50%. Do you have the list of the default value of all the other parameters as it is not on the help site?
Regards,
M
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Font Size not right in PlaceWatermark method
Hello mmasood,
Well, we do not have this in our help yet. What you can do is to add the text watermark without any other parameters specified and then use the Edit Watermark command available in the end user Editor to see the default parameters.
Cheers,
Alex
Well, we do not have this in our help yet. What you can do is to add the text watermark without any other parameters specified and then use the Edit Watermark command available in the end user Editor to see the default parameters.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 269
- Joined: Tue Jul 07, 2015 3:30 pm
Re: Font Size not right in PlaceWatermark method
What about the default for the font size Scale?
Is it really 0.5 by default?
If so why?
Is it really 0.5 by default?
If so why?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Font Size not right in PlaceWatermark method
Hello whoit,
I just found you a better way to look into the default parameters. Use the CreateWatermarkParams method and then you can just debug and look at the parameters that were set by default in the IPXC_WatermarkParams properties.
Cheers,
Alex
I just found you a better way to look into the default parameters. Use the CreateWatermarkParams method and then you can just debug and look at the parameters that were set by default in the IPXC_WatermarkParams properties.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ