I need to generate a pdf report from a URL in our application. Is it possible to have both Landscape and Portrait pages in the same pdf document that is generated?
I'd like to have the bar charts as Portrait, and the Tables as Landscape (horizontal). Looking at the EVO doc's I don't know if this is possible.
I know that you can define either Landscape or Portrait with
htmlToPdfConverter.PdfDocumentOptions.PdfPageOrientation
But this is applied to the whole document. I'd like something I could potentially define the html that would tell EVO to print this section as Landscape.
You can have Portrait and Landscape section in the same PDF. For this you can create a blank Document object and add a PDF page with the desired orientation to this document. On the newly created PDF page you can add a HtmlToPdfElement object to render the HTML and automatically add PDF pages with the same orientation with the PDF page you initially created. The procedure can be repeated with PDF pages of different orientations. There is a live sample with C# code for this approach in Merge Multiple HTML Pages into a Single PDF demo. The code sample is also copied below: