Class PDFDocument

java.lang.Object
de.erichseifert.vectorgraphics2d.SizedDocument
de.erichseifert.vectorgraphics2d.pdf.PDFDocument
All Implemented Interfaces:
Document

class PDFDocument extends SizedDocument
Represents a Document in the Portable Document Format (PDF).
  • Field Details

  • Constructor Details

  • Method Details

    • getCurrentState

      private GraphicsState getCurrentState()
    • initPage

      private Stream initPage()
      Initializes the document and returns a Stream representing the contents.
      Returns:
      Stream to which the contents are written.
    • setFont

      private void setFont(String fontId, float fontSize, Stream contents)
    • addObject

      private DefaultPDFObject addObject(Map<String,Object> dict, Payload payload)
    • addCatalog

      private DefaultPDFObject addCatalog()
    • addPageTree

      private PDFObject addPageTree(DefaultPDFObject catalog, List<PDFObject> pages)
    • addPage

      private DefaultPDFObject addPage(PDFObject pageTree)
    • addDictionary

      private DefaultPDFObject addDictionary(Map<String,Object> dict)
    • addObject

      private DefaultPDFObject addObject(Image image)
    • writeTo

      public void writeTo(OutputStream out) throws IOException
      Throws:
      IOException
    • getId

      private int getId(PDFObject object)
    • getVersion

      private int getVersion(PDFObject object)
      Returns the version of the specified object.
      Parameters:
      object - PDFObject whose version should be determined.
      Returns:
      Version number.
    • toBytes

      private byte[] toBytes(Resources resources)
    • toBytes

      private byte[] toBytes(Stream stream)
    • serialize

      protected static byte[] serialize(Stream stream)
    • serialize

      protected static byte[] serialize(TrueTypeFont font)
    • toBytes

      public byte[] toBytes(PDFObject object)
    • serialize

      private byte[] serialize(Object obj)
    • toBytes

      private byte[] toBytes(Command<?> command)
    • applyStateCommands

      private void applyStateCommands(List<Command<?>> commands)
    • getOutput

      private byte[] getOutput(Color color)
    • getOutput

      private byte[] getOutput(Shape s)
    • getOutput

      private byte[] getOutput(GraphicsState state, Resources resources, boolean first)
    • getOutput

      private byte[] getOutput(Stroke s)
    • getOutput

      private static byte[] getOutput(AffineTransform transform)
    • getOutput

      private static byte[] getOutput(String str, double x, double y)
    • getOutput

      private static byte[] getOutput(String str)
    • getOutput

      private static byte[] getOutput(PDFObject image, double x, double y, double width, double height, Resources resources)
    • close

      public void close()