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

Free Support Forum - aspose.com

Misformatting of PDF converted from .DOC file

We use ASPOSE Words to automatically convert word documents to PDF documents. One of our customers is complaining because the formatting of the PDF document produced by ASPOSE Words doesn’t match the formatting produced by Microsoft Word.

I attach a document which shows an example of the problem that I’ve tested with the latest version (15.11.0). In this document the top of the right hand table column starts lower than the left hand column. In another case we have seen rows that are at the bottom of the left hand column moved to the top of the right hand column. In both cases this is compared to Word as displayed on the screen and converted to PDF.

The code we use to do the conversion is:

public static byte[] ConvertToPDF(byte[] source)
{
Document document = new Document(new MemoryStream(source));

MemoryStream stream_out = new MemoryStream();
document.Save(stream_out, SaveFormat.Pdf);
stream_out.Flush();

return (stream_out.ToArray());
}

Hi Anthony,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-12854. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Can you give me an update on this, or tell me how I access the issue tracking system please.

Hi Anthony,

Thanks for your inquiry. There is no public access to our issue tracking system. So you cannot check the issue status there.

It is to inform you that issues are addressed and resolved based on first come first serve basis. Currently, your issue is pending for analysis and is in the queue. Once our product team completes the analysis of your issue, we will then be able to provide you an estimate.

Thanks for your patience.

Hi Anthony,

Thanks for your patience.

It is to update you that we have closed the issue (WORDSNET-12854) with ''Won't Fix'' resolution. We are quoting developer's comments here for your reference.

The issue occurs because of different column balancing in MS Word compatibility mode and Aspose.Words.

A simplified 12854s.xml is attached. There are two tables and a paragraph between them in a continuous two-column section. The difference between Aspose.Words and MS Word output is because of different column balancing. The paragraph between tables goes to the second column in Aspose.Words output but stays in the first column in MS Word layout.

MS Word's balancing is actually not perfect: the paragraph between tables is lower than the section break in the second column (the first column is taller that the second column). It is unlikely that we will be able to reproduce MS Word logic for this particular document.

Also, MS Word balancing changes if the document is re-saved without maintaining compatibility (12854s.2013.docx). In 2013 mode, balancing inside MS Word becomes similar to Aspose.Words output: the paragraph between tables goes to the second column. The behavior seems to depend on compatibility mode only: if the mode is manually changed from 15 to 14 in settings.xml, MS Word starts to behave as in the customer's document again (12854s.2013.compat14.docx).