Пример #1
0
 /// <summary>Creates a title layer without registering it in PdfOCProperties.</summary>
 /// <param name="title">the title of the layer</param>
 /// <param name="document">the document this title layer belongs to</param>
 /// <returns>the created layer</returns>
 protected internal static iText.Kernel.Pdf.Layer.PdfLayer CreateTitleSilent(String title, PdfDocument document
     ) {
     if (title == null) {
         throw new ArgumentException("Invalid title argument");
     }
     iText.Kernel.Pdf.Layer.PdfLayer layer = new iText.Kernel.Pdf.Layer.PdfLayer(document);
     layer.title = title;
     return layer;
 }
Пример #2
0
 /// <summary>Adds a child layer.</summary>
 /// <remarks>Adds a child layer. Nested layers can only have one parent.</remarks>
 /// <param name="childLayer">the child layer</param>
 public virtual void AddChild(iText.Kernel.Pdf.Layer.PdfLayer childLayer) {
     if (childLayer.parent != null) {
         throw new ArgumentException("Illegal argument: childLayer");
     }
     childLayer.parent = this;
     if (children == null) {
         children = new List<iText.Kernel.Pdf.Layer.PdfLayer>();
     }
     children.Add(childLayer);
 }
Пример #3
0
 /// <summary>Creates a title layer.</summary>
 /// <remarks>
 /// Creates a title layer. A title layer is not really a layer but a collection of layers
 /// under the same title heading.
 /// </remarks>
 /// <param name="title">the title text</param>
 /// <param name="document">the <CODE>PdfDocument</CODE></param>
 /// <returns>the title layer</returns>
 public static iText.Kernel.Pdf.Layer.PdfLayer CreateTitle(String title, PdfDocument document)
 {
     iText.Kernel.Pdf.Layer.PdfLayer layer = CreateTitleSilent(title, document);
     document.GetCatalog().GetOCProperties(true).RegisterLayer(layer);
     return(layer);
 }