Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfDataObject


  // <private>
  private PdfDictionary ensureDictionary(
    )
  {
    PdfDataObject baseDataObject = getBaseDataObject();
    if(!(baseDataObject instanceof PdfDictionary))
    {
      /*
        NOTE: Single states are erased as they have no valid key
        to be consistently integrated within the dictionary.
View Full Code Here


  {
    if(baseObject == null)
      return null;

    // Get the data object corresponding to the color space!
    PdfDataObject baseDataObject = File.resolve(baseObject);
    /*
      NOTE: A color space is defined by an array object whose first element
      is a name object identifying the color space family [PDF:1.6:4.5.2].
      For families that do not require parameters, the color space CAN be
      specified simply by the family name itself instead of an array.
View Full Code Here

  {return (PdfDictionary)getCIDFontDictionary().resolve(PdfName.FontDescriptor);}

  protected void loadEncoding(
    )
  {
    PdfDataObject encodingObject = getBaseDataObject().resolve(PdfName.Encoding);

    // CMap [PDF:1.6:5.6.4].
    Map<ByteArray,Integer> cmap = CMap.get(encodingObject);

    // 1. Unicode.
    if(codes == null)
    {
      codes = new BiMap<ByteArray,Integer>();
      if(encodingObject instanceof PdfName
        && !(encodingObject.equals(PdfName.IdentityH)
          || encodingObject.equals(PdfName.IdentityV)))
      {
        /*
          NOTE: According to [PDF:1.6:5.9.1], the fallback method to retrieve
          the character-code-to-Unicode mapping implies getting the UCS2 CMap
          (Unicode value to CID) corresponding to the font's one (character code to CID);
View Full Code Here

  */
  public void flush(
    )
  {
    PdfStream stream;
    PdfDataObject baseDataObject = getBaseDataObject();
    // Are contents just a single stream object?
    if(baseDataObject instanceof PdfStream) // Single stream.
    {stream = (PdfStream)baseDataObject;}
    else // Array of streams.
    {
View Full Code Here

      to express their content streams as arrays of data streams.
    */
    PdfArray streams;
    {
      PdfDirectObject contentsObject = page.getBaseDataObject().get(PdfName.Contents);
      PdfDataObject contentsDataObject = File.resolve(contentsObject);
      // Single data stream?
      if(contentsDataObject instanceof PdfStream)
      {
        /*
          NOTE: Content stream MUST be expressed as an array of data streams in order to host
View Full Code Here

    boolean isRoot
    )
  {
    long dataSize = 0;
    {
      PdfDataObject dataObject = File.resolve(object);

      // 1. Evaluating the current object...
      if(object instanceof PdfReference)
      {
        PdfReference reference = (PdfReference)object;
View Full Code Here

    }

    // Body (contents).
    {
      IBuffer formBody = formStream.getBody();
      PdfDataObject contentsDataObject = getBaseDataObject().resolve(PdfName.Contents);
      if(contentsDataObject instanceof PdfStream)
      {formBody.append(((PdfStream)contentsDataObject).getBody());}
      else
      {
        for(PdfDirectObject contentStreamObject : (PdfArray)contentsDataObject)
View Full Code Here

      NOTE: A named destination may be either an array defining the destination,
      or a dictionary with a D entry whose value is such an array [PDF:1.6:8.2.1].
    */
    PdfDirectObject destinationObject;
    {
      PdfDataObject baseDataObject = File.resolve(baseObject);
      if(baseDataObject instanceof PdfDictionary)
      {destinationObject = ((PdfDictionary)baseDataObject).get(PdfName.D);}
      else
      {destinationObject = baseObject;}
    }
View Full Code Here

    )
  {
    if(baseObject == null)
      return null;

    PdfDataObject dataObject = File.resolve(baseObject);
    PdfDictionary dictionary = getDictionary(dataObject);
    int patternType = ((PdfInteger)dictionary.get(PdfName.PatternType)).getRawValue();
    switch(patternType)
    {
      case PatternType1:
View Full Code Here

        }
        glyphIndexes = unicodeGlyphIndexes;
      }
    }

    PdfDataObject encodingObject = getBaseDataObject().resolve(PdfName.Encoding);
    EnumSet<FlagsEnum> flags = getFlags();
    if(flags.contains(FlagsEnum.Symbolic)
      || (!flags.contains(FlagsEnum.Nonsymbolic) && encodingObject == null)) // Symbolic.
    {
      symbolic = true;
View Full Code Here

TOP

Related Classes of org.pdfclown.objects.PdfDataObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.