iTextSharp.text.Document.SetMarginMirroringTopBottom C# (CSharp) Метод

SetMarginMirroringTopBottom() публичный Метод

public SetMarginMirroringTopBottom ( bool marginMirroringTopBottom ) : bool
marginMirroringTopBottom bool
Результат bool
        public virtual bool SetMarginMirroringTopBottom(bool marginMirroringTopBottom)
        {
            this.marginMirroringTopBottom = marginMirroringTopBottom;
            foreach (IDocListener listener in listeners) {
                listener.SetMarginMirroringTopBottom(marginMirroringTopBottom);
            }
            return true;
        }

Usage Example

Пример #1
0
// ===========================================================================
    public void Write(Stream stream) {
      // step 1
      // Specifying the page size
      using (Document document = new Document(PageSize.LETTER)) {
        // step 2
        PdfWriter.GetInstance(document, stream);
        // setting page size, margins and mirrered margins
        document.SetPageSize(PageSize.A5);
        document.SetMargins(36, 72, 108, 180);
        document.SetMarginMirroringTopBottom(true);        
        // step 3
        document.Open();
        // step 4
        document.Add(new Paragraph(
          "The left margin of this odd page is 36pt (0.5 inch); " +
          "the right margin 72pt (1 inch); " +
          "the top margin 108pt (1.5 inch); " +
          "the bottom margin 180pt (2.5 inch).")
        );
        Paragraph paragraph = new Paragraph();
        paragraph.Alignment = Element.ALIGN_JUSTIFIED;
        for (int i = 0; i < 20; i++) {
          paragraph.Add("Hello World! Hello People! " +
            "Hello Sky! Hello Sun! Hello Moon! Hello Stars!"
          );
        }
        document.Add(paragraph);
        document.Add(new Paragraph("The top margin 180pt (2.5 inch)."));
      }
    }
All Usage Examples Of iTextSharp.text.Document::SetMarginMirroringTopBottom