Saving to PDF not converting all images

We have a large Microsoft Word document (24MB) that can be found at http://test.infosphere.com.au/files/Aspose/. Our product saves it as a PDF file using Aspose.Words, but is successfully converting less then half of the images.

If I create a stand alone program that does the conversion of this large file it works.

Thinking this is a memory issue I get our product loaded in the debugger, ready to step into the line of code that does the pdf conversion

Dim oWordDoc as New Aspose.Words.Document(vsDocPathAndName)
oWordDoc.Save(vsPdfPathAndName)

So the memory hit on my machine is similar (or higher) to the conditions where we are seeing failure of all images to convert.

Now I switch to my stand alone program and run that thinking perhaps I will get a similar result with not all images being converted.

This was not the case. Again the stand alone utility was 100% successful.

The inputs in both cases are identical, this large file. Yet the outputs differ.

As I understand the first line of code above

Dim oWordDoc as New Aspose.Words.Document(vsDocPathAndName)

creates the DOM structure of the document. It is this process that is possibly not representing all images found in the document into the DOM structure.

The second line of code

oWordDoc.Save(vsPdfPathAndName)

Builds the PDF file based on what is in its DOM structure. It is this process that is possibly not creating all the images it has in the DOM structure into the PDF document.

Under what conditions will Aspose.Words

  1. not create all images found in a source Word document into the DOM structure
  2. not create all images found in the DOM structure into the PDF document.

Any other ideas?

We are using the latest trial version as downloaded two weeks ago, with an unlimited license.

Thanks

Tim

Hi Tim,

Thanks for your inquiry. We are checking with your scenario and will get back to you soon.

Best regards,

Hi Tim,

Thank you for being patient.

I have tested your scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-8322. We will further look into the details of this problem and keep you updated on the status of correction. We apologize for your inconvenience.

Moreover, you can implement IWarningCallback interface if you want to have your own custom method called to capture loss of fidelity warnings that can occur during document loading or saving. For example, during loading a document you can capture warnings by using the following code snippet:

Aspose.Words.LoadOptions loadOptions = new Aspose.Words.LoadOptions();
loadOptions.LoadFormat = LoadFormat.Docx;
loadOptions.WarningCallback = new HandleDocumentWarnings();
Document doc = new Document(@"C:\Temp\Large.docx", loadOptions);
public class HandleDocumentWarnings : IWarningCallback
{
    public void Warning(WarningInfo info)
    {
        Console.WriteLine(info.WarningType + ": " + info.Description);
    }
}

Similarly, you can specify a WarningCallback event to PdfSaveOptions that is called during a save operation, when an issue is detected that might result in data or formatting fidelity loss.

Best regards,

@miteleda,

The source Word document is no longer available here (http://test.infosphere.com.au/files/Aspose/). Can you please fix the download link? Or ZIP and upload the Word document to Dropbox and share the download link here for further testing. Thanks for your cooperation.

@miteleda,

We are waiting for your input on this topic. Please ZIP and upload the Word document to Dropbox and share the download link here for further testing. Thanks for your cooperation.

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