Free Support Forum -

Aspose PDF : How to determine page dimensions of the HTML converted from PDF?

How does one get the page dimensions in the output html generated from a PDF source ?
I tried looking for a property in HtmlSaveOptions but couldnot find anything that helps…
Also, does HtmlLoadOptions help here ? From what I understand they are to be set while converting html to pdf and not the use-case mentioned here.

We are using version 19.12 of aspose-pdf.

Code block used for conversion :

public void convertPdfToHtml(String pdfFile, String outputDir) {

     Document doc = new Document(pdfFile);
    // Instantiate HtmlSaveOptions instance
    HtmlSaveOptions html = new HtmlSaveOptions();

    // Specify the folder to save images during conversion process

    // Save the resultant HTML file + "/" + ".html", html);


The resultant HTML files do not have any property which determine the page dimensions of the output html.
Is there a way to get the page dimensions of the html page?


There is no way to get the page dimensions of the HTML document using Aspose.PDF. However, could you please share what you actually mean by dimensions of HTML document? Are you talking about some property defined in the CSS? Please share a sample PDF file along with the expected HTML output so that we can further test the scenario in our environment and share our feedback with you accordingly.