I have a list in a document, like:
- First
- Second
- Third
If I change the formatting of the bullets to an image, then back to normal bullets, I seem to get an extra bullet point with the image in it when I convert to PDF.
I’ve attached the input doc, and the output doc, xml and pdf.
The xml shows the line:
<Image File="C:\Documents and
Settings\DASVivash\Local
Settings\Temp\Aspose.Words.656c0f61-08da-4518-874c-e332c4d5d2a1.001.png" Type="png" FixWidth="11.25"
FixHeight="11.25" />
The code for the conversion is:
Document doc = new Document(@"C:\test_in.doc");
saveToPDF(doc, @"c:\test_out.pdf");
private void saveToPDF(Document doc, string outputFilename)
{
//Save the document in Aspose.Pdf.Xml format into a memory stream.
MemoryStream stream = new MemoryStream();
doc.Save(stream, SaveFormat.FormatAsposePdf);
//Seek to the beginning so it can be read by XmlDocument.
stream.Seek(0, SeekOrigin.Begin);
//Load the document into an XmlDocument
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(stream);
//Load the XML document into Aspose.Pdf
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
//Make sure the images that were saved by Aspose.Words into Windows temporary
//folder are automatically deleted by Aspose.Pdf when they are no longer needed.
pdf.IsImagesInXmlDeleteNeeded = false;
pdf.BindXML(xmlDoc, null);
//*** Aspose.Pdf font cache, see comments below.
pdf.IsTruetypeFontMapCached = false;
//Now produce the PDF file.
pdf.Save(outputFilename);
}