jPod PDF library

de.intarsys.pdf.content
Class CSPathFilter

java.lang.Object
  extended by de.intarsys.pdf.content.CSDeviceFilter
      extended by de.intarsys.pdf.content.CSPathFilter
All Implemented Interfaces:
ICSDevice, ICSDeviceFeatures

public class CSPathFilter
extends CSDeviceFilter

Only path related operations will reach the device.


Constructor Summary
CSPathFilter(ICSDevice device)
           
 
Method Summary
 void doShading(COSName resourceName, PDShading shading)
          Paint shape and color shading according to shading dictionary.
 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 textBegin()
          Begin text mode.
 void textEnd()
          End text mode.
 void textLineMove(float dx, float dy)
          Move the current text line by dx, dy.
 void textLineNew()
          Move the current position to a new line.
 void textMove(float dx, float dy)
          Move the current text cursor represented by the current text state transform by dx, dy.
 void textMoveTo(float x, float y)
          Move the current text cursor represented by the current text state transform to x, y.
 void textSetCharSpacing(float charSpacing)
          Set the character spacing.
 void textSetFont(COSName resourceName, 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 renderingMode)
          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 wordSpacing)
          Set the word spacing.
 void textShow(byte[] text, int offset, int length)
          Show a sequence of bytes as text.
 void textShow(char[] chars, int offset, int length)
          Show a sequence of characters as text, using the current font encoding.
 void textShow(String text)
          Show a string value as text, using the current font encoding.
 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.
 
Methods inherited from class de.intarsys.pdf.content.CSDeviceFilter
close, compatibilityBegin, compatibilityEnd, doXObject, getDevice, getGraphicsState, getInterpreter, open, pathClipEvenOdd, pathClipNonZero, pathClose, pathCloseFillStrokeEvenOdd, pathCloseFillStrokeNonZero, pathCloseStroke, pathEnd, pathFillEvenOdd, pathFillNonZero, pathFillStrokeEvenOdd, pathFillStrokeNonZero, pathStroke, penCurveToC, penCurveToV, penCurveToY, penLineTo, penMoveTo, penRectangle, restoreState, saveState, setExtendedState, setFlatnessTolerance, setLineCap, setLineDash, setLineJoin, setLineWidth, setMiterLimit, setNonStrokeColorCMYK, setNonStrokeColorGray, setNonStrokeColorRGB, setNonStrokeColorSpace, setNonStrokeColorValues, setNonStrokeColorValues, setRenderingIntent, setStrokeColorCMYK, setStrokeColorGray, setStrokeColorRGB, setStrokeColorSpace, setStrokeColorValues, setStrokeColorValues, supportsColorSpace, supportsExtendedState, supportsFont, supportsInlineImage, supportsPattern, supportsProperties, supportsShading, supportsXObject, transform
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSPathFilter

public CSPathFilter(ICSDevice device)
Method Detail

doShading

public void doShading(COSName resourceName,
                      PDShading shading)
Description copied from interface: ICSDevice
Paint shape and color shading according to shading dictionary.

PDF graphics operator "sh"

Specified by:
doShading in interface ICSDevice
Overrides:
doShading in class CSDeviceFilter
Parameters:
resourceName - The logical name of the resource in the PDResources
shading - The PDShading to be painted.

inlineImage

public void inlineImage(PDImage img)
Description copied from interface: ICSDevice
Stroke an inlined image.

PDF graphics operators "BI", "ID", "EI"

Specified by:
inlineImage in interface ICSDevice
Overrides:
inlineImage in class CSDeviceFilter
Parameters:
img - The inlined image. The image may use some special keys instead of the standard PDImage dictionary keys.

markedContentBegin

public void markedContentBegin(COSName tag)
Description copied from interface: ICSDevice
Begin a marked content sequence.

PDF graphics operator "BMC"

Specified by:
markedContentBegin in interface ICSDevice
Overrides:
markedContentBegin in class CSDeviceFilter
Parameters:
tag - The tag indicating the role or significance.

markedContentBeginProperties

public void markedContentBeginProperties(COSName tag,
                                         COSName resourceName,
                                         COSDictionary properties)
Description copied from interface: ICSDevice
Begin a marked content sequence with a property list.

PDF graphics operator "BDC"

