當前位置: 首頁>>代碼示例>>C#>>正文


C# PdfObject.ToPdf方法代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.PdfObject.ToPdf方法的典型用法代碼示例。如果您正苦於以下問題:C# PdfObject.ToPdf方法的具體用法?C# PdfObject.ToPdf怎麽用?C# PdfObject.ToPdf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.pdf.PdfObject的用法示例。


在下文中一共展示了PdfObject.ToPdf方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ToPdf

        /** 
         * Overriding standard PdfObject.ToPdf because we need sorted PdfDictionaries.
         */
        private static void ToPdf(PdfObject @object, PdfWriter writer, ByteBuffer os) {
            if (@object is PdfDictionary) {
                os.Append('<');
                os.Append('<');

                List<PdfName> keys = new List<PdfName>(((PdfDictionary) @object).Keys);
                keys.Sort();

                foreach (PdfName key in keys) {
                    ToPdf(key, writer, os);
                    PdfObject value = ((PdfDictionary) @object).Get(key);
                    int type = value.Type;

                    if (type != PdfObject.ARRAY && type != PdfObject.DICTIONARY && type != PdfObject.NAME &&
                            type != PdfObject.STRING) {
                        os.Append(' ');
                    }

                    ToPdf(value, writer, os);
                }

                os.Append('>');
                os.Append('>');
            } else {
                @object.ToPdf(writer, os);
            }
        }
開發者ID:Niladri24dutta,項目名稱:itextsharp,代碼行數:30,代碼來源:PdfCleanUpContentOperator.cs

示例2: AddToObjStm

 protected PdfWriter.PdfBody.PdfCrossReference AddToObjStm(PdfObject obj, int nObj) {
     if (numObj >= OBJSINSTREAM)
         FlushObjStm();
     if (index == null) {
         index = new ByteBuffer();
         streamObjects = new ByteBuffer();
         currentObjNum = IndirectReferenceNumber;
         numObj = 0;
     }
     int p = streamObjects.Size;
     int idx = numObj++;
     PdfEncryption enc = writer.crypto;
     writer.crypto = null;
     obj.ToPdf(writer, streamObjects);
     writer.crypto = enc;
     streamObjects.Append(' ');
     index.Append(nObj).Append(' ').Append(p).Append(' ');
     return new PdfWriter.PdfBody.PdfCrossReference(2, nObj, currentObjNum, idx);
 }
開發者ID:,項目名稱:,代碼行數:19,代碼來源:

示例3: PrintLn

 /// <summary>
 /// Writes a PDF object to the OutputStream, followed by a newline character. </summary>
 /// <param name="o"> </param>
 /// <exception cref="IOException"> </exception>
 protected internal virtual void PrintLn(PdfObject o) {
     o.ToPdf(null, baos);
     baos.WriteByte((byte) '\n');
 }
開發者ID:,項目名稱:,代碼行數:8,代碼來源:


注:本文中的iTextSharp.text.pdf.PdfObject.ToPdf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。