本文整理匯總了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();
}