We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Dynamic page orientation when converting Html to Pdf

We are converting Html to PDF, and html contains various sizes of content, most of the content that fits a4 portrait and some big tables that should be in Landscape mode.

Current code almost solves that, result is goes in portrait and when it comes to a very wide table it switches to landscape.
But the problem is that after the landscape content it does not switch back to Portrait mode.
No matter how small of the content is after landscape table it continues to be in landscape mode till the end.
I searched the forum, and found this ticket, but not sure if it is solved or not: PDFNET-41554

InputStream targetStream = new ByteArrayInputStream(renderedHtmlTemplate.getBytes(StandardCharsets.UTF_8));
	HtmlLoadOptions options = new HtmlLoadOptions();
	options.getPageInfo().setMargin(new MarginInfo(10, 10, 10, 10));

	IDocument document = new Document(targetStream, options);

htmlSourceWithCurrentResult.zip (125.3 KB)


We regret to share that PDFNET-41554 has not been yet resolved. Furthermore, we have also logged a related issue as PDFJAVA-39390 in our issue tracking system for your scenario. We will surely look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Thanks for the support.

Also a question, our company is currently evaluating, and the license purchase is in progress.
Could the fact that we will have purchased the license increase the Bug/Feature priority for you guys ?



Please note that every issue possesses equal importance from us and is resolved. However, resolution time of the issue depends upon many factors including current support model, issue complexity and number of issues and tasks logged prior to it. The issues under normal support model usually have low priority and are resolved on first come first serve basis.

Nevertheless, we have recorded your concerns and will surely consider them during issue investigation. We will certainly update you as soon as we have some news about ticket resolution. Please spare us some time.