Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfObject


   * @return  false if there are no objects left to check.
   */
  public boolean storeNextObject() {
    while (current < n) {
      current++;
      PdfObject object = reader.getPdfObjectRelease(current);
      if (object != null) {
        int idx = size();
        idxToRef.put(idx, current);
        refToIdx.put(current, idx);
        store(object);
View Full Code Here


   * Loads an object based on its reference number in the xref table.
   * @param ref  a reference number in the xref table.
   * @return  a PDF object
   */
  public PdfObject loadObjectByReference(int ref) {
    PdfObject object = getObjectByReference(ref);
    if (object instanceof PdfNull) {
      int idx = getIndexByRef(ref);
      object = reader.getPdfObject(ref);
      objects.set(idx, object);
    }
View Full Code Here

   * @return  a caption for the object corresponding with the key in the dictionary.
   */
  public static String getDictionaryEntryCaption(PdfDictionary dict, PdfName key) {
    StringBuffer buf = new StringBuffer(key.toString());
    buf.append(": ");
        PdfObject valObj = dict.get(key);
        if (valObj.isIndirect()) {
            buf.append( getCaption( valObj ) );
        } else {
            buf.append(dict.get(key).toString());
        }
        return buf.toString();
View Full Code Here

  public FormTreeNode(PdfObjectTreeNode node) {
    super("form.png");
    this.object_node = node;
    if (node.isDictionary()) {
      PdfDictionary dict = (PdfDictionary)node.getPdfObject();
      PdfObject fieldname = dict.get(PdfName.T);
      if (fieldname != null) {
        this.setUserObject(fieldname);
      }
      else {
        this.setUserObject("unnamed field");
View Full Code Here

        if (info != null) {
          DublinCoreSchema dc = new DublinCoreSchema();
          PdfSchema p = new PdfSchema();
          XmpBasicSchema basic = new XmpBasicSchema();
          PdfName key;
          PdfObject obj;
          for (PdfName pdfName : info.getKeys()) {
            key = pdfName;
            obj = info.get(key);
            if (obj == null)
              continue;
View Full Code Here

    static public String getDictionaryDetail(PdfDictionary dic, int depth){
        StringBuffer builder = new StringBuffer();
        builder.append('(');
        List<PdfName> subDictionaries = new ArrayList<PdfName>();
        for (PdfName key: dic.getKeys()) {
            PdfObject val = dic.getDirectObject(key);
            if (val.isDictionary())
                subDictionaries.add(key);
            builder.append(key);
            builder.append('=');
            builder.append(val);
            builder.append(", ");
View Full Code Here

      raster = Raster.createPackedRaster( db, width, height, 1, null );
      bi = new BufferedImage( width, height, BufferedImage.TYPE_BYTE_BINARY );
      bi.setData( raster );
      break;
    default:
      PdfObject colorspace = dictionary.getDirectObject(PdfName.COLORSPACE);
      if (PdfName.DEVICERGB.equals(colorspace)) {
        if (width * height == streamBytes.length) {
          bi = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED );
          raster = Raster.createPackedRaster(db, width, height, bpc, null);
          bi.setData(raster);
View Full Code Here

                dic.put(PdfName.GAMMA, new PdfNumber(gamma));
                dic.put(PdfName.WHITEPOINT, new PdfLiteral("[1 1 1]"));
                array.add(dic);
            }
            else {
                PdfObject wp = new PdfLiteral("[1 1 1]");
                array.add(PdfName.CALRGB);
                if (gamma != 1f) {
                    PdfArray gm = new PdfArray();
                    PdfNumber n = new PdfNumber(gamma);
                    gm.add(n);
View Full Code Here

    public static Image getInstance(final PRIndirectReference ref) throws BadElementException {
        PdfDictionary dic = (PdfDictionary)PdfReader.getPdfObjectRelease(ref);
        int width = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.WIDTH))).intValue();
        int height = ((PdfNumber)PdfReader.getPdfObjectRelease(dic.get(PdfName.HEIGHT))).intValue();
        Image imask = null;
        PdfObject obj = dic.get(PdfName.SMASK);
        if (obj != null && obj.isIndirect()) {
            imask = getInstance((PRIndirectReference)obj);
        }
        else {
            obj = dic.get(PdfName.MASK);
            if (obj != null && obj.isIndirect()) {
                PdfObject obj2 = PdfReader.getPdfObjectRelease(obj);
                if (obj2 instanceof PdfDictionary)
                    imask = getInstance((PRIndirectReference)obj);
            }
        }
        Image img = new ImgRaw(width, height, 1, 1, null);
View Full Code Here

        if (additional == null)
            return;
        PdfArray value = additional.getAsArray(PdfName.COLORSPACE);
        if (value == null)
            return;
        PdfObject cs = simplifyColorspace(value);
        PdfObject newValue;
        if (cs.isName())
            newValue = cs;
        else {
            newValue = value;
            PdfName first = value.getAsName(0);
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.PdfObject

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.