Public Member Functions
|PDFPatternGenerator (PdfContentByte cb, Units w, Units h)|
|void||adjustPatternSize (int patternDotSizeAdjustment)|
|0 means no adjustment. |
|void||renderPattern (TiledPattern pattern, Units xOrigin, Units yOrigin)|
|Render the given pattern starting at the designated origin. |
|void||setPatternColor (Color c)|
|SuppressWarnings ("unused") private void initializePatternFont_Tahoma()|
|21 works for both laser and wide-format inkjet. |
The circle approach works best. We draw and fill a circle the size of an Anoto pattern dot.
Other approaches that this class supports:
Printing dots with the bullet point • in Tahoma works decently. We will also try drawing circles, or using some sort of stamping pattern if possible.
setFontSize(...) is an important method, as you will need to adjust it based on your printer. We picked a decent default (21 pt Tahoma) since it works for both of our printers.
ZapfDingbats seems to work even better, as it is a built-in Adobe font. The 'l' lowercase L character looks like a dot. =)
This software is distributed under the BSD License.
Definition at line 45 of file PDFPatternGenerator.java.
|cb||The content byte that you pass into this object will be transformed! Beware if you want to use it later on for another purpose. Probably, it would be good to dedicate a content layer for this pattern generator.|
|w||Width of the PDF Document.|
|h||Height of the PDF Document.|
Render the given pattern starting at the designated origin.
Also render a white box underneath the pattern, if we were asked to do so... This helps the pattern stand out better.