org.apache.fop.pdf
Class PDFPattern

org.apache.fop.pdf.PDFObject
  |
  +--org.apache.fop.pdf.PDFPathPaint
        |
        +--org.apache.fop.pdf.PDFPattern

public class PDFPattern
extends PDFPathPaint

class representing a PDF Function. PDF Functions represent parameterized mathematical formulas and sampled representations with arbitrary resolution. Functions are used in two areas: device-dependent rasterization information for halftoning and transfer functions, and color specification for smooth shading (a PDF 1.3 feature). All PDF Functions have a FunctionType (0,2,3, or 4), a Domain, and a Range.


Constructor Summary
PDFPattern(int theNumber, String thePatternName, PDFResources theResources, int thePatternType, int thePaintType, int theTilingType, Vector theBBox, double theXStep, double theYStep, Vector theMatrix, Vector theXUID, StringBuffer thePatternDataStream)
          Create a tiling pattern (type 1).
PDFPattern(int theNumber, String thePatternName, int thePatternType, PDFShading theShading, Vector theXUID, StringBuffer theExtGState, Vector theMatrix)
          Create a type 2 pattern (smooth shading)

Method Summary
 StringgetColorSpaceOut(boolean fillNotStroke)
           
 StringgetName()
          Get the name of the pattern
 byte[]toPDF()
          represent as PDF.

Methods inherited from class org.apache.fop.pdf.PDFPathPaint
getColorSpace, setColorSpace

Methods inherited from class org.apache.fop.pdf.PDFObject
getNumber, referencePDF

Constructor Detail

PDFPattern

public PDFPattern(int theNumber, String thePatternName, PDFResources theResources, int thePatternType, int thePaintType, int theTilingType, Vector theBBox, double theXStep, double theYStep, Vector theMatrix, Vector theXUID, StringBuffer thePatternDataStream)
Create a tiling pattern (type 1).
Parameters:
theNumber - The object number of this PDF Object
thePatternName - The name of the pattern such as "Pa1" or "Pattern1"
theResources - the resources associated with this pattern
thePatternType - the type of pattern, which is 1 for tiling.
thePaintType - 1 or 2, colored or uncolored.
theTilingType - 1, 2, or 3, constant spacing, no distortion, or faster tiling
theBBox - Vector of Doubles: The pattern cell bounding box
theXStep - horizontal spacing
theYStep - vertical spacing
theMatrix - Optional Vector of Doubles transformation matrix
theXUID - Optional vector of Integers that uniquely identify the pattern
thePatternDataStream - The stream of pattern data to be tiled.

PDFPattern

public PDFPattern(int theNumber, String thePatternName, int thePatternType, PDFShading theShading, Vector theXUID, StringBuffer theExtGState, Vector theMatrix)
Create a type 2 pattern (smooth shading)
Parameters:
theNumber - the object number of this PDF object
thePatternName - the name of the pattern
thePatternType - the type of the pattern, which is 2, smooth shading
theShading - the PDF Shading object that comprises this pattern
theXUID - optional:the extended unique Identifier if used.
theExtGState - optional: the extended graphics state, if used.
theMatrix - Optional:Vector of Doubles that specify the matrix.
Method Detail

getColorSpaceOut

public String getColorSpaceOut(boolean fillNotStroke)

getName

public String getName()
Get the name of the pattern
Returns: String representing the name of the pattern.

toPDF

public byte[] toPDF()
represent as PDF. Whatever the FunctionType is, the correct representation spits out. The sets of required and optional attributes are different for each type, but if a required attribute's object was constructed as null, then no error is raised. Instead, the malformed PDF that was requested by the construction is dutifully output. This policy should be reviewed.
Returns: the PDF string.

Association Links

to Class org.apache.fop.pdf.PDFNumber

to Class org.apache.fop.pdf.PDFResources

The resources associated with this pattern

to Class java.lang.String

The name of the pattern such as "Pa1" or "Pattern1"

to Class java.util.Vector

Vector of Doubles representing the Bounding box rectangle

to Class org.apache.fop.pdf.PDFShading

The Shading object comprising the Type 2 pattern

to Class java.util.Vector

Vector of Integers represetning the Extended unique Identifier

to Class java.lang.StringBuffer

String representing the extended Graphics state. Probably will never be used like this.

to Class java.util.Vector

Vector of Doubles representing the Transformation matrix.

to Class java.lang.StringBuffer

The stream of a pattern