org.foray.pdf.object
Class PDFXForm

java.lang.Object
  extended by org.foray.pdf.object.PDFObject
      extended by org.foray.pdf.object.PDFStream
          extended by org.foray.pdf.object.PDFXObject
              extended by org.foray.pdf.object.PDFXForm
Direct Known Subclasses:
PDFXFormEps, PdfXFormMath, PDFXFormSvg, PDFXReference

public abstract class PDFXForm
extends PDFXObject

Represents a "Form" XObject.


Field Summary
 
Fields inherited from class org.foray.pdf.object.PDFObject
EOL, MSG_EOL, XREF_EOL
 
Constructor Summary
PDFXForm(PDFDocument doc, org.axsl.graphic.Graphic graphic)
          Constructor.
 
Method Summary
protected abstract  org.axsl.ps.PsBoundingBox getBoundingBox()
          Returns the bounding box dimensions, in form space, for this graphic.
protected abstract  byte[] getPdfContent()
          Converts the graphic content to PDF content.
protected abstract  AffineTransform getUserSpaceTransform()
          Return the transformation that should be used to convert this form from form space to user space.
protected abstract  String specialXFormDict()
          Returns any special entries that should be added to the XForm dictionary.
protected  String specialXObjectDictEntries()
          Subclasses return any specialized dictionary entries here, so that they are included when writing the stream dictionary.
protected  void xObjectContent()
          Add the content specific to this type of XObject to the content stream.
protected  String xObjectSubtype()
          Returns the subtype for this XObject.
 
Methods inherited from class org.foray.pdf.object.PDFXObject
addStreamFilters, finalizeStreamContent, getGraphic, getHorizontalScaling, getVerticalScaling, getXObjectName, makeXObject, specialStreamDictEntries
 
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

PDFXForm

public PDFXForm(PDFDocument doc,
                org.axsl.graphic.Graphic graphic)
         throws org.axsl.graphic.GraphicException
Constructor.

Parameters:
doc - The parent PDF document.
graphic - The form to be encapsulated.
Throws:
org.axsl.graphic.GraphicException - For errors getting the appropriate filter.
Method Detail

xObjectSubtype

protected String xObjectSubtype()
Description copied from class: PDFXObject
Returns the subtype for this XObject.

Specified by:
xObjectSubtype in class PDFXObject
Returns:
The subtype for this XObject.

xObjectContent

protected void xObjectContent()
                       throws org.axsl.pdf.PdfException
Description copied from class: PDFXObject
Add the content specific to this type of XObject to the content stream.

Specified by:
xObjectContent in class PDFXObject
Throws:
org.axsl.pdf.PdfException - For errors in the graphic or when writing to the stream.

getPdfContent

protected abstract byte[] getPdfContent()
                                 throws org.axsl.graphic.GraphicException
Converts the graphic content to PDF content.

Returns:
The PDF content.
Throws:
org.axsl.graphic.GraphicException - For errors during conversion.

specialXObjectDictEntries

protected String specialXObjectDictEntries()
Description copied from class: PDFXObject
Subclasses return any specialized dictionary entries here, so that they are included when writing the stream dictionary.

Specified by:
specialXObjectDictEntries in class PDFXObject
Returns:
The dictonary entries specific to this type of XObject.

getBoundingBox

protected abstract org.axsl.ps.PsBoundingBox getBoundingBox()
Returns the bounding box dimensions, in form space, for this graphic.

Returns:
The bounding box for this graphic.

specialXFormDict

protected abstract String specialXFormDict()
Returns any special entries that should be added to the XForm dictionary.

Returns:
Special XForm dictionary entries.

getUserSpaceTransform

protected abstract AffineTransform getUserSpaceTransform()
Return the transformation that should be used to convert this form from form space to user space.

Returns:
The transformation to be used to convert this form to user space.


Copyright © 2017. All rights reserved.