当前位置: 首页>>代码示例>>C#>>正文


C# PdfObject.IsString方法代码示例

本文整理汇总了C#中iTextSharp.text.pdf.PdfObject.IsString方法的典型用法代码示例。如果您正苦于以下问题:C# PdfObject.IsString方法的具体用法?C# PdfObject.IsString怎么用?C# PdfObject.IsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在iTextSharp.text.pdf.PdfObject的用法示例。


在下文中一共展示了PdfObject.IsString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SerObject

 private void SerObject(PdfObject obj, int level, ByteBuffer bb)
 {
     if (level <= 0)
         return;
     if (obj == null) {
         bb.Append("$Lnull");
         return;
     }
     obj = PdfReader.GetPdfObject(obj);
     if (obj.IsStream()) {
         bb.Append("$B");
         SerDic((PdfDictionary)obj, level - 1, bb);
         if (level > 0) {
             bb.Append(PdfEncryption.DigestComputeHash("MD5", PdfReader.GetStreamBytesRaw((PRStream)obj)));
         }
     }
     else if (obj.IsDictionary()) {
         SerDic((PdfDictionary)obj, level - 1, bb);
     }
     else if (obj.IsArray()) {
         SerArray((PdfArray)obj, level - 1, bb);
     }
     else if (obj.IsString()) {
         bb.Append("$S").Append(obj.ToString());
     }
     else if (obj.IsName()) {
         bb.Append("$N").Append(obj.ToString());
     }
     else
         bb.Append("$L").Append(obj.ToString());
 }
开发者ID:jomamorales,项目名称:createPDF,代码行数:31,代码来源:PdfSmartCopy.cs

示例2: MapGotoBookmark

 private static void MapGotoBookmark(Dictionary<String, Object> map, PdfObject dest, IntHashtable pages) 
 {
     if (dest.IsString())
         map["Named"] = dest.ToString();
     else if (dest.IsName())
         map["Named"] = PdfName.DecodeName(dest.ToString());
     else if (dest.IsArray()) 
         map["Page"] = MakeBookmarkParam((PdfArray)dest, pages); //changed by ujihara 2004-06-13
     map["Action"] = "GoTo";
 }
开发者ID:joshaxey,项目名称:Simple-PDFMerge,代码行数:10,代码来源:SimpleBookmark.cs

示例3: CompareObjects

        public static bool CompareObjects(PdfObject value1, PdfObject value2) {
            value2 = GetDirectObject(value2);
            if (value2 == null)
                return false;
            if (value1.Type != value2.Type)
                return false;

            if (value1.IsBoolean()){
                if (value1 == value2)
                    return true;
                if (value2 is PdfBoolean) {
                    return ((PdfBoolean)value1).BooleanValue == ((PdfBoolean)value2).BooleanValue;
                }
                return false;
            } else if (value1.IsName()) {
                return value1.Equals(value2);
            } else if (value1.IsNumber()){
                if (value1 == value2)
                    return true;
                if (value2 is PdfNumber) {
                    return ((PdfNumber)value1).DoubleValue == ((PdfNumber)value2).DoubleValue;
                }
                return false;
            } else if (value1.IsNull()){
                if (value1 == value2)
                    return true;
                if (value2 is PdfNull)
                    return true;
                return false;
            } else if (value1.IsString()){
                if (value1 == value2)
                    return true;
                if (value2 is PdfString) {
                    return ((value2 == null && value1.ToString() == null)
                        || value1.ToString() == value2.ToString());
                }
                return false;
            }
            if (value1.IsArray()) {
                PdfArray array1 = (PdfArray)value1;
                PdfArray array2 = (PdfArray)value2;
                if (array1.Size != array2.Size)
                    return false;
                for (int i = 0; i < array1.Size; ++i)
                    if (!CompareObjects(array1[i],array2[i]))
                        return false;
                return true;
            }
            if (value1.IsDictionary()) {
                PdfDictionary first = (PdfDictionary)value1;
                PdfDictionary second = (PdfDictionary)value2;
                if (first.Size != second.Size)
                    return false;
                foreach (PdfName name in first.hashMap.Keys) {
                    if (!CompareObjects(first.Get(name),second.Get(name)))
                        return false;
                }
                return true;
            }
            return false;
        }
开发者ID:,项目名称:,代码行数:61,代码来源:

示例4: SerObject

            private void SerObject(PdfObject obj, int level, ByteBuffer bb, Dictionary<RefKey, int> serialized)
            {
                if (level <= 0)
                    return;
                if (obj == null) {
                    bb.Append("$Lnull");
                    return;
                }

                PdfIndirectReference refe = null;
                ByteBuffer savedBb = null;

                if (obj.IsIndirect()) {
                    refe = (PdfIndirectReference)obj;
                    RefKey key = new RefKey(refe);
                    if (serialized.ContainsKey(key)) {
                        bb.Append(serialized[key]);
                        return;
                    }
                    else {
                        savedBb = bb;
                        bb = new ByteBuffer();
                    }
                }
                obj = PdfReader.GetPdfObject(obj);
                if (obj.IsStream()) {
                    bb.Append("$B");
                    SerDic((PdfDictionary)obj, level - 1, bb, serialized);
                    if (level > 0) {
                        bb.Append(DigestAlgorithms.Digest("MD5", PdfReader.GetStreamBytesRaw((PRStream)obj)));
                    }
                }
                else if (obj.IsDictionary()) {
                    SerDic((PdfDictionary)obj, level - 1, bb,serialized);
                }
                else if (obj.IsArray()) {
                    SerArray((PdfArray)obj, level - 1, bb,serialized);
                }
                else if (obj.IsString()) {
                    bb.Append("$S").Append(obj.ToString());
                }
                else if (obj.IsName()) {
                    bb.Append("$N").Append(obj.ToString());
                }
                else
                    bb.Append("$L").Append(obj.ToString());

                if (savedBb != null) {
                    RefKey key = new RefKey(refe);
                    if (!serialized.ContainsKey(key))
                        serialized[key] = CalculateHash(bb.Buffer);
                    savedBb.Append(bb);
                }
            }
开发者ID:jagruti23,项目名称:itextsharp,代码行数:54,代码来源:PdfSmartCopy.cs

示例5: SerObject

 private void SerObject(PdfObject obj, int level, ByteBuffer bb) {
     if (level <= 0)
         return;
     if (obj == null) {
         bb.Append("$Lnull");
         return;
     }
     if (obj.IsIndirect()) {
         if (serialized.Contains(obj))
             return;
         else
             serialized.Add(obj);
     }
     obj = PdfReader.GetPdfObject(obj);
     if (obj.IsStream()) {
         bb.Append("$B");
         SerDic((PdfDictionary)obj, level - 1, bb);
         if (level > 0) {
             bb.Append(DigestAlgorithms.Digest("MD5", PdfReader.GetStreamBytesRaw((PRStream)obj)));
         }
     }
     else if (obj.IsDictionary()) {
         SerDic((PdfDictionary)obj, level - 1, bb);
     }
     else if (obj.IsArray()) {
         SerArray((PdfArray)obj, level - 1, bb);
     }
     else if (obj.IsString()) {
         bb.Append("$S").Append(obj.ToString());
     }
     else if (obj.IsName()) {
         bb.Append("$N").Append(obj.ToString());
     }
     else
         bb.Append("$L").Append(obj.ToString());
 }
开发者ID:,项目名称:,代码行数:36,代码来源:


注:本文中的iTextSharp.text.pdf.PdfObject.IsString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。