I am using PDFSharp to generate PDF from html source.
PdfGenerator.GeneratePdf(html, PageSize.A4);
Generate to pdf works well, but I dont know how I can change page orientation to landscape?
the following code could be usefull for you:
var config = new PdfGenerateConfig();
config.PageOrientation= PageOrientation.Landscape;
config.PageSize = PageSize.A4;
PdfDocument pdf = PdfGenerator.GeneratePdf(documentHtmlContent, config);
pdf.Save(FILE_OUT_PATH);
Process.Start(FILE_OUT_PATH);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With