I'd recommend rendering to an image at a higher DPI (say 4x) and then scaling-down that image using lanczos (just Google for a Java implementation). Then threshold that image to binary - an adaptive threshold might work well here.
-- John > On 27 Jun 2016, at 09:10, Lachezar Dobrev <l.dob...@gmail.com> wrote: > > Hey all, > > I need to print PDFs to images to be forwarded to a low-resolution > printer (200 dpi). > Printing works (Yay!), and the ability to specify colour space and > resolution helps immensely. > > When reading the PDFs I get these error messages: > > VI 27, 2016 5:53:39 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font > getawtFont > INFO: Can't read the embedded font AAAAAC+DejaVuSans-Bold > VI 27, 2016 5:53:39 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font > getawtFont > INFO: Using font DejaVu Sans Bold instead > VI 27, 2016 5:53:39 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font > getawtFont > INFO: Can't read the embedded font AAAAAD+DejaVuSans > VI 27, 2016 5:53:39 PM org.apache.pdfbox.pdmodel.font.PDCIDFontType2Font > getawtFont > INFO: Using font DejaVu Sans instead > > This looks like something I can live with (fonts being substituted), but > I'm willing to work on that, since text is not Latin, and missing glyphs in > system available fonts is a thing. > > > However due to the low resolution, the fact that the printer is > Black-And-White (not Gray-Scale!) much of the text becomes grainy and > disconnected (thin parts of the letters missing), making the text extremely > hard to read. > > Is there any way to make all fonts bold (or bold-er), so that the text > (after being converted to black-and-white) would be easier to read when > printed in low-resolution? I can not perform any post-rendering > enhancements, because there are bar-codes in the printed content that > become unreadable if smeared or thickened. > > I'm fixed to using PDFBox 1.8.1 (that's what's available in the project). --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org