Word Hyperlink problem in PDF

Hello,

I need to use Hyperlink to bookmark in my document. I use Aspose Word to create the document and Aspose PDF to convert the document into PDF format. I have some issues with the Hyperlinks.

For example, executing this test code, the testout.doc seems correct, but opening the testout.pdf file with Acrobat, I get 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).

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 it’s an Aspose.Word problem.

I also checked the content of XML in the stream, but it seems correct.

<Segment FontName="Times New Roman" Color="rgb 0 0 0" IsTrueTypeFontBold="true" FontSize="12" LinkType="Local" TargetID="testbookmark">link</Segment>
<Segment FontName="Times New Roman" Color="rgb 0 0 0" IsTrueTypeFontBold="true" FontSize="12">--</Segment>
<Text MarginBottom="3" IsSpaced="true" LineSpacing="1" ID="testbookmark">
<Segment FontName="Times New Roman" Color="rgb 0 0 0" IsTrueTypeFontBold="true" FontSize="12">test bookmark</Segment>

Thanks,
Lorenzo

Dear Lorenzo,

Thanks for considering Aspose.

Can you please send your doc file to me and let me test it?

Dear Lorenzo,
Thank you for considering Aspose products.
I have tested your documents and code, but I have not found any error. Please make sure you are using the latest version of Aspose.Pdf and Aspose.Word.

I have downloaded again the last fix but the problem still exists. I checked with Adobe Acrobat reader 5 and 6 but the testout.pdf document (attached in my mail) still has the same problem (Acrobat display error 110).

Can you help me?

Lorenzo

Dear Lorenzo,

Thank you for considering Aspose.

I have send the generated pdf to you via email. Can you please check if the latest hotfix is really used?