Converting performance

Hi,

when I convert an existing Word document to a pdf-file (using the
Aspose.Pdf.dll) it lasts about 7-8 seconds. In my opinion this lasts to
long. What can I do, so that it converts my Word document faster?

Here is the code, that I use to convert:

System.Xml.XmlDocument l\_Xml = new System.Xml.XmlDocument();
l_Xml.Load(l_WordFile);
Aspose.Pdf.Pdf l_ResultPdf = new Aspose.Pdf.Pdf();
l_ResultPdf.BindXML(l_Xml, null);
l_ResultPdf.Save( i\_PdfFile );

In the attachment you will find the Word document, that I want to convert.

My system:

AMD Athlon 64 3200+

1GB RAM

Thanks.

Hi,

Unfortunately, I cannot find anything attached here. Please re-attach the document.

Here is the attachment.

Hm, I’ve just tested it on P2.6 1Gb RAM machine and the conversion took about 1 sec, apparently much less than the value you’ve specified. Are you using the latest versions of the components?

Yes, I am using the actual Version from your website. Heres the complete code fragment in which I convert the doc to pdf:

Aspose.Word.Document l_Document = new Aspose.Word.Document(i_WordFile);
using (Stream l_Stream = new MemoryStream())
{
    l_Document.Save(l_Stream,
    Aspose.Word.SaveFormat.FormatAsposePdf);
    l_Stream.Seek(0, System.IO.SeekOrigin.Begin);
    System.Xml.XmlDocument l_Xml =
    new System.Xml.XmlDocument();
    l_Xml.Load(l_Stream);
    Aspose.Pdf.Pdf l_ResultPdf = new Aspose.Pdf.Pdf();
    l_ResultPdf.BindXML(l_Xml, null);
    //
    resultPdf.IsImagesInXmlDeleteNeeded = true;
    l_ResultPdf.Save(i_PdfFile);
}

Can you see in this fragment the problem?

Thank you for your answer.

Your code looks quite correct. I think it has something to do with Aspose.Pdf so Aspose.Pdf team should look at this thread. I’ll let them know.

Please refer to IsTruetypeFontMapCached and add two lines like the following:

pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = @"d:\test";

When you run the application for the first time, the font map file will be created and then it will run fast for the rest times.

Now it “runs”! Thanks for your great support!