org.apache.fop.pdf

Class PDFFactory


public class PDFFactory
extends java.lang.Object

This class provides method to create and register PDF objects.

Constructor Summary

PDFFactory(PDFDocument document)
Creates a new PDFFactory.

Method Summary

PDFDocument
getDocument()
Returns the parent PDFDocument associated with this factory.
PDFAction
getExternalAction(String target)
Create/find and return the appropriate external PDFAction according to the target
String
getGoToReference(String pdfPageRef, float yoffset)
Create or find a PDF GoTo with the given page reference string and Y offset, and return its PDF object reference
PDFGoTo
getPDFGoTo(String pdfPageRef, Point2D position)
Finds and returns a PDFGoTo to the given page and position.
PDFWArray
getSubsetWidths(CIDFont cidFont)
protected PDFDestination
getUniqueDestination(PDFDestination newdest)
Registers and returns newdest if it is unique.
PDFAnnotList
makeAnnotList()
Make an annotation list object
PDFArray
makeArray(int[] values)
make an Array object (ex.
PDFDestination
makeDestination(String idRef, Object goToRef)
Make a named destination.
PDFDests
makeDests(List destinationList)
Make a the head object of the name dictionary (the /Dests object).
PDFEncoding
makeEncoding(String encodingName)
make a /Encoding object
PDFFont
makeFont(String fontname, String basefont, String encoding, FontMetrics metrics, FontDescriptor descriptor)
make a Type1 /Font object
PDFFontDescriptor
makeFontDescriptor(FontDescriptor desc)
make a /FontDescriptor object
AbstractPDFStream
makeFontFile(FontDescriptor desc)
Embeds a font.
PDFFunction
makeFunction(int theFunctionType, List theDomain, List theRange, List theFunctions, List theBounds, List theEncode)
Make a Type 3 Stitching function
PDFFunction
makeFunction(int theFunctionType, List theDomain, List theRange, List theCZero, List theCOne, double theInterpolationExponentN)
make a type Exponential interpolation function (for shading usually)
PDFFunction
makeFunction(int theFunctionType, List theDomain, List theRange, List theSize, int theBitsPerSample, int theOrder, List theEncode, List theDecode, StringBuffer theFunctionDataStream, List theFilter)
Make a Type 0 sampled function
PDFFunction
makeFunction(int theNumber, int theFunctionType, List theDomain, List theRange, StringBuffer theFunctionDataStream)
make a postscript calculator function
PDFGState
makeGState(Map settings, PDFGState current)
make an ExtGState for extra graphics options This tries to find a GState that will setup the correct values for the current context.
PDFPattern
makeGradient(PDFResourceContext res, boolean radial, PDFDeviceColorSpace theColorspace, List theColors, List theBounds, List theCoords, List theMatrix)
Make a gradient
PDFICCBasedColorSpace
makeICCBasedColorSpace(PDFResourceContext res, String explicitName, PDFICCStream iccStream)
Makes a new ICCBased color space and registers it in the resource context.
protected PDFInfo
makeInfo(String prod)
make an /Info object
PDFLink
makeLink(Rectangle2D rect, String page, String dest)
Make an internal link.
PDFLink
makeLink(Rectangle2D rect, String destination, int linkType, float yoffset)
make a link object
PDFLink
makeLink(Rectangle2D rect, PDFAction pdfAction)
Create a PDF link to an existing PDFAction object
PDFMetadata
makeMetadata(Metadata meta, boolean readOnly)
Make a Metadata object.
PDFNameTreeNode
makeNameTreeNode()
Make a name tree node.
PDFNames
makeNames()
Make a names dictionary (the /Names object).
PDFOutline
makeOutline(PDFOutline parent, String label, String actionRef, boolean showSubItems)
Make an outline object and add it to the given parent
PDFOutline
makeOutline(PDFOutline parent, String label, String destination, float yoffset, boolean showSubItems)
Make an outline object and add it to the given outline
PDFOutline
makeOutline(PDFOutline parent, String label, PDFAction pdfAction, boolean showSubItems)
Make an outline object and add it to the given parent
PDFOutputIntent
makeOutputIntent()
Make a OutputIntent dictionary.
PDFICCStream
makePDFICCStream()
Create a PDFICCStream
PDFPage
makePage(PDFResources resources, int pageWidth, int pageHeight)
Make a /Page object.
PDFPage
makePage(PDFResources resources, int pageWidth, int pageHeight, int pageIndex)
Make a /Page object.
PDFPages
makePages()
Make a /Pages object.
PDFPattern
makePattern(PDFResourceContext res, int thePatternType, PDFResources theResources, int thePaintType, int theTilingType, List theBBox, double theXStep, double theYStep, List theMatrix, List theXUID, StringBuffer thePatternDataStream)
Make a tiling pattern
PDFPattern
makePattern(PDFResourceContext res, int thePatternType, PDFShading theShading, List theXUID, StringBuffer theExtGState, List theMatrix)
Make a smooth shading pattern
PDFResources
makeResources()
Make a /Resources object.
PDFRoot
makeRoot(PDFPages pages)
Make a /Catalog (Root) object.
PDFShading
makeShading(PDFResourceContext res, int theShadingType, PDFDeviceColorSpace theColorSpace, List theBackground, List theBBox, boolean theAntiAlias, List theDomain, List theMatrix, PDFFunction theFunction)
make a function based shading object
PDFShading
makeShading(PDFResourceContext res, int theShadingType, PDFDeviceColorSpace theColorSpace, List theBackground, List theBBox, boolean theAntiAlias, List theCoords, List theDomain, PDFFunction theFunction, List theExtend)
Make an axial or radial shading object.
PDFShading
makeShading(PDFResourceContext res, int theShadingType, PDFDeviceColorSpace theColorSpace, List theBackground, List theBBox, boolean theAntiAlias, int theBitsPerCoordinate, int theBitsPerComponent, List theDecode, int theVerticesPerRow, PDFFunction theFunction)
make a Lattice-Form Gouraud mesh shading object
PDFShading
makeShading(PDFResourceContext res, int theShadingType, PDFDeviceColorSpace theColorSpace, List theBackground, List theBBox, boolean theAntiAlias, int theBitsPerCoordinate, int theBitsPerComponent, int theBitsPerFlag, List theDecode, PDFFunction theFunction)
Make a free-form gouraud shaded triangle mesh, coons patch mesh, or tensor patch mesh shading object
PDFStream
makeStream(String type, boolean add)
Make a stream object

Constructor Details

PDFFactory

public PDFFactory(PDFDocument document)
Creates a new PDFFactory.
Parameters:
document - the parent PDFDocument needed to register the generated objects

Method Details

getDocument

public final PDFDocument getDocument()
Returns the parent PDFDocument associated with this factory.
Returns:
PDFDocument the parent PDFDocument

getExternalAction

public PDFAction getExternalAction(String target)
Create/find and return the appropriate external PDFAction according to the target
Parameters:
target - The external target. This may be a PDF file name (optionally with internal page number or destination) or any type of URI.
Returns:
the PDFAction thus created or found

getGoToReference

public String getGoToReference(String pdfPageRef,
                               float yoffset)
Create or find a PDF GoTo with the given page reference string and Y offset, and return its PDF object reference
Parameters:
pdfPageRef - the PDF page reference, e.g. "23 0 R"
yoffset - the distance from the bottom of the page in points
Returns:
the GoTo's object reference

getPDFGoTo

public PDFGoTo getPDFGoTo(String pdfPageRef,
                          Point2D position)
Finds and returns a PDFGoTo to the given page and position. Creates the PDFGoTo if not found.
Parameters:
pdfPageRef - the PDF page reference
position - the (X,Y) position in points
Returns:
the new or existing PDFGoTo object

getSubsetWidths

public PDFWArray getSubsetWidths(CIDFont cidFont)

getUniqueDestination

protected PDFDestination getUniqueDestination(PDFDestination newdest)
Registers and returns newdest if it is unique. Otherwise, returns the equal destination already present in the document.
Parameters:
newdest - a new, as yet unregistered destination
Returns:
newdest if unique, else the already registered instance

makeAnnotList

public PDFAnnotList makeAnnotList()
Make an annotation list object
Returns:
the annotation list object created

makeArray

public PDFArray makeArray(int[] values)
make an Array object (ex. Widths array for a font)
Parameters:
values - the int array values
Returns:
the PDF Array with the int values

makeDestination

public PDFDestination makeDestination(String idRef,
                                      Object goToRef)
Make a named destination.
Parameters:
idRef - ID Reference for this destination (the name of the destination)
goToRef - Object reference to the GoTo Action
Returns:
the newly created destrination

makeDests

public PDFDests makeDests(List destinationList)
Make a the head object of the name dictionary (the /Dests object).
Parameters:
destinationList - a list of PDFDestination instances
Returns:
the new PDFDests object

makeEncoding

public PDFEncoding makeEncoding(String encodingName)
make a /Encoding object
Parameters:
encodingName - character encoding scheme name
Returns:
the created /Encoding object

makeFont

public PDFFont makeFont(String fontname,
                        String basefont,
                        String encoding,
                        FontMetrics metrics,
                        FontDescriptor descriptor)
make a Type1 /Font object
Parameters:
fontname - internal name to use for this font (eg "F1")
basefont - name of the base font (eg "Helvetica")
encoding - character encoding scheme used by the font
metrics - additional information about the font
descriptor - additional information about the font
Returns:
the created /Font object

makeFontDescriptor

public PDFFontDescriptor makeFontDescriptor(FontDescriptor desc)
make a /FontDescriptor object
Parameters:
desc - the font descriptor
Returns:
the new PDF font descriptor

makeFontFile

public AbstractPDFStream makeFontFile(FontDescriptor desc)
Embeds a font.
Parameters:
desc - FontDescriptor of the font.
Returns:
PDFStream The embedded font file

makeFunction

public PDFFunction makeFunction(int theFunctionType,
                                List theDomain,
                                List theRange,
                                List theFunctions,
                                List theBounds,
                                List theEncode)
Make a Type 3 Stitching function
Parameters:
theFunctionType - This is the function type. It should be 3, for a stitching function.
theDomain - List objects of Double objects. This is the domain of the function. See page 264 of the PDF 1.3 Spec.
theRange - List objects of Double objects. This is the Range of the function. See page 264 of the PDF 1.3 Spec.
theFunctions - An List of the PDFFunction objects that the stitching function stitches. This attributed is required. It is described on page 269 of the PDF spec.
theBounds - This is a vector of Doubles representing the numbers that, in conjunction with Domain define the intervals to which each function from the 'functions' object applies. It must be in order of increasing magnitude, and each must be within Domain. It basically sets how much of the gradient each function handles. This attributed is required. It's described on page 269 of the PDF 1.3 spec.
theEncode - List objects of Double objects. This is the linear mapping of input values intop the domain of the function's sample table. Default is hard to represent in ascii, but basically [0 (Size0 1) 0 (Size1 1)...]. This attribute is required. See page 270 in the PDF 1.3 spec.
Returns:
the PDF function that was created

makeFunction

public PDFFunction makeFunction(int theFunctionType,
                                List theDomain,
                                List theRange,
                                List theCZero,
                                List theCOne,
                                double theInterpolationExponentN)
make a type Exponential interpolation function (for shading usually)
Parameters:
theFunctionType - The type of the function, which should be 2.
theDomain - List objects of Double objects. This is the domain of the function. See page 264 of the PDF 1.3 Spec.
theRange - List of Doubles that is the Range of the function. See page 264 of the PDF 1.3 Spec.
theCZero - This is a vector of Double objects which defines the function result when x=0. This attribute is optional. It's described on page 268 of the PDF 1.3 spec.
theCOne - This is a vector of Double objects which defines the function result when x=1. This attribute is optional. It's described on page 268 of the PDF 1.3 spec.
theInterpolationExponentN - This is the inerpolation exponent. This attribute is required. PDF Spec page 268
Returns:
the PDF function that was created

makeFunction

public PDFFunction makeFunction(int theFunctionType,
                                List theDomain,
                                List theRange,
                                List theSize,
                                int theBitsPerSample,
                                int theOrder,
                                List theEncode,
                                List theDecode,
                                StringBuffer theFunctionDataStream,
                                List theFilter)
Make a Type 0 sampled function
Parameters:
theFunctionType - This is the type of function (0,2,3, or 4). It should be 0 as this is the constructor for sampled functions.
theDomain - List objects of Double objects. This is the domain of the function. See page 264 of the PDF 1.3 Spec.
theRange - List objects of Double objects. This is the Range of the function. See page 264 of the PDF 1.3 Spec.
theSize - A List object of Integer objects. This is the number of samples in each input dimension. I can't imagine there being more or less than two input dimensions, so maybe this should be an array of length 2. See page 265 of the PDF 1.3 Spec.
theBitsPerSample - An int specifying the number of bits user to represent each sample value. Limited to 1,2,4,8,12,16,24 or 32. See page 265 of the 1.3 PDF Spec.
theOrder - The order of interpolation between samples. Default is 1 (one). Limited to 1 (one) or 3, which means linear or cubic-spline interpolation. This attribute is optional. See page 265 in the PDF 1.3 spec.
theEncode - List objects of Double objects. This is the linear mapping of input values intop the domain of the function's sample table. Default is hard to represent in ascii, but basically [0 (Size0 1) 0 (Size1 1)...]. This attribute is optional. See page 265 in the PDF 1.3 spec.
theDecode - List objects of Double objects. This is a linear mapping of sample values into the range. The default is just the range. This attribute is optional. Read about it on page 265 of the PDF 1.3 spec.
theFunctionDataStream - The sample values that specify the function are provided in a stream. This is optional, but is almost always used. Page 265 of the PDF 1.3 spec has more.
theFilter - This is a vector of String objects which are the various filters that have are to be applied to the stream to make sense of it. Order matters, so watch out. This is not documented in the Function section of the PDF 1.3 spec, it was deduced from samples that this is sometimes used, even if we may never use it in FOP. It is added for completeness sake.
Returns:
the PDF function that was created

makeFunction

public PDFFunction makeFunction(int theNumber,
                                int theFunctionType,
                                List theDomain,
                                List theRange,
                                StringBuffer theFunctionDataStream)
make a postscript calculator function
Parameters:
theNumber - the PDF object number
theFunctionType - the type of function to make
theDomain - the domain values
theRange - the range values of the function
theFunctionDataStream - a string containing the pdf drawing
Returns:
the PDF function that was created

makeGState

public PDFGState makeGState(Map settings,
                            PDFGState current)
make an ExtGState for extra graphics options This tries to find a GState that will setup the correct values for the current context. If there is no suitable GState it will create a new one.
Parameters:
settings - the settings required by the caller
current - the current GState of the current PDF context
Returns:
a PDF GState, either an existing GState or a new one

makeGradient

public PDFPattern makeGradient(PDFResourceContext res,
                               boolean radial,
                               PDFDeviceColorSpace theColorspace,
                               List theColors,
                               List theBounds,
                               List theCoords,
                               List theMatrix)
Make a gradient
Parameters:
res - the PDF resource context to add the shading, may be null
radial - if true a radial gradient will be created
theColorspace - the colorspace of the gradient
theColors - the list of colors for the gradient
theBounds - the list of bounds associated with the colors
theCoords - the coordinates for the gradient
Returns:
the PDF pattern that was created

makeICCBasedColorSpace

public PDFICCBasedColorSpace makeICCBasedColorSpace(PDFResourceContext res,
                                                    String explicitName,
                                                    PDFICCStream iccStream)
Makes a new ICCBased color space and registers it in the resource context.
Parameters:
res - the PDF resource context to add the shading, may be null
explicitName - the explicit name for the color space, may be null
iccStream - the ICC stream to associate with this color space
Returns:
the newly instantiated color space

makeInfo

protected PDFInfo makeInfo(String prod)
make an /Info object
Parameters:
prod - string indicating application producing the PDF
Returns:
the created /Info object

makeLink

public PDFLink makeLink(Rectangle2D rect,
                        String page,
                        String dest)
Make an internal link.
Parameters:
rect - the hotspot position in absolute coordinates
page - the target page reference value
dest - the position destination
Returns:
the new PDF link object

makeLink

public PDFLink makeLink(Rectangle2D rect,
                        String destination,
                        int linkType,
                        float yoffset)
make a link object
Parameters:
rect - the clickable rectangle
destination - the destination file
linkType - the link type
yoffset - the yoffset on the page for an internal link
Returns:
the PDFLink object created

makeLink

public PDFLink makeLink(Rectangle2D rect,
                        PDFAction pdfAction)
Create a PDF link to an existing PDFAction object
Parameters:
rect - the hotspot position in absolute coordinates
pdfAction - the PDFAction that this link refers to
Returns:
the new PDFLink object, or null if either rect or pdfAction is null

makeMetadata

public PDFMetadata makeMetadata(Metadata meta,
                                boolean readOnly)
Make a Metadata object.
Parameters:
meta - the DOM Document containing the XMP metadata.
readOnly - true if the metadata packet should be marked read-only
Returns:
the newly created Metadata object

makeNameTreeNode

public PDFNameTreeNode makeNameTreeNode()
Make a name tree node.
Returns:
the new name tree node

makeNames

public PDFNames makeNames()
Make a names dictionary (the /Names object).
Returns:
the new PDFNames object

makeOutline

public PDFOutline makeOutline(PDFOutline parent,
                              String label,
                              String actionRef,
                              boolean showSubItems)
Make an outline object and add it to the given parent
Parameters:
parent - the parent PDFOutline object (may be null)
label - the title for the new outline object
actionRef - the action reference string to be placed after the /A
showSubItems - whether to initially display child outline items
Returns:
the new PDF outline object

makeOutline

public PDFOutline makeOutline(PDFOutline parent,
                              String label,
                              String destination,
                              float yoffset,
                              boolean showSubItems)
Make an outline object and add it to the given outline
Parameters:
parent - parent PDFOutline object which may be null
label - the title for the new outline object
destination - the reference string for the action to go to
yoffset - the yoffset on the destination page
showSubItems - whether to initially display child outline items
Returns:
the new PDF outline object

makeOutline

public PDFOutline makeOutline(PDFOutline parent,
                              String label,
                              PDFAction pdfAction,
                              boolean showSubItems)
Make an outline object and add it to the given parent
Parameters:
parent - the parent PDFOutline object (may be null)
label - the title for the new outline object
pdfAction - the action that this outline item points to - must not be null!
showSubItems - whether to initially display child outline items
Returns:
the new PDFOutline object, or null if pdfAction is null

makeOutputIntent

public PDFOutputIntent makeOutputIntent()
Make a OutputIntent dictionary.
Returns:
the newly created OutputIntent dictionary

makePDFICCStream

public PDFICCStream makePDFICCStream()
Create a PDFICCStream
Returns:
the new PDF ICC stream object

makePage

public PDFPage makePage(PDFResources resources,
                        int pageWidth,
                        int pageHeight)
Make a /Page object. The page is assigned an object number immediately so references can already be made. The page must be added to the PDFDocument later using addObject().
Parameters:
resources - resources object to use
pageWidth - width of the page in points
pageHeight - height of the page in points
Returns:
the created /Page object

makePage

public PDFPage makePage(PDFResources resources,
                        int pageWidth,
                        int pageHeight,
                        int pageIndex)
Make a /Page object. The page is assigned an object number immediately so references can already be made. The page must be added to the PDFDocument later using addObject().
Parameters:
resources - resources object to use
pageWidth - width of the page in points
pageHeight - height of the page in points
pageIndex - index of the page (zero-based)
Returns:
the created /Page object

makePages

public PDFPages makePages()
Make a /Pages object. This object is written in the trailer.
Returns:
a new PDF Pages object for adding pages to

makePattern

public PDFPattern makePattern(PDFResourceContext res,
                              int thePatternType,
                              PDFResources theResources,
                              int thePaintType,
                              int theTilingType,
                              List theBBox,
                              double theXStep,
                              double theYStep,
                              List theMatrix,
                              List theXUID,
                              StringBuffer thePatternDataStream)
Make a tiling pattern
Parameters:
res - the PDF resource context to add the shading, may be null
thePatternType - the type of pattern, which is 1 for tiling.
theResources - the resources associated with this pattern
thePaintType - 1 or 2, colored or uncolored.
theTilingType - 1, 2, or 3, constant spacing, no distortion, or faster tiling
theBBox - List of Doubles: The pattern cell bounding box
theXStep - horizontal spacing
theYStep - vertical spacing
theMatrix - Optional List of Doubles transformation matrix
theXUID - Optional vector of Integers that uniquely identify the pattern
thePatternDataStream - The stream of pattern data to be tiled.
Returns:
the PDF pattern that was created

makePattern

public PDFPattern makePattern(PDFResourceContext res,
                              int thePatternType,
                              PDFShading theShading,
                              List theXUID,
                              StringBuffer theExtGState,
                              List theMatrix)
Make a smooth shading pattern
Parameters:
res - the PDF resource context to add the shading, may be null
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:List of Doubles that specify the matrix.
Returns:
the PDF pattern that was created

makeResources

public PDFResources makeResources()
Make a /Resources object. This object is written in the trailer.
Returns:
a new PDF resources object

makeRoot

public PDFRoot makeRoot(PDFPages pages)
Make a /Catalog (Root) object. This object is written in the trailer.
Parameters:
pages - the pages pdf object that the root points to
Returns:
the new pdf root object for this document

makeShading

public PDFShading makeShading(PDFResourceContext res,
                              int theShadingType,
                              PDFDeviceColorSpace theColorSpace,
                              List theBackground,
                              List theBBox,
                              boolean theAntiAlias,
                              List theDomain,
                              List theMatrix,
                              PDFFunction theFunction)
make a function based shading object
Parameters:
res - the PDF resource context to add the shading, may be null
theShadingType - The type of shading object, which should be 1 for function based shading.
theColorSpace - The colorspace is 'DeviceRGB' or something similar.
theBackground - An array of color components appropriate to the colorspace key specifying a single color value. This key is used by the f operator buy ignored by the sh operator.
theBBox - List of double's representing a rectangle in the coordinate space that is current at the time of shading is imaged. Temporary clipping boundary.
theAntiAlias - Whether or not to anti-alias.
theDomain - Optional vector of Doubles specifying the domain.
theMatrix - List of Doubles specifying the matrix. If it's a pattern, then the matrix maps it to pattern space. If it's a shading, then it maps it to current user space. It's optional, the default is the identity matrix
theFunction - The PDF Function that maps an (x,y) location to a color
Returns:
the PDF shading that was created

makeShading

public PDFShading makeShading(PDFResourceContext res,
                              int theShadingType,
                              PDFDeviceColorSpace theColorSpace,
                              List theBackground,
                              List theBBox,
                              boolean theAntiAlias,
                              List theCoords,
                              List theDomain,
                              PDFFunction theFunction,
                              List theExtend)
Make an axial or radial shading object.
Parameters:
res - the PDF resource context to add the shading, may be null
theShadingType - 2 or 3 for axial or radial shading
theColorSpace - "DeviceRGB" or similar.
theBackground - theBackground An array of color components appropriate to the colorspace key specifying a single color value. This key is used by the f operator buy ignored by the sh operator.
theBBox - List of double's representing a rectangle in the coordinate space that is current at the time of shading is imaged. Temporary clipping boundary.
theAntiAlias - Default is false
theCoords - List of four (type 2) or 6 (type 3) Double
theDomain - List of Doubles specifying the domain
theFunction - the Stitching (PDFfunction type 3) function, even if it's stitching a single function
theExtend - List of Booleans of whether to extend the start and end colors past the start and end points The default is [false, false]
Returns:
the PDF shading that was created

makeShading

public PDFShading makeShading(PDFResourceContext res,
                              int theShadingType,
                              PDFDeviceColorSpace theColorSpace,
                              List theBackground,
                              List theBBox,
                              boolean theAntiAlias,
                              int theBitsPerCoordinate,
                              int theBitsPerComponent,
                              List theDecode,
                              int theVerticesPerRow,
                              PDFFunction theFunction)
make a Lattice-Form Gouraud mesh shading object
Parameters:
res - the PDF resource context to add the shading, may be null
theShadingType - 5 for lattice-Form Gouraud shaded-triangle mesh without spaces. "Shading1" or "Sh1" are good examples.
theColorSpace - "DeviceRGB" or similar.
theBackground - theBackground An array of color components appropriate to the colorspace key specifying a single color value. This key is used by the f operator buy ignored by the sh operator.
theBBox - List of double's representing a rectangle in the coordinate space that is current at the time of shading is imaged. Temporary clipping boundary.
theAntiAlias - Default is false
theBitsPerCoordinate - 1,2,4,8,12,16, 24, or 32
theBitsPerComponent - 1,2,4,8,12,24,32
theDecode - List of Doubles. See page 305 in PDF 1.3 spec.
theVerticesPerRow - number of vertices in each "row" of the lattice.
theFunction - The PDFFunction that's mapped on to this shape
Returns:
the PDF shading that was created

makeShading

public PDFShading makeShading(PDFResourceContext res,
                              int theShadingType,
                              PDFDeviceColorSpace theColorSpace,
                              List theBackground,
                              List theBBox,
                              boolean theAntiAlias,
                              int theBitsPerCoordinate,
                              int theBitsPerComponent,
                              int theBitsPerFlag,
                              List theDecode,
                              PDFFunction theFunction)
Make a free-form gouraud shaded triangle mesh, coons patch mesh, or tensor patch mesh shading object
Parameters:
res - the PDF resource context to add the shading, may be null
theShadingType - 4, 6, or 7 depending on whether it's Free-form gouraud-shaded triangle meshes, coons patch meshes, or tensor product patch meshes, respectively.
theColorSpace - "DeviceRGB" or similar.
theBackground - theBackground An array of color components appropriate to the colorspace key specifying a single color value. This key is used by the f operator buy ignored by the sh operator.
theBBox - List of double's representing a rectangle in the coordinate space that is current at the time of shading is imaged. Temporary clipping boundary.
theAntiAlias - Default is false
theBitsPerCoordinate - 1,2,4,8,12,16,24 or 32.
theBitsPerComponent - 1,2,4,8,12, and 16
theBitsPerFlag - 2,4,8.
theDecode - List of Doubles see PDF 1.3 spec pages 303 to 312.
theFunction - the PDFFunction
Returns:
the PDF shading that was created

makeStream

public PDFStream makeStream(String type,
                            boolean add)
Make a stream object
Parameters:
type - the type of stream to be created
add - if true then the stream will be added immediately
Returns:
the stream object created

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.