Specified by:
markedContentBeginProperties in interface ICSDevice
Overrides:
markedContentBeginProperties in class CSDeviceFilter
Parameters:
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.

markedContentEnd

public void markedContentEnd()
Description copied from interface: ICSDevice
End marked content sequence started with "BMC" or "BDC".

PDF graphics operator "EMC"

Specified by:
markedContentEnd in interface ICSDevice
Overrides:
markedContentEnd in class CSDeviceFilter

markedContentPoint

public void markedContentPoint(COSName tag)
Description copied from interface: ICSDevice
Set a marked point.

PDF graphics operator "MP"

Specified by:
markedContentPoint in interface ICSDevice
Overrides:
markedContentPoint in class CSDeviceFilter
Parameters:
tag - The tag indicating the role or significance.

markedContentPointProperties

public void markedContentPointProperties(COSName tag,
                                         COSName resourceName,
                                         COSDictionary properties)
Description copied from interface: ICSDevice
Define a marked content point with a property list.

PDF graphics operator "DP"

Specified by:
markedContentPointProperties in interface ICSDevice
Overrides:
markedContentPointProperties in class CSDeviceFilter
Parameters:
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.

textBegin

public void textBegin()
Description copied from interface: ICSDevice
Begin text mode. User space and text space are initialized to be equal.

PDF graphics operator "BT"

Specified by:
textBegin in interface ICSDevice
Overrides:
textBegin in class CSDeviceFilter

textEnd

public void textEnd()
Description copied from interface: ICSDevice
End text mode. User space is reestablished.

PDF graphics operator "ET"

Specified by:
textEnd in interface ICSDevice
Overrides:
textEnd in class CSDeviceFilter

textLineMove

public void textLineMove(float dx,
                         float dy)
Description copied from interface: ICSDevice
Move the current text line by dx, dy.

PDF graphics operator "Td"

Specified by:
textLineMove in interface ICSDevice
Overrides:
textLineMove in class CSDeviceFilter
Parameters:
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.

textLineNew

public void textLineNew()
Description copied from interface: ICSDevice
Move the current position to a new line. y.

PDF graphics operator "T*"

Specified by:
textLineNew in interface ICSDevice
Overrides:
textLineNew in class CSDeviceFilter

textMove

public void textMove(float dx,
                     float dy)
Description copied from interface: ICSDevice
Move the current text cursor represented by the current text state transform by dx, dy.

There is no graphics operator for this. It is implemented as a tool for the ease of creating a content stream.

Specified by:
textMove in interface ICSDevice
Overrides:
textMove in class CSDeviceFilter
Parameters:
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.

textMoveTo

public void textMoveTo(float x,
                       float y)
Description copied from interface: ICSDevice
Move the current text cursor represented by the current text state transform to x, y.

There is no graphics operator for this. It is implemented as a tool for the ease of creating a content stream.

Specified by:
textMoveTo in interface ICSDevice
Overrides:
textMoveTo in class CSDeviceFilter
Parameters:
x - The x coordinate for the next glyph starting point .
y - The y coordinate for the next glyph starting point .

textSetCharSpacing

public void textSetCharSpacing(float charSpacing)
Description copied from interface: ICSDevice
Set the character spacing.

PDF graphics operator "Tc"

Specified by:
textSetCharSpacing in interface ICSDevice
Overrides:
textSetCharSpacing in class CSDeviceFilter
Parameters:
charSpacing - The character spacing

textSetFont

public void textSetFont(COSName resourceName,
                        PDFont font,
                        float size)
Description copied from interface: ICSDevice
Set the current font and size.

PDF graphics operator "Tf"

Specified by:
textSetFont in interface ICSDevice
Overrides:
textSetFont in class CSDeviceFilter
Parameters:
resourceName - The logical name of the resource in the PDResources
font - The new PDFont
size - The new font size (scaling)

textSetHorizontalScaling

public void textSetHorizontalScaling(float scale)
Description copied from interface: ICSDevice
Set the horizontal scling factor.

PDF graphics operator "Tz"

Specified by:
textSetHorizontalScaling in interface ICSDevice
Overrides:
textSetHorizontalScaling in class CSDeviceFilter
Parameters:
scale - The new horizontal scaling factor.

textSetLeading

public void textSetLeading(float leading)
Description copied from interface: ICSDevice
Set the text leading.

