Class PDFDocument
java.lang.Object
de.erichseifert.vectorgraphics2d.SizedDocument
de.erichseifert.vectorgraphics2d.pdf.PDFDocument
- All Implemented Interfaces:
Document
Represents a
Document in the Portable Document Format (PDF).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate final StreamCross-reference table ("xref").private static final Stringprivate static final Stringprivate static final Stringprivate static final doubleConstant to convert values from millimeters to PostScript®/PDF units (1/72th inch).private Resourcesprivate final Stack<GraphicsState> Mapping of stroke endcap values from Java to PDF.Mapping of line join values for path drawing from Java to PDF.private boolean -
Constructor Summary
ConstructorsConstructorDescriptionPDFDocument(CommandSequence commands, PageSize pageSize, boolean compressed) -
Method Summary
Modifier and TypeMethodDescriptionprivate DefaultPDFObjectprivate DefaultPDFObjectaddDictionary(Map<String, Object> dict) private DefaultPDFObjectprivate DefaultPDFObjectprivate DefaultPDFObjectprivate PDFObjectaddPageTree(DefaultPDFObject catalog, List<PDFObject> pages) private voidapplyStateCommands(List<Command<?>> commands) voidclose()private GraphicsStateprivate intprivate byte[]getOutput(GraphicsState state, Resources resources, boolean first) private static byte[]private byte[]private static byte[]getOutput(AffineTransform transform) private byte[]private byte[]private static byte[]private static byte[]private intgetVersion(PDFObject object) Returns the version of the specified object.private StreaminitPage()Initializes the document and returns aStreamrepresenting the contents.protected static byte[]protected static byte[]serialize(TrueTypeFont font) private byte[]private voidprivate byte[]byte[]private byte[]private byte[]voidwriteTo(OutputStream out) Methods inherited from class de.erichseifert.vectorgraphics2d.SizedDocument
getPageSize, isCompressed
-
Field Details
-
CHARSET
- See Also:
-
HEADER
- See Also:
-
FOOTER
- See Also:
-
EOL
- See Also:
-
MM_IN_UNITS
private static final double MM_IN_UNITSConstant to convert values from millimeters to PostScript®/PDF units (1/72th inch).- See Also:
-
STROKE_ENDCAPS
Mapping of stroke endcap values from Java to PDF. -
STROKE_LINEJOIN
Mapping of line join values for path drawing from Java to PDF. -
objects
-
crossReferences
Cross-reference table ("xref"). -
contents
-
resources
-
images
-
states
-
transformed
private boolean transformed
-
-
Constructor Details
-
PDFDocument
-
-
Method Details
-
getCurrentState
-
initPage
Initializes the document and returns aStreamrepresenting the contents.- Returns:
Streamto which the contents are written.
-
setFont
-
addObject
-
addCatalog
-
addPageTree
-
addPage
-
addDictionary
-
addObject
-
writeTo
- Throws:
IOException
-
getId
-
getVersion
Returns the version of the specified object.- Parameters:
object-PDFObjectwhose version should be determined.- Returns:
- Version number.
-
toBytes
-
toBytes
-
serialize
-
serialize
-
toBytes
-
serialize
-
toBytes
-
applyStateCommands
-
getOutput
-
getOutput
-
getOutput
-
getOutput
-
getOutput
-
getOutput
-
getOutput
-
getOutput
-
close
public void close()
-