|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.content.CSDeviceAdapter
de.intarsys.pdf.content.CSVirtualDevice
de.intarsys.pdf.content.common.CSCreator
public class CSCreator
An implementation helping to create a PDF content stream using higher level abstractions than the PDF operators.
This object deals with two abstractions:
The CSContent
, a sequence of PDF operators. The CSContent
can be read from an existing object like a PDPage
or a PDForm
or can be newly created, suing the factory methods in CSContent
.
The second abstraction is the IResourcesProvider
for the
PDResources
like Fonts, XObjects, ... that are referenced in the
CSContent
. The resources of the provider are not accessed until a
resource relevant operation is created.
This implementation is (nearly, see AffineTransform) independent of AWT or any other window toolkit.
Field Summary | |
---|---|
static float |
KAPPA
a constant for the ease of circle creation with beziers |
static int |
VALUE_COLOR_PRECISION
|
static int |
VALUE_COORDINATE_PRECISION
|
static int |
VALUE_DASH_PRECISION
|
static int |
VALUE_FACTOR_PRECISION
|
static int |
VALUE_FLATNESS_PRECISION
|
static int |
VALUE_FONT_PRECISION
|
static int |
VALUE_GRAY_PRECISION
|
static int |
VALUE_WIDTH_PRECISION
|
Fields inherited from class de.intarsys.pdf.content.CSDeviceAdapter |
---|
MAX_STACK_SIZE |
Method Summary | |
---|---|
void |
close()
Close the device after use. |
void |
compatibilityBegin()
Begin a compatibility section. |
void |
compatibilityEnd()
End a compatibility section. |
void |
copy(CSContent otherContent)
Copy all operations from otherContent to this . |
static CSCreator |
createFromContent(CSContent content,
IResourcesProvider resourcesProvider)
Create a CSCreator on an existing CSContent . |
static CSCreator |
createFromProvider(IContentStreamProvider provider)
Create a CSCreator on an existing CSContent that will be
read from the IContentStreamProvider . |
static CSCreator |
createNew(IContentStreamProvider provider)
Create a CSCreator on a newly created CSContent . |
static CSCreator |
createNewDetached(IResourcesProvider provider)
Create a CSCreator on a newly created CSContent . |
void |
doShading(COSName name,
PDShading shading)
Paint shape and color shading according to shading dictionary. |
void |
doXObject(COSName name,
PDXObject xObject)
Stroke a PDXObject. |
void |
flush()
Flush all pending operations on the stream. |
CSContent |
getContent()
The CSContent we are working on. |
IContentStreamProvider |
getContentStreamProvider()
|
IResourcesProvider |
getResourcesProvider()
The IResourcesProvider associated with this. |
void |
inlineImage(PDImage img)
Stroke an inlined image. |
void |
markedContentBegin(COSName tag)
Begin a marked content sequence. |
void |
markedContentBeginProperties(COSName tag,
COSName resourceName,
COSDictionary properties)
Begin a marked content sequence with a property list. |
void |
markedContentEnd()
End marked content sequence started with "BMC" or "BDC". |
void |
markedContentPoint(COSName tag)
Set a marked point. |
void |
markedContentPointProperties(COSName tag,
COSName resourceName,
COSDictionary properties)
Define a marked content point with a property list. |
void |
open(ICSInterpreter pInterpreter)
Open the device for use by interpreter . |
void |
pathClipEvenOdd()
Intersect the current clipping path with the current path using the even/odd rule. |
void |
pathClipNonZero()
Intersect the current clipping path with the current path using the nonzero winding rule. |
void |
pathClose()
Close the path and append a line segment from the current coordinate to the starting point of the path. |
void |
pathCloseFillStrokeEvenOdd()
Close, Fill and then stroke the path using the even/odd rule. |
void |
pathCloseFillStrokeNonZero()
Close, Fill and then stroke the path using the non zero winding rule. |
void |
pathCloseStroke()
Close and then stroke the path. |
void |
pathEnd()
End the path without filling or stroking. |
void |
pathFillEvenOdd()
Fill the path using the even/odd rule. |
void |
pathFillNonZero()
Fill the path using the non-zero winding rule. |
void |
pathFillStrokeEvenOdd()
Fill and then stroke the path using the even/odd rule. |
void |
pathFillStrokeNonZero()
Fill and then stroke the path using the non-zero winding rule. |
void |
pathStroke()
Stroke the current path. |
void |
penCircle(float x,
float y,
float r)
Draw a circle. |
void |
penCurveToC(float x1,
float y1,
float x2,
float y2,
float x3,
float y3)
Append a cubic bezier curve to the path. |
void |
penCurveToV(float x2,
float y2,
float x3,
float y3)
Append a cubic bezier curve to the path. |
void |
penCurveToY(float x1,
float y1,
float x3,
float y3)
Append a cubic bezier curve to the path. |
void |
penEllipse(float x,
float y,
float rx,
float ry)
Draw an ellipse. |
void |
penLineTo(float x,
float y)
Add a line from the current point to x , y . |
void |
penMoveTo(float x,
float y)
Move the current point to x , y . |
void |
penRectangle(float x,
float y,
float w,
float h)
Append a complete rectangle to as a subpath. |
void |
restoreState()
Restore the graphics state from the stack. |
void |
saveState()
Save the current graphics state on a stack for later use. |
void |
setExtendedState(COSName name,
PDExtGState gstate)
Set the dictionary as the new graphic state, creating a new PDResources entry if needed. |
void |
setFlatnessTolerance(float flatness)
Set the flatness tolerance. |
void |
setLineCap(int style)
The line cap specifies the shape to be used at the ends of open subpaths. |
void |
setLineDash(float[] pattern,
float phase)
Define the pattern used to stroke paths. |
void |
setLineDash(float unitsOn,
float unitsOff,
float phase)
Convenience method to access "setLineDash". |
void |
setLineJoin(int style)
The line join specifies the shape to be used at the connection points of two adjacent lines in a path. |
void |
setLineWidth(float w)
Set the thickness of the line used to stroke a path. |
void |
setMiterLimit(float miterLimit)
The maximum ratio of MiterLength/LineWidth when connecting two lines with miter style. |
void |
setNonStrokeColorCMYK(float c,
float m,
float y,
float k)
Set the non stroking color space to /DeviceCMYK and set the color values c , m , y , K . |
void |
setNonStrokeColorGray(float gray)
Set the non stroking color space to /DeviceGray and set the gray level to gray . |
void |
setNonStrokeColorRGB(float red,
float green,
float blue)
Set the non stroking color space to /DeviceRGB and set the color values r , g , b . |
void |
setNonStrokeColorSpace(COSName name,
PDColorSpace colorSpace)
Set color space for non-stroking. |
void |
setNonStrokeColorValues(float[] values)
Set the color used for non stroking operations, dependent on the currently selected color spaces. |
void |
setNonStrokeColorValues(float[] values,
COSName name,
PDPattern pattern)
Set the color used for non stroking operations, dependent on the currently selected special color spaces. |
void |
setRenderingIntent(COSName intent)
Set the color rendering intent. |
void |
setStrokeColorCMYK(float cyan,
float magenta,
float yellow,
float key)
Set the stroking color space to /DeviceCMYK and set the color values c , m , y , K . |
void |
setStrokeColorGray(float gray)
Set the stroking color space to /DeviceGray and set the gray level to gray . |
void |
setStrokeColorRGB(float red,
float green,
float blue)
Set the stroking color space to /DeviceRGB and set the color values r , g , b . |
void |
setStrokeColorSpace(COSName name,
PDColorSpace colorSpace)
Set color space for stroking. |
void |
setStrokeColorValues(float[] values)
Set the color used for stroking operations, dependent on the currently selected color spaces. |
void |
setStrokeColorValues(float[] values,
COSName name,
PDPattern pattern)
Set the color used for stroking operations, dependent on the currently selected special color spaces. |
void |
textBegin()
Begin text mode. |
void |
textEnd()
End text mode. |
void |
textLineMove(float dx,
float dy)
Move the current lext line by dx , dy . |
void |
textLineMoveSetLeading(float dx,
float dy)
Move the current text line by dx , dy . |
void |
textLineMoveTo(float x,
float y)
Move the current text line to absolute position x ,
y . |
void |
textLineNew()
Move the current position to a new line. |
void |
textMove(float dx,
float dy)
Move the current text cursor by dx , dy . |
void |
textMoveTo(float x,
float y)
Move the current text cursor to x , y . |
void |
textSetCharSpacing(float charSpace)
Set the character spacing. |
void |
textSetFont(COSName name,
PDFont font,
float size)
Set the current font and size. |
void |
textSetHorizontalScaling(float scale)
Set the horizontal scling factor. |
void |
textSetLeading(float leading)
Set the text leading. |
void |
textSetRenderingMode(int rendering)
Set the text rendering mode. |
void |
textSetRise(float rise)
Set the text rise. |
void |
textSetTransform(float a,
float b,
float c,
float d,
float e,
float f)
Set the text transformation matrix. |
void |
textSetWordSpacing(float wordSpace)
Set the word spacing. |
void |
textShow(byte[] text,
int offset,
int length)
Show a sequence of bytes as text. |
void |
textT3SetGlyphWidth(float x,
float y)
Set the glyph width for a type 3 font. |
void |
textT3SetGlyphWidthBB(float x,
float y,
float llx,
float lly,
float urx,
float ury)
Set the glyph width and bounding box for a type 3 font. |
void |
transform(float a,
float b,
float c,
float d,
float e,
float f)
Modify the current transformation matrix by concatenating the transformations. |
Methods inherited from class de.intarsys.pdf.content.CSDeviceAdapter |
---|
getGraphicsState, getInterpreter, textShow |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float KAPPA
public static final int VALUE_COLOR_PRECISION
public static final int VALUE_COORDINATE_PRECISION
public static final int VALUE_DASH_PRECISION
public static final int VALUE_FACTOR_PRECISION
public static final int VALUE_FLATNESS_PRECISION
public static final int VALUE_FONT_PRECISION
public static final int VALUE_GRAY_PRECISION
public static final int VALUE_WIDTH_PRECISION
Method Detail |
---|
public static CSCreator createFromContent(CSContent content, IResourcesProvider resourcesProvider)
CSCreator
on an existing CSContent
. The content
may be read from a PDPage or a PDForm or can be completely new.
This is the most basic factory method where you have the freedom to decide where the content comes from, where the resources come frome and wher the content will be used.
content
- The content stream to write to.resourcesProvider
- The provider for the PDResources
that contain the
resources referenced in the CSContent.
CSCreator
public static CSCreator createNew(IContentStreamProvider provider)
CSCreator
on a newly created CSContent
. The
content is linked with the IContentStreamProvider
and flushed to
it when calling "flush".
provider
- The provider whose content stream will be replaced with the
result of this CSCreator
CSCreator
public static CSCreator createNewDetached(IResourcesProvider provider)
CSCreator
on a newly created CSContent
. The
content is not linked with the provider, which is only used the a
IResourcesProvider
. The resulting content can be accessed using
"getContent".
provider
- The provider for resources within the new CSContent
.
CSCreator
public static CSCreator createFromProvider(IContentStreamProvider provider)
CSCreator
on an existing CSContent
that will be
read from the IContentStreamProvider
. The old contents will be
preserved, all operations are concatenated. The content is linked with
the IContentStreamProvider
and flushed to it when calling
"flush".
provider
- The provider whose content stream will be replaced with the
result of this CSCreator
CSCreator
public void open(ICSInterpreter pInterpreter)
ICSDevice
interpreter
.
open
in interface ICSDevice
open
in class CSVirtualDevice
public void compatibilityBegin()
ICSDevice
PDF graphics operator "BX"
compatibilityBegin
in interface ICSDevice
compatibilityBegin
in class CSDeviceAdapter
public void compatibilityEnd()
ICSDevice
PDF graphics operator "EX"
compatibilityEnd
in interface ICSDevice
compatibilityEnd
in class CSDeviceAdapter
public void copy(CSContent otherContent)
otherContent
to this
.
Currently no resources are copied for otherContent
otherContent
- The source of the graphic operations.public void doShading(COSName name, PDShading shading)
ICSDevice
PDF graphics operator "sh"
doShading
in interface ICSDevice
doShading
in class CSDeviceAdapter
name
- The logical name of the resource in the PDResources
shading
- The PDShading
to be painted.public void doXObject(COSName name, PDXObject xObject)
ICSDevice
PDF graphics operator "Do"
doXObject
in interface ICSDevice
doXObject
in class CSDeviceAdapter
name
- The logical name of the resource in the PDResources
xObject
- The PDXObject
to be stroked.public void flush()
This must be called before the getContent
operation is
valid.
public void close()
ICSDevice
close
in interface ICSDevice
close
in class CSDeviceAdapter
public CSContent getContent()
CSContent
we are working on. After calling flush
the CSContent
contains all operations stemming from calls to
this.
CSContent
we are working on.public IResourcesProvider getResourcesProvider()
IResourcesProvider
associated with this.
IResourcesProvider
associated with this.public void inlineImage(PDImage img)
ICSDevice
PDF graphics operators "BI", "ID", "EI"
inlineImage
in interface ICSDevice
inlineImage
in class CSDeviceAdapter
img
- The inlined image. The image may use some special keys instead
of the standard PDImage
dictionary keys.public void markedContentBegin(COSName tag)
ICSDevice
PDF graphics operator "BMC"
markedContentBegin
in interface ICSDevice
markedContentBegin
in class CSDeviceAdapter
tag
- The tag indicating the role or significance.public void markedContentBeginProperties(COSName tag, COSName resourceName, COSDictionary properties)
ICSDevice
PDF graphics operator "BDC"
markedContentBeginProperties
in interface ICSDevice
markedContentBeginProperties
in class CSDeviceAdapter
tag
- The tag indicating the role or significance.resourceName
- The logical name of the resource in the PDResources
properties
- The properties for the marked content sequence.public void markedContentEnd()
ICSDevice
PDF graphics operator "EMC"
markedContentEnd
in interface ICSDevice
markedContentEnd
in class CSDeviceAdapter
public void markedContentPoint(COSName tag)
ICSDevice
PDF graphics operator "MP"
markedContentPoint
in interface ICSDevice
markedContentPoint
in class CSDeviceAdapter
tag
- The tag indicating the role or significance.public void markedContentPointProperties(COSName tag, COSName resourceName, COSDictionary properties)
ICSDevice
PDF graphics operator "DP"
markedContentPointProperties
in interface ICSDevice
markedContentPointProperties
in class CSDeviceAdapter
tag
- The tag indicating the role or significance.resourceName
- The logical name of the resource in the PDResources
properties
- The properties for the marked content point.public void pathClipEvenOdd()
ICSDevice
PDF graphics operator "W*"
pathClipEvenOdd
in interface ICSDevice
pathClipEvenOdd
in class CSDeviceAdapter
public void pathClipNonZero()
ICSDevice
PDF graphics operator "W"
pathClipNonZero
in interface ICSDevice
pathClipNonZero
in class CSDeviceAdapter
public void pathClose()
ICSDevice
PDF graphics operator "h"
pathClose
in interface ICSDevice
pathClose
in class CSDeviceAdapter
public void pathCloseFillStrokeEvenOdd()
ICSDevice
PDF graphics operator "b*"
pathCloseFillStrokeEvenOdd
in interface ICSDevice
pathCloseFillStrokeEvenOdd
in class CSDeviceAdapter
public void pathCloseFillStrokeNonZero()
ICSDevice
PDF graphics operator "b"
pathCloseFillStrokeNonZero
in interface ICSDevice
pathCloseFillStrokeNonZero
in class CSDeviceAdapter
public void pathCloseStroke()
ICSDevice
PDF graphics operator "s"
pathCloseStroke
in interface ICSDevice
pathCloseStroke
in class CSDeviceAdapter
public void pathEnd()
ICSDevice
This may for example be used to manipulate the clipping path without a painting operation.
PDF graphics operator "n"
pathEnd
in interface ICSDevice
pathEnd
in class CSDeviceAdapter
public void pathFillEvenOdd()
ICSDevice
PDF graphics operator "f*"
pathFillEvenOdd
in interface ICSDevice
pathFillEvenOdd
in class CSDeviceAdapter
public void pathFillNonZero()
ICSDevice
An open subpath is closed before filling.
PDF graphics operator "f"
pathFillNonZero
in interface ICSDevice
pathFillNonZero
in class CSDeviceAdapter
public void pathFillStrokeEvenOdd()
ICSDevice
PDF graphics operator "B*"
pathFillStrokeEvenOdd
in interface ICSDevice
pathFillStrokeEvenOdd
in class CSDeviceAdapter
public void pathFillStrokeNonZero()
ICSDevice
PDF graphics operator "B"
pathFillStrokeNonZero
in interface ICSDevice
pathFillStrokeNonZero
in class CSDeviceAdapter
public void pathStroke()
ICSDevice
PDF graphics operator "S"
pathStroke
in interface ICSDevice
pathStroke
in class CSDeviceAdapter
public void penCircle(float x, float y, float r)
x
,
y
in user space. r
defines the radius.
x
- The x coordinate of the center.y
- The y coordinate of the center.r
- The radiuspublic void penCurveToC(float x1, float y1, float x2, float y2, float x3, float y3)
ICSDevice
current
+---------* x1/y1
. _
-.
. *x2/y2
.
.
.
+ x3/y3
PDF graphics operator "c"
penCurveToC
in interface ICSDevice
penCurveToC
in class CSDeviceAdapter
x1
- x coordinate of first control pointy1
- y coordinate of first control pointx2
- x coordinate of second control pointy2
- y coordinate of second control pointx3
- x coordinate of endpointy3
- y coordinate of endpointpublic void penCurveToV(float x2, float y2, float x3, float y3)
ICSDevice
current
+
. _
-.
. *x2/y2
.
.
.
+ x3/y3
PDF graphics operator "v"
penCurveToV
in interface ICSDevice
penCurveToV
in class CSDeviceAdapter
x2
- x coordinate of second control pointy2
- y coordinate of second control pointx3
- x coordinate of endpointy3
- y coordinate of endpointpublic void penCurveToY(float x1, float y1, float x3, float y3)
ICSDevice
The curve extends from the current point to x3, y3, where x1,y1 and x3,y3
are the bezier control points.
current
+---------* x1/y1
. _
-.
.
.
.
.
+ x3/y3
PDF graphics operator "y"
penCurveToY
in interface ICSDevice
penCurveToY
in class CSDeviceAdapter
x1
- x coordinate of first control pointy1
- y coordinate of first control pointx3
- x coordinate of endpointy3
- y coordinate of endpointpublic void penEllipse(float x, float y, float rx, float ry)
x
,
y
in user space. rx
and ry
define the radius in x and y direction respectively.
x
- The x coordinate of the center.y
- The y coordinate of the center.rx
- The radius in x directionry
- The radius in y directionpublic void penLineTo(float x, float y)
ICSDevice
x
, y
.
The new current point is x
, y
.
PDF graphics operator "l"
penLineTo
in interface ICSDevice
penLineTo
in class CSDeviceAdapter
x
- The new current x coordinatey
- The new current y coordinatepublic void penMoveTo(float x, float y)
ICSDevice
x
, y
. No line
is added to the path, a new subpath is started.
PDF graphics operator "m"
penMoveTo
in interface ICSDevice
penMoveTo
in class CSDeviceAdapter
x
- The new current x coordinatey
- The new current y coordinatepublic void penRectangle(float x, float y, float w, float h)
ICSDevice
The lower left corner is at x
, y
, the
dimensions are width
and height
. The
numbers are defined in user space.
PDF graphics operator "re"
penRectangle
in interface ICSDevice
penRectangle
in class CSDeviceAdapter
x
- The x coordinate of the lower left corner in user spacey
- The y coordinate of the lower left corner in user spacew
- The width in user spaceh
- The height in user spacepublic void restoreState()
ICSDevice
PDF graphics operator "Q"
restoreState
in interface ICSDevice
restoreState
in class CSDeviceAdapter
public void saveState()
ICSDevice
PDF graphics operator "q"
saveState
in interface ICSDevice
saveState
in class CSDeviceAdapter
public void setLineDash(float unitsOn, float unitsOff, float phase)
unitsOn
- unitsOff
- phase
- public void setExtendedState(COSName name, PDExtGState gstate)
ICSDevice
PDResources
entry if needed.
PDF graphics operator "gs"
setExtendedState
in interface ICSDevice
setExtendedState
in class CSDeviceAdapter
name
- The logical name of the resource in the PDResources
gstate
- The new PDExtGState
public void setFlatnessTolerance(float flatness)
ICSDevice
flatness
is a value between 0
and 100, with 0 defining the device's default flatness tolerance.
PDF graphics operator "i"
setFlatnessTolerance
in interface ICSDevice
setFlatnessTolerance
in class CSDeviceAdapter
flatness
- The flatness tolerance between 0 and 100.public void setLineCap(int style)
ICSDevice
0: Butt. The stroke is cut at the endpoint.
1: Round. A circle is drawn with the diamter of the line width at the endpoint
2: Square. A square is drawn with its center at the endpoint.
PDF graphics operator "J"
setLineCap
in interface ICSDevice
setLineCap
in class CSDeviceAdapter
style
- The line cap style to use (0,1 or 2)public void setLineDash(float[] pattern, float phase)
ICSDevice
unitsOn
defines a
length in user space where the line is drawn, unitsOff
defines a length in user space wher the line is not drawn.
phase
defines a "offset" in the pattern definition.
This is a simplified version that only allows for a two phase pattern.
PDF graphics operator "d"
setLineDash
in interface ICSDevice
setLineDash
in class CSDeviceAdapter
pattern
- The pattern array for the dashphase
- Offset in patternpublic void setLineJoin(int style)
ICSDevice
0: Miter Join, the outer line boreders are extended until they meet.
1: Round join. A circle is drawn at the meeting point with its
diameter the same as the line width.
2: Bevel join. The segments are cut at the endpoints as in the line cap
style "Butt". The empty triangle is filled.
PDF graphics operator "j"
setLineJoin
in interface ICSDevice
setLineJoin
in class CSDeviceAdapter
style
- The line join style to use (one of 0,1,2)public void setLineWidth(float w)
ICSDevice
A width of zero denotes the thinest line that can be rendered.
PDF graphics operator "w"
setLineWidth
in interface ICSDevice
setLineWidth
in class CSDeviceAdapter
w
- The line width in user space.public void setMiterLimit(float miterLimit)
ICSDevice
PDF graphics operator "M"
setMiterLimit
in interface ICSDevice
setMiterLimit
in class CSDeviceAdapter
miterLimit
- The maximum ratio of MiterLength/LineWidth when connecting two
lines with miter style.public void setNonStrokeColorCMYK(float c, float m, float y, float k)
ICSDevice
c
, m
, y
, K
.
setNonStrokeColorCMYK
in interface ICSDevice
setNonStrokeColorCMYK
in class CSDeviceAdapter
c
- A number between 0 (minimum) and 1 (maximum)m
- A number between 0 (minimum) and 1 (maximum)y
- A number between 0 (minimum) and 1 (maximum)k
- A number between 0 (minimum) and 1 (maximum)public void setNonStrokeColorGray(float gray)
ICSDevice
gray
.
setNonStrokeColorGray
in interface ICSDevice
setNonStrokeColorGray
in class CSDeviceAdapter
gray
- A number between 0 (black) and 1 (white)public void setNonStrokeColorRGB(float red, float green, float blue)
ICSDevice
r
, g
, b
.
setNonStrokeColorRGB
in interface ICSDevice
setNonStrokeColorRGB
in class CSDeviceAdapter
red
- A number between 0 (minimum) and 1 (maximum)green
- A number between 0 (minimum) and 1 (maximum)blue
- A number between 0 (minimum) and 1 (maximum)public void setNonStrokeColorSpace(COSName name, PDColorSpace colorSpace)
ICSDevice
PDF graphics operator "cs"
setNonStrokeColorSpace
in interface ICSDevice
setNonStrokeColorSpace
in class CSDeviceAdapter
name
- The logical name of the resource in the PDResources
colorSpace
- The new PDColorSpace
public void setNonStrokeColorValues(float[] values)
ICSDevice
PDF graphics operator "sc" or "scn", dependen on the active color space.
setNonStrokeColorValues
in interface ICSDevice
setNonStrokeColorValues
in class CSDeviceAdapter
values
- The color valuespublic void setNonStrokeColorValues(float[] values, COSName name, PDPattern pattern)
ICSDevice
PDF graphics operator "scn"
setNonStrokeColorValues
in interface ICSDevice
setNonStrokeColorValues
in class CSDeviceAdapter
values
- The color values.name
- An optional logical name of the resource in the
PDResources
pattern
- An optional PDPattern
public void setRenderingIntent(COSName intent)
ICSDevice
PDF graphics operator "ri"
setRenderingIntent
in interface ICSDevice
setRenderingIntent
in class CSDeviceAdapter
intent
- The name of the rendering intent.public void setStrokeColorCMYK(float cyan, float magenta, float yellow, float key)
ICSDevice
c
, m
, y
, K
.
setStrokeColorCMYK
in interface ICSDevice
setStrokeColorCMYK
in class CSDeviceAdapter
cyan
- A number between 0 (minimum) and 1 (maximum)magenta
- A number between 0 (minimum) and 1 (maximum)yellow
- A number between 0 (minimum) and 1 (maximum)key
- A number between 0 (minimum) and 1 (maximum)public void setStrokeColorGray(float gray)
ICSDevice
gray
.
setStrokeColorGray
in interface ICSDevice
setStrokeColorGray
in class CSDeviceAdapter
gray
- A number between 0 (black) and 1 (white)public void setStrokeColorRGB(float red, float green, float blue)
ICSDevice
r
, g
, b
.
setStrokeColorRGB
in interface ICSDevice
setStrokeColorRGB
in class CSDeviceAdapter
red
- A number between 0 (minimum) and 1 (maximum)green
- A number between 0 (minimum) and 1 (maximum)blue
- A number between 0 (minimum) and 1 (maximum)public void setStrokeColorSpace(COSName name, PDColorSpace colorSpace)
ICSDevice
PDF graphics operator "CS"
setStrokeColorSpace
in interface ICSDevice
setStrokeColorSpace
in class CSDeviceAdapter
name
- The logical name of the resource in the PDResources
colorSpace
- The new PDColorSpace
public void setStrokeColorValues(float[] values)
ICSDevice
PDF graphics operator "SC" or "SCN", dependen on the active color space.
setStrokeColorValues
in interface ICSDevice
setStrokeColorValues
in class CSDeviceAdapter
values
- The color values.public void setStrokeColorValues(float[] values, COSName name, PDPattern pattern)
ICSDevice
PDF graphics operator "SCN"
setStrokeColorValues
in interface ICSDevice
setStrokeColorValues
in class CSDeviceAdapter
values
- The color values.name
- An optional logical name of the resource in the
PDResources
pattern
- An optional PDPattern
public void textMoveTo(float x, float y)
ICSDevice
x
, y
.
There is no graphics operator for this. It is implemented as a tool for the ease of creating a content stream.
textMoveTo
in interface ICSDevice
textMoveTo
in class CSDeviceAdapter
x
- The x coordinate for the next glyph starting point .y
- The y coordinate for the next glyph starting point .public void textMove(float dx, float dy)
ICSDevice
dx
, dy
.
There is no graphics operator for this. It is implemented as a tool for the ease of creating a content stream.
textMove
in interface ICSDevice
textMove
in class CSDeviceAdapter
dx
- The x offset for the new glyph starting point from the current
text cursor position.dy
- The x offset for the new glyph starting point from the current
text cursor position.public void textShow(byte[] text, int offset, int length)
ICSDevice
PDF graphics operator "Tj"
textShow
in interface ICSDevice
textShow
in class CSDeviceAdapter
text
- The bytes to be shown.public void textBegin()
ICSDevice
PDF graphics operator "BT"
textBegin
in interface ICSDevice
textBegin
in class CSDeviceAdapter
public void textEnd()
ICSDevice
PDF graphics operator "ET"
textEnd
in interface ICSDevice
textEnd
in class CSDeviceAdapter
public void textLineMove(float dx, float dy)
ICSDevice
dx
, dy
.
PDF graphics operator "Td"
textLineMove
in interface ICSDevice
textLineMove
in class CSDeviceAdapter
dx
- The x offset for the new glyph starting point from the last
text line starting point.dy
- The y offset for the new glyph starting point from the last
text line starting point.public void textLineMoveSetLeading(float dx, float dy)
dx
, dy
. Set
the current leading to the dy
offset.
PDF graphics operator "TD"
dx
- The x offset for the new glyph starting point.dy
- The y offset for the new glyph starting point.public void textLineMoveTo(float x, float y)
x
,
y
.
PDF graphics operator "Td"
public void textLineNew()
ICSDevice
y
.
PDF graphics operator "T*"
textLineNew
in interface ICSDevice
textLineNew
in class CSDeviceAdapter
public void textSetCharSpacing(float charSpace)
ICSDevice
PDF graphics operator "Tc"
textSetCharSpacing
in interface ICSDevice
textSetCharSpacing
in class CSDeviceAdapter
charSpace
- The character spacingpublic void textSetFont(COSName name, PDFont font, float size)
ICSDevice
PDF graphics operator "Tf"
textSetFont
in interface ICSDevice
textSetFont
in class CSDeviceAdapter
name
- The logical name of the resource in the PDResources
font
- The new PDFont
size
- The new font size (scaling)public void textSetHorizontalScaling(float scale)
ICSDevice
PDF graphics operator "Tz"
textSetHorizontalScaling
in interface ICSDevice
textSetHorizontalScaling
in class CSDeviceAdapter
scale
- The new horizontal scaling factor.public void textSetLeading(float leading)
ICSDevice
PDF graphics operator "TL"
textSetLeading
in interface ICSDevice
textSetLeading
in class CSDeviceAdapter
leading
- The new leadingpublic void textSetRenderingMode(int rendering)
ICSDevice
PDF graphics operator "Tr"
textSetRenderingMode
in interface ICSDevice
textSetRenderingMode
in class CSDeviceAdapter
rendering
- The new rendering mode.public void textSetRise(float rise)
ICSDevice
PDF graphics operator "Ts"
textSetRise
in interface ICSDevice
textSetRise
in class CSDeviceAdapter
rise
- The new text rise (super/subscript) amountpublic void textSetTransform(float a, float b, float c, float d, float e, float f)
ICSDevice
PDF graphics operator "Tm"
textSetTransform
in interface ICSDevice
textSetTransform
in class CSDeviceAdapter
a
- operand 1,1 in the matrixb
- operand 1,2 in the matrixc
- operand 2,1 in the matrixd
- operand 2,2 in the matrixe
- operand 3,1 in the matrixf
- operand 3,2 in the matrixpublic void textSetWordSpacing(float wordSpace)
ICSDevice
PDF graphics operator "Tw"
textSetWordSpacing
in interface ICSDevice
textSetWordSpacing
in class CSDeviceAdapter
wordSpace
- The new word spacing.public void textT3SetGlyphWidth(float x, float y)
ICSDevice
PDF graphics operator "d0"
textT3SetGlyphWidth
in interface ICSDevice
textT3SetGlyphWidth
in class CSDeviceAdapter
x
- The glyph widthy
- must be 0public void textT3SetGlyphWidthBB(float x, float y, float llx, float lly, float urx, float ury)
ICSDevice
PDF graphics operator "d1"
textT3SetGlyphWidthBB
in interface ICSDevice
textT3SetGlyphWidthBB
in class CSDeviceAdapter
x
- The glyph width.y
- must be 0llx
- lower left x of bounding boxlly
- lower left y of bounding boxurx
- upper right x of bounding boxury
- upper right y of bounding boxpublic void transform(float a, float b, float c, float d, float e, float f)
ICSDevice
PDF graphics operator "cm"
transform
in interface ICSDevice
transform
in class CSDeviceAdapter
a
- operand 1,1 in the matrixb
- operand 1,2 in the matrixc
- operand 2,1 in the matrixd
- operand 2,2 in the matrixe
- operand 3,1 in the matrixf
- operand 3,2 in the matrixpublic IContentStreamProvider getContentStreamProvider()
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |