Free Support Forum - aspose.com

HTML - Word - PDF conversion

Hi there,

Running under ASP (classic, not .NET), I have an HTML page (generated by ASP/VBScript code, attached with CSS file) which is then loaded into Aspose.Words document object (output into the attached Zip) and streamed back to the client as PDF file (also included in the attached ZIP).

The HTML file is properly formatted and rendered by a number of browsers (IE6,7,8/FF3.5), but the layout/format of resulting DOC is skewed a little and the PDF is even further skewed - table cells/rows have so much spacing that the PDF output is about twice in length compared to the DOC document.

Any suggestions to help me render a better PDF output would be very much appreciated.

DOC and PDF samples attached were produced with Aspose.Words 6.4 - I’ve downloaded version 7.0 which seems to have fixed most of the layout, except that now columns in Questionnaire table are rendered too narrow and the headings are wrapped before the last character in the word:
Correct Mandator Applican
Answe y t Answer
r

Regards,
Alex

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.

Best regards,

Thanks Andrey,

Please note that I’m only saving the DOC for debugging/investigation purposes - in production we’re only loading the HTML and producing the PDF (or so we hope).

Can you advise on any possible workarounds until you develop a fix for this issue?

Regards,
Alex

Hi Alex,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. As a workaround, you can try refactoring of your HTML. If you need, I can try to help you to change the HTML. Please let me know if such way is acceptable for you.

Best regards,

Andrey, I’m afraid I don’t have the luxury of refactoring the HTML, mainly because this is generated by common functions used throughout the application - if I had the choice of refactoring I would just generate the Word DOC on the fly using the DocumentBuilder object; but I was hoping I can reuse the existing HTML logic…

Thanks,
Alex

Hi Alex,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. Unfortunately, I cannot suggest you any other workarounds at the moment. I will let you know once your issue is resolved.

Best regards,