Package org.pdfclown.objects

Examples of org.pdfclown.objects.PdfInteger


      int width;
      try
      {width = glyphWidths.get(glyphIndex);if(width>1000){width=1000;}}
      catch(Exception e)
      {width = 0;}
      widthsObject.add(new PdfInteger(width));
    }
    cmapBuffer.append(
      "endcidchar\n"
        + "endcmap\n"
        + "CMapName currentdict /CMap defineresource pop\n"
        + "end\n"
        + "end\n"
        + "%%EndResource\n"
        + "%%EOF"
      );
    PdfStream cmapStream = new PdfStream(cmapBuffer);
    PdfDictionary cmapHead = cmapStream.getHeader();
    cmapHead.put(
      PdfName.Type,
      PdfName.CMap
      );
    cmapHead.put(
      PdfName.CMapName,
      new PdfName("Adobe-Identity-UCS")
      );
    cmapHead.put(
      PdfName.CIDSystemInfo,
      new PdfDictionary(
        new PdfName[]
        {
          PdfName.Registry,
          PdfName.Ordering,
          PdfName.Supplement
        },
        new PdfDirectObject[]
        {
          new PdfTextString("Adobe"),
          new PdfTextString("Identity"),
          new PdfInteger(0)
        }
        )
      ); // Generic predefined CMap (Identity-H/V (Adobe-Identity-0)) [PDF:1.6:5.6.4].
    font.put(
      PdfName.Encoding,
      getFile().register(cmapStream)
      );

    PdfStream gIdStream = new PdfStream(gIdBuffer);
    cidFont.put(
      PdfName.CIDToGIDMap,
      getFile().register(gIdStream)
      );

    cidFont.put(
      PdfName.W,
      new PdfArray(new PdfDirectObject[]{new PdfInteger(1),widthsObject})
      );

    toUnicodeBuffer.append(
      "endbfchar\n"
        + "endcmap\n"
View Full Code Here


      {flags |= FlagsEnum.Symbolic.getCode();}
      else
      {flags |= FlagsEnum.Nonsymbolic.getCode();}
      fontDescriptor.put(
        PdfName.Flags,
        new PdfInteger(flags)
        );
      // FontBBox.
      fontDescriptor.put(
        PdfName.FontBBox,
        new Rectangle(
          new Point2D.Double(metrics.xMin * metrics.unitNorm, metrics.yMin * metrics.unitNorm),
          new Point2D.Double(metrics.xMax * metrics.unitNorm, metrics.yMax * metrics.unitNorm)
          ).getBaseDataObject()
        );
      // ItalicAngle.
      fontDescriptor.put(
        PdfName.ItalicAngle,
        new PdfReal(metrics.italicAngle)
        );
      // Ascent.
      fontDescriptor.put(
        PdfName.Ascent,
        new PdfReal(
          metrics.ascender == 0
            ? metrics.sTypoAscender * metrics.unitNorm
            : metrics.ascender * metrics.unitNorm
          )
        );
      // Descent.
      fontDescriptor.put(
        PdfName.Descent,
        new PdfReal(
          metrics.descender == 0
            ? metrics.sTypoDescender * metrics.unitNorm
            : metrics.descender * metrics.unitNorm
          )
        );
      // Leading.
      fontDescriptor.put(
        PdfName.Leading,
        new PdfReal(metrics.sTypoLineGap * metrics.unitNorm)
        );
      // CapHeight.
      fontDescriptor.put(
        PdfName.CapHeight,
        new PdfReal(metrics.sCapHeight * metrics.unitNorm)
        );
      // StemV.
      /*
        NOTE: '100' is just a rule-of-thumb value, 'cause I've still to solve the
        'cvt' table puzzle (such a harsh headache!) for TrueType fonts...
        TODO:IMPL TrueType and CFF stemv real value to extract!!!
      */
      fontDescriptor.put(
        PdfName.StemV,
        new PdfInteger(100)
        );
      // FontFile.
  //TODO:IMPL distinguish between truetype (FontDescriptor.FontFile2) and opentype (FontDescriptor.FontFile3 and FontStream.subtype=OpenType)!!!
      PdfReference fontFileReference = getFile().register(
        new PdfStream(
View Full Code Here

    int index
    )
  {
    this(
      Arrays.asList(
        new PdfInteger(index)
        )
      );
  }
View Full Code Here

  @Override
  public RotationEnum getRotation(
    )
  {
    PdfInteger rotationObject = (PdfInteger)getInheritableAttribute(PdfName.Rotate);
    return (rotationObject == null
      ? RotationEnum.Downward
      : RotationEnum.get(rotationObject));
  }
View Full Code Here

        },
        new PdfDirectObject[]
        {
          PdfName.Pages,
          new PdfArray(),
          new PdfInteger(0)
        }
        )
      );
  }
View Full Code Here

    // Incrementing the pages counters...
    do
    {
      // Get the page collection counter!
      PdfDirectObject count = parentData.get(PdfName.Count);
      PdfInteger countData = (PdfInteger)File.resolve(count);
      // Increment the counter at the current level!
      countData.setValue(countData.getValue()+pages.size());
      updateParent |= !File.update(count); // Try to update the page counter.
      // Is the parent tree node to be updated?
      /*
        NOTE: It avoids to update the parent tree node if its modified fields are all
        indirect objects which perform independent updates.
View Full Code Here

  @PDF(VersionEnum.PDF13)
  public LineCapEnum getLineCap(
    )
  {
    PdfInteger lineCapObject = (PdfInteger)getBaseDataObject().get(PdfName.LC);
    return lineCapObject == null
      ? null
      : LineCapEnum.valueOf(lineCapObject.getRawValue());
  }
View Full Code Here

  @PDF(VersionEnum.PDF13)
  public LineJoinEnum getLineJoin(
    )
  {
    PdfInteger lineJoinObject = (PdfInteger)getBaseDataObject().get(PdfName.LJ);
    return lineJoinObject == null
      ? null
      : LineJoinEnum.valueOf(lineJoinObject.getRawValue());
  }
View Full Code Here

    )
  {
    /*
      NOTE: 'TP' entry may be undefined.
    */
    PdfInteger captionPositionObject = (PdfInteger)getBaseDataObject().get(PdfName.TP);
    if(captionPositionObject == null)
      return CaptionPositionEnum.CaptionOnly;

    return CaptionPositionEnum.get(captionPositionObject.getRawValue());
  }
View Full Code Here

    )
  {
    /*
      NOTE: 'R' entry may be undefined.
    */
    PdfInteger orientationObject = (PdfInteger)getBaseDataObject().get(PdfName.R);
    if(orientationObject == null)
      return OrientationEnum.Up;

    return OrientationEnum.get(orientationObject.getRawValue());
  }
View Full Code Here

TOP

Related Classes of org.pdfclown.objects.PdfInteger

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.