PDFPatternGenerator Class Reference

List of all members.

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)

Package Functions

 SuppressWarnings ("unused") private void initializePatternFont_Tahoma()
 21 works for both laser and wide-format inkjet.

Detailed Description

This sits on top of PatternPackage and/or TiledPattern to create PDFs that can be printed. It uses the iText library to create and manipulate PDFs.

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.

Author:
Ron B Yeh (ronyeh(AT)cs.stanford.edu)

Definition at line 45 of file PDFPatternGenerator.java.


Constructor & Destructor Documentation

PDFPatternGenerator ( PdfContentByte  cb,
Units  w,
Units  h 
)

Parameters:
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.

Definition at line 178 of file PDFPatternGenerator.java.


Member Function Documentation

void adjustPatternSize ( int  patternDotSizeAdjustment  ) 

0 means no adjustment.

Parameters:
patternDotSizeAdjustment 

Definition at line 205 of file PDFPatternGenerator.java.

void renderPattern ( TiledPattern  pattern,
Units  xOrigin,
Units  yOrigin 
)

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.

Parameters:
pattern 
xOrigin 
yOrigin 

Definition at line 263 of file PDFPatternGenerator.java.

References TiledPattern.getNumTotalColumns(), TiledPattern.getNumTotalRows(), TiledPattern.getPatternOnRow(), and Units.getValueInPoints().

void setPatternColor ( Color  c  ) 

Parameters:
c 

Definition at line 363 of file PDFPatternGenerator.java.


The documentation for this class was generated from the following file:
Generated on Sat Apr 14 18:21:43 2007 for R3 Paper Toolkit by  doxygen 1.4.7