Losing images when saving as AsposePdf

Using: Aspose.Words (version 4.2.1.0)
Aspose.Pdf (version 3.3.5.0)
ASP.NET 1.1

Our application imports Word forms and then we convert them to PDF automatically. The source form is filled out by third parties who will use a variety of different versions of Word and different techniques for adding images, pictures, etc.

The attached files are representative of the problem we have.

If I use the following sample code to convert the appendix.doc file to PDF, all of the image files are saved as 1KB “red cross” PNG files, which are subsequently imported into the PDF as scaled up “red crosses”.

string path = txtFile.Value.Trim();
string pdfpath = path.Replace(".doc", ".pdf");
string xmlfile = path.Replace(".doc", ".xml");

try
{
    Aspose.Words.Document doc = new Aspose.Words.Document(path);
    doc.Save(xmlfile, SaveFormat.AsposePdf);

    Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
    pdf.BindXML(xmlfile, null);

    pdf.IsCoreFontUsed = true;

    // Commented out to demonstrate problem
    // pdf.IsImagesInXmlDeleteNeeded = true;

    pdf.IsTruetypeFontMapCached = true;
    pdf.TruetypeFontMapPath = Path.GetTempPath();
    pdf.Save(pdfpath);
}
catch (Exception ex)
{
    string debug = ex.Message;
}
finally
{
    File.Delete(xmlfile);
}

However, if you open the source file in Word and make any change (to either text or images) and then save the file from Word, the file increases in size and when you run it through the above code all of the images are saved correctly and the PDF is generated correctly.

I have tried using Aspose.Words to somehow automate this but without success.

Can you shed any light on why this is happening and whether there is anything we can do to change this behaviour.

Regards
David Jack

i’m having this same problem, is there a fix for this?

Sorry for delay. I have found that resaving the document in MS Word 2003 eliminates the problem. After that the images are correctly exported to PDF.

I have logged this problem as issue #1574. We will try to fix it as soon as possible.

Best regards,

Vladimir Averkin
Developer/Technical Support
Aspose Auckland team

These images are Macintosh PICT and we cannot export them meaningfully, therefore they come out as red crosses. I guess resaving in Word 2003 as Vladimir did automatically converts those images into PNG and then it works. We might support PICT images later, but sorry no timeframe right now.