org.foray.pdf.object
Class PDFPattern
java.lang.Object
org.foray.pdf.object.PDFObject
org.foray.pdf.object.PDFPathPaint
org.foray.pdf.object.PDFPattern
- All Implemented Interfaces:
- org.axsl.pdf.PdfPathPaint, org.axsl.pdf.PdfPattern
public class PDFPattern
- extends PDFPathPaint
- implements org.axsl.pdf.PdfPattern
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(PDFDocument doc,
int thePatternType,
PDFShading theShading,
List<Integer> theXUID,
StringBuilder theExtGState,
List<Double> theMatrix)
Create a type 2 pattern (smooth shading). |
PDFPattern(PDFDocument doc,
PDFResources theResources,
int thePatternType,
int thePaintType,
int theTilingType,
List<Double> theBBox,
double theXStep,
double theYStep,
List<Double> theMatrix,
List<Integer> theXUID,
StringBuilder thePatternDataStream)
Create a tiling pattern (type 1). |
Methods inherited from class org.foray.pdf.object.PDFObject |
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, output, pdfID, pdfReference, setNumber, stringToByteArray |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PDFPattern
public PDFPattern(PDFDocument doc,
PDFResources theResources,
int thePatternType,
int thePaintType,
int theTilingType,
List<Double> theBBox,
double theXStep,
double theYStep,
List<Double> theMatrix,
List<Integer> theXUID,
StringBuilder thePatternDataStream)
- Create a tiling pattern (type 1).
- Parameters:
doc
- The PDF document being built.theResources
- the resources associated with this patternthePatternType
- 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
- List of Doubles: The pattern cell bounding boxtheXStep
- horizontal spacingtheYStep
- vertical spacingtheMatrix
- Optional List of Doubles transformation matrixtheXUID
- Optional List of Integers that uniquely identify the
pattern.thePatternDataStream
- The stream of pattern data to be tiled.
PDFPattern
public PDFPattern(PDFDocument doc,
int thePatternType,
PDFShading theShading,
List<Integer> theXUID,
StringBuilder theExtGState,
List<Double> theMatrix)
- Create a type 2 pattern (smooth shading).
- Parameters:
doc
- The PDF document being built.thePatternType
- the type of the pattern, which is 2, smooth shadingtheShading
- the PDF Shading object that comprises this patterntheXUID
- optional:the extended unique Identifier if used.theExtGState
- optional: the extended graphics state, if used.theMatrix
- Optional:List of Doubles that specify the matrix.
getName
public String getName()
- Get the name of the pattern.
- Returns:
- String representing the name of the pattern.
getSetterString
public String getSetterString(boolean fillNotStroke)
- Specified by:
getSetterString
in interface org.axsl.pdf.PdfPathPaint
toPDF
public String 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.
Copyright © 2017. All rights reserved.