pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hewson <j...@jahewson.com>
Subject Re: Geting font information
Date Tue, 23 Aug 2016 03:49:50 GMT

> On 22 Aug 2016, at 17:42, Takuya Takaira (Hitakuya) <takuya.v@gmail.com> wrote:
> 
> I’m using PDFbox-2.0.2 to obtain character information(position, size etc) and image
of pdf pages.
> Now, I’m trying real size of character which is size of drawn.
> (for example like ‘A’ is normal and link ‘,’ is small size)
> 
> Then, I tried following step
> - get path form getPath(code) method
> - get Rectange
> 
> But for some embed font it is nice result, but some embed is completely wrong size.
> 
> if someone information, can you give me some advice.

So we actually just added some methods to help with this. The problem is that the glyph outlines
are in the font's native glyph space, and there's a fairly convoluted series of transforms
which are necessary to map them into user space, and ultimately device space.

If you use the latest SNV snapshot then you can use the getNormalizedPath method to get the
glyph outlines. We do this in our PDFDebugger:

https://github.com/apache/pdfbox/blob/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/DebugPageDrawer.java

Note that you don't have to override PageDrawer, you can simply override PDFGraphicsStreamEngine.

-- John

> Thanks.
> Takuya Takaira.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message