Rank:: Member
Groups: Registered
Joined: 8/13/2019(UTC) Posts: 19  Location: New York Thanks: 2 times
|
I have a pdf file with a custom font. The font size when I look in Acrobat is 7.56. The font size returned by PdfTextObject (or Pdfium.FPDFTextObj_GetFontSize) is 1. Is there a way to get the size of a font when the text was created with a custom font? Attached is a sample PDF with the issue. Thanks, Ted test of font.pdf (14kb) downloaded 27 time(s).
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
In fact, in the provided document, the font size is indeed set to 1. And the size of the text that you see when rendering, appears as a result of applying the transformation matrix.. Examine the textObject.Matrix property. You will find there a scaling factor equal to exactly 7.56.
|
|
|
|
|
|
Rank:: Member
Groups: Registered
Joined: 8/13/2019(UTC) Posts: 19  Location: New York Thanks: 2 times
|
Thanks Paul. Can you point me something to learn more about the textObject.Matrix properties. (Not sure what a,b,c...f mean).
I'm trying to get the height of a character given a particular font and font size. My approach is to create a new PdfTextObject using an existing font and text object. For example,
PdfTextObject.Create("A", 1, 1, textObject.Font, textObject.FontSize);
The problem is the font size of the existing object. Should I be using the "D" property of the matrix to get the font size?
Thanks,
Ted
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Originally Posted by: ESchunk  Thanks Paul. Can you point me something to learn more about the textObject.Matrix properties. (Not sure what a,b,c...f mean). https://forum.patagames....Matrix-and-How-to-Use-ItOriginally Posted by: ESchunk  My approach is to create a new PdfTextObject using an existing font and text object. You may use original font size and matrix. Or just call PdfTextObject.Clone(); Edited by user Saturday, September 14, 2019 8:11:05 PM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close