Hi, Support:
I want to get the size of text stamp using textstamp.width and textstamp.height by Pdf.dll v23.4 Based on Vb.net, however , the result is allways 0. Would you please tell me how to get the ringht ones? of fix the api.
Thanks for your help and pay attention to this bug
According to your this guidance, I try using TextStamp.zoomx=1 and textStamp.zoomy=1 before TextStamp.put(Pdf.Pages(PageNumber)), however, the value of TextStamp.width and TextStamp.height is still 0 before put into page.
Please check your api and fix.
I want to add text to pdf page at accurate (x,y) position by setting the xIndex and yIndex,therefore, the width and height of textStamp mustt be gotten when calculating the (x,y) position, whereas using the size of Label.width and lable.height under the same fontsize, the width and height of Label is always greater than that of the textstamp, therefore it is not accurate (x,y) position by using the size of label as that of the textstamp.
If the xIndex and yIndex are not be calculated and specified, the text must be added at a unexpected wrong position .
Thanks for your attention.
And else, I strongly suggest your Pdf.dll to set the (x,y) of start position (0,0) at the Left-Top conner of the pdf page not at the Left-Bottom conner, and hope this update to be taken into consideration for the future version.
using var doc = new Document();
Page page = doc.Pages.Add();
for (short i = 1; i < 9; i++)
{
var textStamp = new TextStamp("TextStamp №" + i);
textStamp.XIndent = 40*i;
textStamp.YIndent = 100*i;
textStamp.TextState.FontSize = 10 + i;
textStamp.TextState.FontStyle = FontStyles.Bold;
page.AddStamp(textStamp);
doc.Save(dataDir + "TextStamps.pdf");
}
The default coordinate system used is defined by the specification and we cannot deviate from it, not to mention that it will break the code for most users of the library.
Thank for your suggestion. However, what you suggested is not my desired. I know using xIndex and yIndex to set the position or textstamp, but the accurate position cannot be set because of not knowing the width and height of the textstamp.
Thanks for your suggestion.
The following codes will work for this purpose:
TextStamp.scale=true
’ it is equal to textStamp.AutoAdjustFontSizeToFitStampRectangle = true
TextStamp.Width=NewWidth
TextStamp.Height=NewHeight
This will reset the width and height of the textstamp as what show for a Label with same font size.
However, there found a big bug is that:
if TextStamp.xIndex is set to 0, the real x position of textstamp printed in the page may be 160pixel not 0.
Therefore ,your pdf.dll can not accurately set the (x,y) position for textstamp and Imagestamp as what in Image.drawm(SrcImage,x,y), Please check and fix it.
@ducaisoft
TextStamp does not have an xIndex property.
Please write the code fragment you are using, attach the source document, and indicate the expected result and the result you are getting.
Please try not to write in capital letters, but to state your request clearly and understandably.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.