pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Choosing a font for non-ASCII characters
Date Sun, 03 Mar 2019 13:48:26 GMT
> I have no idea. The information about PDFBox seems to be mostly in
> example programs and not web-based documentation. Searching e.g.
> Google for "how to use FontBox with PDFBox" generally comes up with
> references into the Javadoc for "uses of FontBox interface".
>
> The Javadoc does not describe what FontBox is and none of the classes
> or subclasses in those related packages really have any documentation
> worth reading. Each class "foo" is described as "being a foo" and each
> "getBar" method is described as "gets the bar for the foo".
>
> So... discoverability of features is pretty much nil here.
>
> I'm quite happy with the responses I get on this mailing list, but
> it's nearly impossible to discover on my own what is possible, here.
> I shouldn't have to get you guys to tell me how to use the software...
> you have better things to do (like continue to write great software).
>
> Is there a good example of using FontBox with PDFBox in order to
> subset a font?


Yes, the EmbeddedFonts.java example. We are a small team and don't have 
the time to write tutorials. There are many working examples and also 
many answers on stackoverflow.

You don't need fontbox unless for advanced things, e.g. reuse a font for 
several files. For normal use cases, fontbox remains under the hood.

If you think some class documentation is useless, name it, and I'll see 
if it can be improved.

The subset thing is done by PDFBox without you having to bother about 
it. It's "not subsetting" that would require more parameters. So you 
need only this:

PDType0Font font = PDType0Font.load(document, new 
File("c:/windows/fonts/arial.ttf"));
stream.setFont(font, 12);
stream.showText("...");

Tilman


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


Mime
View raw message