intarsys PDF library API

de.intarsys.pdf.content.common
Class CSBoundingBoxCollector

java.lang.Object
  extended by de.intarsys.pdf.content.CSDeviceAdapter
      extended by de.intarsys.pdf.content.CSShapeDevice
          extended by de.intarsys.pdf.content.common.CSBoundingBoxCollector
All Implemented Interfaces:
ICSDevice

public class CSBoundingBoxCollector
extends CSShapeDevice

Determine the bounding box of the content streams graphic primitives.

Usage
CSBoundingBoxCollector bbCollector = new CSBoundingBoxCollector(); CSDeviceBasedInterpreter interpreter = new CSDeviceBasedInterpreter(null, bbCollector); interpreter.process(content, getResources()); if (bbCollector.getBoundingBox() != null) { ... }

ATTENTION: The CSBoundingBoxCollector does not take care of text yet !!


Field Summary
 
Fields inherited from class de.intarsys.pdf.content.CSDeviceAdapter
MAX_STACK_SIZE
 
Constructor Summary
CSBoundingBoxCollector()
           
 
Method Summary
 Rectangle2D getBoundingBox()
          The bounding box containing all graphics artifacts stemming from operations in the content stream processed.
 void open(ICSInterpreter pInterpreter)
          Open the device for use by interpreter.
 void restoreState()
          Restore the graphics state from the stack.
 void saveState()
          Save the current graphics state on a stack for later use.
 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.CSShapeDevice
pathClipEvenOdd, pathClipNonZero, pathClose, pathCloseFillStrokeEvenOdd, pathCloseFillStrokeNonZero, pathCloseStroke, pathEnd, pathFillEvenOdd, pathFillNonZero, pathFillStrokeEvenOdd, pathFillStrokeNonZero, pathStroke, penCurveToC, penCurveToV, penCurveToY, penLineTo, penMoveTo, penRectangle
 
Methods inherited from class de.intarsys.pdf.content.CSDeviceAdapter
close, compatibilityBegin, compatibilityEnd, doShading, doXObject, getGraphicsState, getInterpreter, inlineImage, markedContentBegin, markedContentBeginProperties, markedContentEnd, markedContentPoint, markedContentPointProperties, setExtendedState, setFlatnessTolerance, setLineCap, setLineDash, setLineJoin, setLineWidth, setMiterLimit, setNonStrokeColorCMYK, setNonStrokeColorGray, setNonStrokeColorRGB, setNonStrokeColorSpace, setNonStrokeColorValues, setNonStrokeColorValues, setRenderingIntent, setStrokeColorCMYK, setStrokeColorGray, setStrokeColorRGB, setStrokeColorSpace, setStrokeColorValues, setStrokeColorValues, textBegin, textEnd, textLineMove, textLineNew, textMove, textMoveTo, textSetCharSpacing, textSetFont, textSetHorizontalScaling, textSetLeading, textSetRenderingMode, textSetRise, textSetTransform, textSetWordSpacing, textShow, textShow, textT3SetGlyphWidth, textT3SetGlyphWidthBB
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSBoundingBoxCollector

public CSBoundingBoxCollector()
Method Detail

getBoundingBox

public Rectangle2D getBoundingBox()
The bounding box containing all graphics artifacts stemming from operations in the content stream processed.

Returns:
The bounding box containing all graphics artifacts stemming from operations in the content stream processed.

open

public void open(ICSInterpreter pInterpreter)
Description copied from interface: ICSDevice
Open the device for use by interpreter.

Specified by:
open in interface ICSDevice
Overrides:
open in class CSDeviceAdapter

saveState

public void saveState()
Description copied from interface: ICSDevice
Save the current graphics state on a stack for later use.

PDF graphics operator "q"

Specified by:
saveState in interface ICSDevice
Overrides:
saveState in class CSDeviceAdapter

restoreState

public void restoreState()
Description copied from interface: ICSDevice
Restore the graphics state from the stack.

PDF graphics operator "Q"

Specified by:
restoreState in interface ICSDevice
Overrides:
restoreState in class CSDeviceAdapter

transform

public void transform(float a,
                      float b,
                      float c,
                      float d,
                      float e,
                      float f)
Description copied from interface: ICSDevice
Modify the current transformation matrix by concatenating the transformations.

PDF graphics operator "cm"

Specified by:
transform in interface ICSDevice
Overrides:
transform in class CSDeviceAdapter
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

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.