logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
ESchunk  
#1 Posted : Wednesday, September 11, 2019 2:36:07 PM(UTC)
Quote
ESchunk

Rank: Member

Groups: Registered
Joined: 8/13/2019(UTC)
Posts: 13
United States
Location: New York

Thanks: 1 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 9 time(s).
Paul Rayman  
#2 Posted : Thursday, September 12, 2019 9:03:54 AM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 881

Thanks: 3 times
Was thanked: 108 time(s) in 105 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.
ESchunk  
#3 Posted : Thursday, September 12, 2019 1:08:46 PM(UTC)
Quote
ESchunk

Rank: Member

Groups: Registered
Joined: 8/13/2019(UTC)
Posts: 13
United States
Location: New York

Thanks: 1 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
Paul Rayman  
#4 Posted : Saturday, September 14, 2019 11:10:32 PM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 881

Thanks: 3 times
Was thanked: 108 time(s) in 105 post(s)
Originally Posted by: ESchunk Go to Quoted Post
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-It

Originally Posted by: ESchunk Go to Quoted Post
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 11:11:05 PM(UTC)  | Reason: Not specified

Quick Reply Show Quick Reply
Users browsing this topic
Similar Topics
Change font size of PdfTextObject (Common Questions)
by lxman 2/27/2020 8:44:50 PM(UTC)
Update text field text to reflect Dictionary font size change (Common Questions)
by richard 7/15/2019 4:28:39 AM(UTC)
Font Size Auto Support on Dropdown (Bug Report & Technical Support)
by scott36117 10/5/2018 11:17:50 AM(UTC)
New Topic Post Reply
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.