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

Free Support Forum - aspose.com

ASPOSE Converting .docx to PDF documents(Pdf triggers alignment issues in middle of pages)

Hi,

With latest aspose version 17.8(Word and pdf), I have tried converting a word document(.Docx) to PDF format using ASPOSE.PDF and used temporary license.

using following code in converting documents.

    string File = "D:\\Test-Word.Docx";
        Aspose.Words.Document doc = new Aspose.Words.Document(File);
        System.IO.MemoryStream pdfOoutStream = new System.IO.MemoryStream();
        doc.Save(pdfOoutStream, Aspose.Words.SaveFormat.Pdf);

        Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(pdfOoutStream);
        byte[] docBytes = null;
        pdfOoutStream = new System.IO.MemoryStream();
        pdfDocument.Save(pdfOoutStream);
        docBytes = pdfOoutStream.ToArray();
        FileStream output = new FileStream("D:\\Test-PDF.pdf", FileMode.Create,
        FileAccess.Write);
        // Write byte array contents in the output file stream<a class="attachment" href="/uploads/discourse_instance3/6141">Pdf-Doc Issue.zip</a> (132.2 KB)

        output.Write(docBytes, 0, docBytes.Length);
        // Close output file
        output.Close();

I have compared the original word document and converted PDF document, we could see some alignment issue between the generated word document and pdf.
We are expecting both word and pdf should be equivelant but it is not.
I have attached the sample project with documents for your future reference.

Please provide us a solution asap.

Note: Please include the reference dll Aspose.Words.17.8.0 and Aspose.Pdf.17.2.0 for run the application.

Thanks in advance.

Pdf-Doc Issue.zip (132.2 KB)

The original poster of this issue and I are both part of the same company. We have verified the same behavior appears to be present when using earlier versions as well. We have a critical client commitment to meet that involves producing CMS-compliant documents so have an urgent need for guidance.

@smani

Thanks for your inquiry. We are working on your query and will update you shortly.

@smani

Thanks for your patience. We have converted your shared word document to PDF using Aspose.Words and MS Word, but I am afraid we are unable to notice alignment issue. We will appreciate if you please point the page number where you noticed the alignment issue. You may please share the screenshot, it will help us to investigate and address your issue exactly.

@tilal ahmad,

Thanks for quick response. As per your requested we attached the both word, pdf screen shots and marked as which place is issues occured. Please refer the my attached screen shot. My requirement is after converted pdf file same as word file. Please use my attached project and convert the docs. If you see issue or not.

Thanks in advance.
Wordfile_02.png (28.0 KB)
PdfFile_01.jpg (68.5 KB)
PdfFile_02.png (56.6 KB)
Wordfile_01.jpg (63.3 KB)
PdfFile_03.jpg (86.8 KB)
Wordfile_03.jpg (80.1 KB)

@tilal ahmad,

Get a chance please share the you tested sample code or project for helping in our further process.

Thanks.

@smani

Thanks for sharing the screenshots. We have noticed that some text from second page is moved to first page in resultant PDF document, that causes text position issue in subsequent pages. We have logged a ticket WORDSNET-15867 in our issue tracking system for further investigation and rectification. We will notify you as soon as it is resolved.

We are sorry for the inconvenience.