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

Free Support Forum - aspose.com

Issue converting Doc to Pdf

Using the following code

       string filename = @"C:\tmp_email\2019407.msg";
       var document2 = new Document(filename + ".docx");
       document2.Save(filename + ".2.Pdf", SaveFormat.Pdf);

On the following file:

I obtain a PDF with portion of the content cut-off.

This is the PDF:

The word doc was produced using Aspose Email and Aspose Words
attempting to convert an email to PDF

        string filename = @"C:\tmp_email\2019407.msg";
        MailMessage eml = MailMessage.Load(filename);
        MemoryStream memoryStream = new MemoryStream();
        eml.Save(memoryStream, SaveOptions.DefaultMhtml);
        string htmlFilename = @"C:\tmp_email\2019407.msg.html";
        eml.Save(htmlFilename, SaveOptions.DefaultMhtml);

        var document = new Document(memoryStream, new Aspose.Words.LoadOptions { LoadFormat = LoadFormat.Mhtml });
        document.Save(filename + ".docx");
        document.Save(filename + ".Pdf", SaveFormat.Pdf);

These are the original email and intermediate html


I am not sure it matters, as the intermediate docx is a valid docx which can be seen
as well formatted in Microsoft Word, and the problem appears to be in last step
the conversion to PDF

@russ.nichols

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-18801. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

I wanted to share another example, as this seems the same kind of bug:

Given Html File

and code:

        String filename = "/tmp/Problematic.html";
        var document = new Document(filename, new LoadOptions { LoadFormat = LoadFormat.Mhtml });
        document.Save(filename + ".docx");
        document.Save(filename + ".pdf", SaveFormat.Pdf);

The html -> doc conversion seems good,

but the doc -> PDF conversion seems to be lossy

as for example, the last few pages of the document are not in the PDF

This is the intermediate doc file

This is the final PDF file:

@russ.nichols

We have tested the scenario and noticed that the content position is changed and overlapped in output PDF. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-18816 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-18816) have been fixed in this Aspose.Words for .NET 19.12 update and this Aspose.Words for Java 19.12 update.