Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.PdfName


        PdfObject newValue;
        if (cs.isName())
            newValue = cs;
        else {
            newValue = value;
            PdfName first = value.getAsName(0);
            if (PdfName.INDEXED.equals(first)) {
                if (value.size() >= 2) {
                    PdfArray second = value.getAsArray(1);
                    if (second != null) {
                        value.set(1, simplifyColorspace(second));
View Full Code Here


   * Gets a PDF Name from an array or returns the object that was passed.
   */
    private PdfObject simplifyColorspace(final PdfArray obj) {
        if (obj == null)
            return obj;
        PdfName first = obj.getAsName(0);
        if (PdfName.CALGRAY.equals(first))
            return PdfName.DEVICEGRAY;
        else if (PdfName.CALRGB.equals(first))
            return PdfName.DEVICERGB;
        else
View Full Code Here

            ASN1InputStream din = new ASN1InputStream(new ByteArrayInputStream(bc));
            ASN1Primitive pkcs = din.readObject();
            bc = pkcs.getEncoded();
        }
        bt = hashBytesSha1(bc);
        return new PdfName(Utilities.convertToHex(bt));
    }
View Full Code Here

        PdfDictionary dict = ref.getAsDict(i);
        PdfDictionary params = dict.getAsDict(PdfName.TRANSFORMPARAMS);
        if (PdfName.DOCMDP.equals(dict.getAsName(PdfName.TRANSFORMMETHOD))) {
          certification = true;
        }
        PdfName action = params.getAsName(PdfName.ACTION);
        if (action != null) {
          fieldLocks.add(new FieldLock(action, params.getAsArray(PdfName.FIELDS)));
        }
        PdfNumber p = params.getAsNumber(PdfName.P);
        if (p == null)
View Full Code Here

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

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

        PdfDictionary dictionary = new PdfDictionary();
       
        for(PdfObject key = ps.readPRObject(); key != null && !"ID".equals(key.toString()); key = ps.readPRObject()){
            PdfObject value = ps.readPRObject();

            PdfName resolvedKey = inlineImageEntryAbbreviationMap.get(key);
            if (resolvedKey == null)
                resolvedKey = (PdfName)key;

            dictionary.put(resolvedKey, getAlternateValue(resolvedKey, value));
        }
View Full Code Here

     * @return if value is an allowed abbreviation for the key, the expanded value for that abbreviation.  Otherwise, value is returned without modification
     */
    private static PdfObject getAlternateValue(PdfName key, PdfObject value){
        if (key == PdfName.FILTER){
            if (value instanceof PdfName){
                PdfName altValue = inlineImageFilterAbbreviationMap.get(value);
                if (altValue != null)
                    return altValue;
            } else if (value instanceof PdfArray){
                PdfArray array = ((PdfArray)value);
                PdfArray altArray = new PdfArray();
                int count = array.size();
                for(int i = 0; i < count; i++){
                    altArray.add(getAlternateValue(key, array.getPdfObject(i)));
                }
                return altArray;
            }
        } else if (key == PdfName.COLORSPACE){
            PdfName altValue = inlineImageColorSpaceAbbreviationMap.get(value);
            if (altValue != null)
                return altValue;
        }
       
        return value;
View Full Code Here

        if (streamBytes == null)
            return null;
        if (!decoded) {
            // if the stream hasn't been decoded, check to see if it is a single stage JPG or JPX encoded stream.  If it is,
            // then we can just use stream as-is
            PdfName filter = dictionary.getAsName(PdfName.FILTER);
            if (filter == null){
                PdfArray filterArray = dictionary.getAsArray(PdfName.FILTER);
                if (filterArray.size() == 1){
                    filter = filterArray.getAsName(0);
                } else {
View Full Code Here

   *            the child dictionary to inspect
   */
  public void inspectChildDictionary(PdfDictionary k) throws IOException {
    if (k == null)
      return;
    PdfName s = k.getAsName(PdfName.S);
    if (s != null) {
            String tagN = PdfName.decodeName(s.toString());
      String tag = fixTagName(tagN);
      out.print("<");
      out.print(tag);
      out.print(">");
      PdfDictionary dict = k.getAsDict(PdfName.PG);
View Full Code Here

TOP

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

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.