MigraDoc + PDFsharp生成水平PDF

时间:2015-12-17 11:06:52

标签: c# pdf horizontalscrollview pdfsharp migradoc

我正在使用MigraDoc + PDFsharp生成PDF(工资单)。生成的PDF默认为垂直。 (A4 - 垂直)。

我希望它生成为水平。 我需要做些什么改变?

currently I'm able to get this PDF

Sample image of expected output

1 个答案:

答案 0 :(得分:1)

我假设你想知道如何将页面格式设置为横向。

PageSetup pageSetup = document.DefaultPageSetup.Clone();
// set orientation
pageSetup.Orientation = Orientation.Landscape;
// ... set other page setting you want here...

将该PageSetup分配给您的部分。

另见: How to Set Document Orientation (for All Pages) in MigraDoc Library?