Class PDFobj

java.lang.Object
net.atthegate.server.service.pdf.PDFobj

public class PDFobj extends Object
Used to create Java or .NET objects that represent the objects in PDF document. See the PDF specification for more information.
  • Field Details

    • number

      protected int number
    • offset

      protected int offset
    • dict

      protected List<String> dict
    • stream_offset

      protected int stream_offset
    • stream

      protected byte[] stream
    • data

      protected byte[] data
    • gsNumber

      protected int gsNumber
  • Constructor Details

    • PDFobj

      public PDFobj(int offset)
      Used to create Java or .NET objects that represent the objects in PDF document. See the PDF specification for more information. Also see Example_19.
      Parameters:
      offset - the object offset in the offsets table.
    • PDFobj

      protected PDFobj()
  • Method Details

    • getNumber

      public int getNumber()
    • getDict

      public List<String> getDict()
      Returns the object dictionary.
      Returns:
      the object dictionary.
    • setDict

      public void setDict(List<String> dict)
    • getData

      public byte[] getData()
      Returns the uncompressed stream data.
      Returns:
      the uncompressed stream data.
    • setStream

      protected void setStream(byte[] pdf, int length)
    • setStream

      protected void setStream(byte[] stream)
    • setNumber

      protected void setNumber(int number)
    • getValue

      public String getValue(String key)
      Returns the dictionary value for the specified key.
      Parameters:
      key - the specified key.
      Returns:
      the value.
    • getObjectNumbers

      protected List<Integer> getObjectNumbers(String key)
    • getPageSize

      public float[] getPageSize()
    • getLength

      protected int getLength(List<PDFobj> objects)
    • getLength

      protected int getLength(List<PDFobj> objects, int number)
    • getContentsObject

      public PDFobj getContentsObject(Map<Integer,PDFobj> objects)
    • getResourcesObject

      public PDFobj getResourcesObject(Map<Integer,PDFobj> objects)
    • addResource

      public Font addResource(CoreFont coreFont, Map<Integer,PDFobj> objects)
    • addResource

      public void addResource(Image image, Map<Integer,PDFobj> objects)
    • addResource

      public void addResource(Font font, Map<Integer,PDFobj> objects)
    • addContent

      public void addContent(byte[] content, Map<Integer,PDFobj> objects)
    • addPrefixContent

      public void addPrefixContent(byte[] content, Map<Integer,PDFobj> objects)
      Adds new content object before the existing content objects. The original code was provided by Stefan Ostermann author of ScribMaster and HandWrite Pro. Additional code to handle PDFs with indirect array of stream objects was written by EDragoev.
      Parameters:
      content -
      objects -
    • setGraphicsState

      public void setGraphicsState(GraphicsState gs, Map<Integer,PDFobj> objects)