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

Free Support Forum - aspose.com

Convert HTML to PDF using Aspose.PDF for .NET - Alignment is not proper


When I try to convert HTML to PDF, the alignment is not proper in PDF document after conversion as in HTML file.

The header which is in center aligned in HTML, but after converted to PDF the header aligns to left.

I am using aspose.pdf 6.8.0 version


T Paramasivam

Hi Vimal,

Thanks for using our products.

Can you please share the source HTML file so that we can test the scenario at our end. We apologize for your inconvenience.

Thanks & Regards,

Hi, please find attached source (HTML) file.

Hi Vimal,

Thanks for sharing the template HTML file. I tested the scenario and able to notice the same problem. For rectification, I logged this problem with ID: PDFNEWNET-33497 in our Issue Tracking System. We will further look into the details of this issue and will keep you updated via this forum thread on the status of correction.

We apologize for your inconvenience.

Thanks & Regards,


Could you please inform when will you provide solution for below mentioned tickets?



Hi Vimal,

Thanks for using our products, as we just have able to discover PDFNEWNET-33497, so we require some time to investigate this issue in details. However, as soon as we have made some significant progress towards the resolution of this problem, we would be more than happy to update you with the status of correction. Please be patient and spare us little time.

We are really sorry for this inconvenience.

Thanks & Regards,

Hi Vimal,

Thank you for your patience.

I am very pleased to inform you that the issue is resolved by the development team and this issue will be a part of Aspose.Pdf for .NET v7.0 (to be released in May as per our monthly release plan) after following the complete testing and release cycle. Please be patient and we will notify you once the version is available for download.

We apologize for your inconvenience.

Thanks & Regards,

The issues you have found earlier (filed as PDFNEWNET-33497) have been fixed in Aspose.Pdf for .NET 9.2.0.

The blog post for this release is created over this link

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Vimal,

Thanks for your patience. You may use new DOM based approach to render HTML to PDF. It will fix your above layout problem.

Please use following code snippet, based on new Document Object Model (DOM)., with latest release of Aspose.Pdf for .NET. It will serve the purpose.

HtmlLoadOptions htmloptions = new HtmlLoadOptions();<o:p></o:p>

// use the new conversion engine<o:p></o:p>

htmloptions.UseNewConversionEngine = true;<o:p></o:p>

Document doc = new Document(myDir+“input.htm”, htmloptions);<o:p></o:p>


<o:p> </o:p>

<o:p>Please feel free to contact us for any further assistance.</o:p>


<o:p>Best Regards,</o:p>