Different format between converting the same document to pdf and html

Hi support.
I have a problem where the conversion of the same docx to html and pdf have different formats.
the document has a table with text wrapping the format if changing this table to text wrapping none everything is fine.
Is there any way to work with text wrapping around?

Conversion to html:

conversion to pdf

@PTDLPPLRunTeam

Can you please specify which Aspose API are you using along with the sample code snippet? We will test the scenario in our environment and address it accordingly.

hello, thanks for the quick response below this message are print screens of the code both doc to html and doc to pdf.
Thank you for your help.

Doc to Html:

Doc to PDF:

@PTDLPPLRunTeam

It looks like you are using Aspose.Words. So, we have moved this inquiry to the respective category where you will be assisted accordingly.

@PTDLPPLRunTeam can you please attach your base document (doc, docx, etc.)?

Document:
TestDocument.docx (80.7 KB)

1 Like

@PTDLPPLRunTeam The HTML output is actually the expected result. If you save the document as HTML using the MS Word application, you will get the same output.
Additionally, making a direct comparison between a PDF document and the HTML obtained using the HtmlSaveOptions class will not be correct, as both outputs are quite different in format. PDF documents are fixed documents, and exporting to HTML using the mentioned class produces an output that is close to a flow document. If you want an HTML output that looks similar to the PDF, you should use the HtmlFixedSaveOptions class instead.

I’m attaching the result of use HtmlFixedSaveOptions class to export to HTML in case that you prefer that output:
output.zip (88.9 KB)

Hi Support.
I cannot use this class(HTMLFixedSaveOptions) because if it is necessary to add pages, the pagination does not work.
Is there any other possible solution?

@PTDLPPLRunTeam Unfortunately, there is no way to export header/footer per page while exporting document to flow HTML. Only primary header and footer are exported to flow HTML. Please see remarks to HtmlSaveOptions.ExportHeadersFootersMode property.

If you need “paginated” flow HTML, you can use Document.extractPages and save each page as a separate HTML. Then you can reconstruct the HTML into a single file.