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


C# PdfDictionary.ToPdf方法代碼示例

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


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

示例1: WriteTo

 internal void WriteTo() {
     PdfDictionary dic = new PdfDictionary();
     dic.Put(PdfName.FIELDS, Calculate(fdf.fields));
     if (fdf.file != null)
         dic.Put(PdfName.F, new PdfString(fdf.file, PdfObject.TEXT_UNICODE));
     PdfDictionary fd = new PdfDictionary();
     fd.Put(PdfName.FDF, dic);
     PdfIndirectReference refi = AddToBody(fd).IndirectReference;
     byte[] b = GetISOBytes("trailer\n");
     os.Write(b, 0, b.Length);
     PdfDictionary trailer = new PdfDictionary();
     trailer.Put(PdfName.ROOT, refi);
     trailer.ToPdf(null, os);
     b = GetISOBytes("\n%%EOF\n");
     os.Write(b, 0, b.Length);
     os.Close();
 }
開發者ID:,項目名稱:,代碼行數:17,代碼來源:

示例2: BeginMarkedContentSequence

 /**
 * Begins a marked content sequence. If property is <CODE>null</CODE> the mark will be of the type
 * <CODE>BMC</CODE> otherwise it will be <CODE>BDC</CODE>.
 * @param tag the tag
 * @param property the property
 * @param inline <CODE>true</CODE> to include the property in the content or <CODE>false</CODE>
 * to include the property in the resource dictionary with the possibility of reusing
 */
 public void BeginMarkedContentSequence(PdfName tag, PdfDictionary property, bool inline)
 {
     if (property == null) {
         content.Append(tag.GetBytes()).Append(" BMC").Append_i(separator);
         SetMcDepth(GetMcDepth() + 1);
         return;
     }
     content.Append(tag.GetBytes()).Append(' ');
     if (inline)
         property.ToPdf(writer, content);
     else {
         PdfObject[] objs;
         if (writer.PropertyExists(property))
             objs = writer.AddSimpleProperty(property, null);
         else
             objs = writer.AddSimpleProperty(property, writer.PdfIndirectReference);
         PdfName name = (PdfName)objs[0];
         PageResources prs = PageResources;
         name = prs.AddProperty(name, (PdfIndirectReference)objs[1]);
         content.Append(name.GetBytes());
     }
     content.Append(" BDC").Append_i(separator);
     SetMcDepth(GetMcDepth() + 1);
 }
開發者ID:HardcoreSoftware,項目名稱:iSecretary,代碼行數:32,代碼來源:PdfContentByte.cs

示例3: Write

            internal void Write() {
                foreach (PdfReaderInstance element in readerInstances.Values) {
                    currentPdfReaderInstance = element;
                    currentPdfReaderInstance.WriteAllPages();
                }

                PdfDictionary dic = new PdfDictionary();
                dic.Put(PdfName.FIELDS, Calculate(fdf.fields));
                if (fdf.file != null)
                    dic.Put(PdfName.F, new PdfString(fdf.file, PdfObject.TEXT_UNICODE));
                if (!string.IsNullOrEmpty(fdf.statusMessage))
                    dic.Put(PdfName.STATUS, new PdfString(fdf.statusMessage));
                PdfDictionary fd = new PdfDictionary();
                fd.Put(PdfName.FDF, dic);
                PdfIndirectReference refi = AddToBody(fd).IndirectReference;
                byte[] b = GetISOBytes("trailer\n");
                os.Write(b, 0, b.Length);
                PdfDictionary trailer = new PdfDictionary();
                trailer.Put(PdfName.ROOT, refi);
                trailer.ToPdf(null, os);
                b = GetISOBytes("\n%%EOF\n");
                os.Write(b, 0, b.Length);
                os.Close();
            }
開發者ID:joshaxey,項目名稱:Simple-PDFMerge,代碼行數:24,代碼來源:FdfWriter.cs


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