Pdf html file

I use PDFSharp to create a PDF file from an html source.

PdfGenerator.GeneratePdf(html, PageSize.A4);

Generating in pdf is good, but I don’t know how to change the page orientation in an album?

+4
source share
1 answer

The following code may be useful 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);
+7
source

Source: https://habr.com/ru/post/1568195/


All Articles