Hello,
I need to use Hyperlink to bookmark in my document. I use Aspose Word to create the document and Aspose PDF convert the document in PDF format. I have some problem with the Hyperlinks.
For example executing this test code the testout.doc seem to be correct but opening the testout.pdf file with Acrobat I have an error: “There was an error processing a page. There was a problem reading this document (110)”. (the soruce.doc document is an empty document).
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
public void Test()
{
Document wordDoc = null;
wordDoc = new Document((@"D:\source.doc");
DocumentBuilder docBuilder = new DocumentBuilder(wordDoc);
docBuilder.Writeln("--");
docBuilder.InsertHyperlink("link", "testbookmark" ,true);
docBuilder.Writeln("--");
docBuilder.StartBookmark("testbookmark");
docBuilder.Writeln("test bookmark");
docBuilder.EndBookmark("testbookmark");
wordDoc.Save(@"D:\testout.doc");
MemoryStream stream1 = new MemoryStream();
wordDoc.Save(stream1, SaveFormat.FormatAsposePdf);
stream1.Seek(0, SeekOrigin.Begin);
XmlDocument xmlDoc1 = new XmlDocument();
xmlDoc1.Load(stream1);
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.IsImagesInXmlDeleteNeeded = true;
pdf.BindXML(xmlDoc1, null);
pdf.Save(@"D:\testout.pdf");
}
I have posted this problem in the Aspose.Word Forum but now I think is a Aspose.Word problem.
I also check the contain of XML in the stream but seam to be correct:
link
--
test bookmark
Tanks,
Lorenzo