PDF graphics operator "TL"

Specified by:
textSetLeading in interface ICSDevice
Overrides:
textSetLeading in class CSDeviceFilter
Parameters:
leading - The new leading

textSetRenderingMode

public void textSetRenderingMode(int renderingMode)
Description copied from interface: ICSDevice
Set the text rendering mode.

PDF graphics operator "Tr"

Specified by:
textSetRenderingMode in interface ICSDevice
Overrides:
textSetRenderingMode in class CSDeviceFilter
Parameters:
renderingMode - The new rendering mode.

textSetRise

public void textSetRise(float rise)
Description copied from interface: ICSDevice
Set the text rise.

PDF graphics operator "Ts"

Specified by:
textSetRise in interface ICSDevice
Overrides:
textSetRise in class CSDeviceFilter
Parameters:
rise - The new text rise (super/subscript) amount

textSetTransform

public void textSetTransform(float a,
                             float b,
                             float c,
                             float d,
                             float e,
                             float f)
Description copied from interface: ICSDevice
Set the text transformation matrix. Both the text matrix and the text line matrix are set to the new values.

PDF graphics operator "Tm"

Specified by:
textSetTransform in interface ICSDevice
Overrides:
textSetTransform in class CSDeviceFilter
Parameters:
a - operand 1,1 in the matrix
b - operand 1,2 in the matrix
c - operand 2,1 in the matrix
d - operand 2,2 in the matrix
e - operand 3,1 in the matrix
f - operand 3,2 in the matrix

textSetWordSpacing

public void textSetWordSpacing(float wordSpacing)
Description copied from interface: ICSDevice
Set the word spacing.

PDF graphics operator "Tw"

Specified by:
textSetWordSpacing in interface ICSDevice
Overrides:
textSetWordSpacing in class CSDeviceFilter
Parameters:
wordSpacing - The new word spacing.

textShow

public void textShow(byte[] text,
                     int offset,
                     int length)
Description copied from interface: ICSDevice
Show a sequence of bytes as text. The bytes are assumed to be encoded and copied directly to the device.

PDF graphics operator "Tj"

Specified by:
textShow in interface ICSDevice
Overrides:
textShow in class CSDeviceFilter
Parameters:
text - The bytes to be shown.

textShow

public void textShow(char[] chars,
                     int offset,
                     int length)
Description copied from interface: ICSDevice
Show a sequence of characters as text, using the current font encoding.

This is an optional operation from the viewpoint of an ICSInterpreter. It is called only "manually" in content creation devices. This method may throw an UnsupportedOperationException.

PDF graphics operator "Tj"

Specified by:
textShow in interface ICSDevice
Overrides:
textShow in class CSDeviceFilter
Parameters:
chars - The chars to be shown.

textShow

public void textShow(String text)
Description copied from interface: ICSDevice
Show a string value as text, using the current font encoding.

This is an optional operation from the viewpoint of an ICSInterpreter. It is called only "manually" in content creation devices. This method may throw an UnsupportedOperationException.

PDF graphics operator "Tj"

Specified by:
textShow in interface ICSDevice
Overrides:
textShow in class CSDeviceFilter
Parameters:
text - The text value to be shown using the current fonts encoding.

textT3SetGlyphWidth

public void textT3SetGlyphWidth(float x,
                                float y)
Description copied from interface: ICSDevice
Set the glyph width for a type 3 font.

PDF graphics operator "d0"

Specified by:
textT3SetGlyphWidth in interface ICSDevice
Overrides:
textT3SetGlyphWidth in class CSDeviceFilter
Parameters:
x - The glyph width
y - must be 0

textT3SetGlyphWidthBB

public void textT3SetGlyphWidthBB(float x,
                                  float y,
                                  float llx,
                                  float lly,
                                  float urx,
                                  float ury)
Description copied from interface: ICSDevice
Set the glyph width and bounding box for a type 3 font.

PDF graphics operator "d1"

Specified by:
textT3SetGlyphWidthBB in interface ICSDevice
Overrides:
textT3SetGlyphWidthBB in class CSDeviceFilter
Parameters:
x - The glyph width.
y - must be 0
llx - lower left x of bounding box
lly - lower left y of bounding box
urx - upper right x of bounding box
ury - upper right y of bounding box

jPod PDF library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.