Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Not A Problem
-
2.0.0
-
None
Description
RenderingHints defaults are hard-coded in PageDrawer now.
However, the defaults are not always valid for every situation. For example, I have a PDF file containing barcodes, which will be printed out using a low resolution dot matrix printer. The RenderingHints.VALUE_ANTIALIAS_ON default confuses all of our barcode reader!
A dirty workaround I had is to extend PDFPrinter, use reflection to set the protected but final super.renderer field with following extension:
@Override public void renderPageToGraphics(int pageIndex, Graphics2D graphics, float scale) throws IOException { // proxy graphics, applying hints immediately, suppress all subsequent setRenderingHint request Graphics2D hintsAppliedGraphics = new HintsAppliedGraphics2D(graphics, hints); super.renderPageToGraphics(pageIndex, hintsAppliedGraphics, scale); }
It will be nice if there exist a more elegant way to specify RenderHint s.
Attachments
Attachments
Issue Links
- is related to
-
PDFBOX-4435 Poor quality printing of PDF label
- Closed