HTML to PDF mixed page sizes

Is there any way to have mixed page sizes/orientations when creating a PDF from HTML?


Our requirements demand that the first page be letter sized in portrait, and the subsequent pages be landscape mode (some with dynamic widths based on the content). For example, given the below html content we need:
  1. First page portrait letter
  2. Second page landscape letter
  3. Third page landscape letter height, with extra wide width
  4. Fourth page be portrait letter
In the current implementation we get a PDF where all pages are the same width and height (1100px by letter height). I am aware that setting page size can be done programmatically, however our challenge is that the page content is dynamic and a single section may span multiple pages, and may also be a dynamic width.

Sample Report
.page { page-break-after: always; }
.landscape { page: portraitPage }
.portrait { page: landscapePage }
@page portraitPage { size:portrait }
@page landscapePage { size:landscape }

Portrait cont

Landscape content

Extra wide content

Summary

Hi Greg,


Thanks for your inquriy. I am afraid currently API does not honor Page sizes in HTML to PDF conversion. We have logged an enhancement ticket PDFNET-41554 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.

Best Regards,