本文整理汇总了C#中iTextSharp.text.Document.SetMarginMirroring方法的典型用法代码示例。如果您正苦于以下问题:C# Document.SetMarginMirroring方法的具体用法?C# Document.SetMarginMirroring怎么用?C# Document.SetMarginMirroring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.Document
的用法示例。
在下文中一共展示了Document.SetMarginMirroring方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
// ===========================================================================
public void Write(Stream stream)
{
// step 1
using (Document document = new Document())
{
// step 2
PdfWriter.GetInstance(document, stream);
document.SetPageSize(PageSize.A5);
document.SetMargins(36, 72, 108, 180);
document.SetMarginMirroring(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 right margin of this even page is 36pt (0.5 inch); " +
"the left margin 72pt (1 inch).")
);
}
}
示例2: CreatePdf
public static void CreatePdf(string fileName)
{
Document document = new Document();
FileStream stream = new FileStream(fileName, FileMode.OpenOrCreate);
PdfWriter.GetInstance(document, stream);
document.SetPageSize(PageSize.A5);
document.SetMargins(36, 72, 108, 180);
document.SetMarginMirroring(true);
document.Open();
document.Add(new Paragraph("Hello World"));
document.Close();
}