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


C# PdfLayer.Merge方法代碼示例

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


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

示例1: ReadOCProperties

 /**
 * Reads the OCProperties dictionary from the catalog of the existing document
 * and fills the documentOCG, documentOCGorder and OCGRadioGroup variables in PdfWriter.
 * Note that the original OCProperties of the existing document can contain more information.
 * @since    2.1.2
 */
 virtual protected void ReadOCProperties() {
     if (documentOCG.Count != 0) {
         return;
     }
     PdfDictionary dict = reader.Catalog.GetAsDict(PdfName.OCPROPERTIES);
     if (dict == null) {
         return;
     }
     PdfArray ocgs = dict.GetAsArray(PdfName.OCGS);
     PdfIndirectReference refi;
     PdfLayer layer;
     Dictionary<string,PdfLayer> ocgmap = new Dictionary<string,PdfLayer>();
     for (ListIterator<PdfObject> i = ocgs.GetListIterator(); i.HasNext();) {
         refi = (PdfIndirectReference)i.Next();
         layer = new PdfLayer(null);
         layer.Ref = refi;
         layer.OnPanel = false;
         layer.Merge((PdfDictionary)PdfReader.GetPdfObject(refi));
         ocgmap[refi.ToString()] = layer;
     }
     PdfDictionary d = dict.GetAsDict(PdfName.D);
     PdfArray off = d.GetAsArray(PdfName.OFF);
     if (off != null) {
         for (ListIterator<PdfObject> i = off.GetListIterator(); i.HasNext(); ) {
             refi = (PdfIndirectReference)i.Next();
             layer = ocgmap[refi.ToString()];
             layer.On = false;
         }
     }
     PdfArray order = d.GetAsArray(PdfName.ORDER);
     if (order != null) {
         AddOrder(null, order, ocgmap);
     }
     foreach (PdfLayer o in ocgmap.Values)
         documentOCG[o] = null;
     OCGRadioGroup = d.GetAsArray(PdfName.RBGROUPS);
     if (OCGRadioGroup == null)
         OCGRadioGroup = new PdfArray();
     OCGLocked = d.GetAsArray(PdfName.LOCKED);
     if (OCGLocked == null)
         OCGLocked = new PdfArray();
 }
開發者ID:yu0410aries,項目名稱:itextsharp,代碼行數:48,代碼來源:PdfStamperImp.cs


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