|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.pdf.object.PDFObject
org.foray.pdf.object.PDFStream
org.foray.pdf.object.PDFXObject
public abstract class PDFXObject
PDF XObject (external object), aka a "named resource". Used to represent 1) bitmap images, 2) form XObjects (reusable sequences of other graphical objects, not to be confused with an interactive form), and 3) PostScript XObjects (whose use is unnecessary and deprecated). An XObject has not only a dictionary but a stream of image data.
Field Summary |
---|
Fields inherited from class org.foray.pdf.object.PDFObject |
---|
EOL, MSG_EOL, XREF_EOL |
Constructor Summary | |
---|---|
protected |
PDFXObject(PDFDocument doc,
org.axsl.graphic.Graphic graphic)
Create an Xobject instance. |
Method Summary | |
---|---|
protected void |
addStreamFilters()
Adds the normal stream filters used for graphics. |
protected void |
finalizeStreamContent()
This method is an explicit opportunity for subclasses to finish writing whatever content may still need to be written to the stream before the dictionary and stream contents are written. |
abstract org.axsl.graphic.Graphic |
getGraphic()
Return the encapsulated graphic. |
abstract float |
getHorizontalScaling(Rectangle2D.Float contentRectangle)
Returns the horizontal scaling factor that should be used for a specific "Do" for a specific content rectangle. |
abstract float |
getVerticalScaling(Rectangle2D.Float contentRectangle)
Returns the vertical scaling factor that should be used for a specific "Do" for a specific content rectangle. |
String |
getXObjectName()
Returns the XObject name for this object. |
static PDFXObject |
makeXObject(PDFDocument pdfDoc,
org.axsl.graphic.Graphic img,
org.axsl.font.FontConsumer fontConsumer,
boolean strokeText)
Factory method that encapsulates a Graphic instance into an appropriate PDFXObject instance. |
protected String |
specialStreamDictEntries()
Subclasses return any specialized dictionary entries here, so that they are included when writing the stream dictionary. |
protected abstract String |
specialXObjectDictEntries()
Subclasses return any specialized dictionary entries here, so that they are included when writing the stream dictionary. |
protected abstract void |
xObjectContent()
Add the content specific to this type of XObject to the content stream. |
protected abstract String |
xObjectSubtype()
Returns the subtype for this XObject. |
Methods inherited from class org.foray.pdf.object.PDFStream |
---|
add, addDefaultFilters, addEncryption, addFilter, addFilter, applyFilters, getDataLength, getOutputStream, output, outputStreamData, setData, setOutputStream, toPDF |
Methods inherited from class org.foray.pdf.object.PDFObject |
---|
bufferToByteArray, byteArrayToStream, getCharsPerLine, getGeneration, getLogger, getNumber, getPDFDocument, pdfID, pdfReference, setNumber, stringToByteArray |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected PDFXObject(PDFDocument doc, org.axsl.graphic.Graphic graphic) throws org.axsl.graphic.GraphicException
doc
- The parent PDF document.graphic
- The graphic to be encapsulated.
org.axsl.graphic.GraphicException
- For errors getting the appropriate filter.Method Detail |
---|
public static PDFXObject makeXObject(PDFDocument pdfDoc, org.axsl.graphic.Graphic img, org.axsl.font.FontConsumer fontConsumer, boolean strokeText) throws org.axsl.graphic.GraphicException
pdfDoc
- The parent PDF document.img
- The graphic to be encapsulated.fontConsumer
- The font consumer to use for resolving fonts in the
SVG.strokeText
- Set to true if text should be stroked, false if it
org.axsl.graphic.GraphicException
- For errors getting the appropriate filter.public String getXObjectName()
protected abstract String xObjectSubtype()
protected abstract void xObjectContent() throws org.axsl.pdf.PdfException
org.axsl.pdf.PdfException
- For errors in the graphic or when writing to the
stream.protected abstract String specialXObjectDictEntries()
protected void addStreamFilters()
public abstract org.axsl.graphic.Graphic getGraphic()
public abstract float getHorizontalScaling(Rectangle2D.Float contentRectangle)
contentRectangle
- The content rectangle into which the graphic
will be scaled.
public abstract float getVerticalScaling(Rectangle2D.Float contentRectangle)
getHorizontalScaling(java.awt.geom.Rectangle2D.Float)
for an
explanation of the need for this computation.
contentRectangle
- The content rectangle into which the graphic
will be scaled.
protected String specialStreamDictEntries() throws org.axsl.pdf.PdfException
PDFStream
specialStreamDictEntries
in class PDFStream
org.axsl.pdf.PdfException
- For errors creating the dictionary entries.protected void finalizeStreamContent()
PDFStream
finalizeStreamContent
in class PDFStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |