Problem creating pdf from word document with hyperlinks

Hi,

I am trying to convert an MS Word document to PDF and i have no problems doing this, until i have hyperlinks within the word document.

Can you please help me… i have attached the MS Word Document and xml file created…

Many Thanks Mark Wakelin

my code is …

Dim doc As New Aspose.Words.Document(sWordDocument)
Dim sNewWordToPDF As String = sWordDocument.Substring(0, Len(sWordDocument) - 3)
doc.Save(sNewWordToPDF & "xml", SaveFormat.AsposePdf)
'Read the document in Aspose.Pdf.Xml format into Aspose.Pdf.
Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf()
pdf.BindXML(sNewWordToPDF & "xml", Nothing)
pdf.IsImagesInXmlDeleteNeeded = True
'Produce the PDF file.
pdf.Save(sNewWordToPDF & "pdf")

Hi,

Thank you for considering Aspose.

I am able to reproduce this error. Exception seems to be generated from Aspose.Words while creating XML, I am moving this thread to Aspose.Words forum, they will definitely help you out.

Thanks.

Thanks

Mark

Hello!

I have reproduced the issue and logged as #4388 in our defect database. We’ll investigate it and notify you here in the thread when the problem is solved or some information is available.

As a workaround you can try reinserting hyperlinks in your document. Most probably this is induced by deviations from document format.

Regards,

Thanks,

Any idea on timescales, as the main reason we purchased aspose.words and aspose.pdf was for this hyperlink reason ?

Mark :slight_smile:

Any further feedback on an update fix for this problem please ??

I needed to have this working for Tuesday next week , so i am pretty desperate !!

Thanks in advance

Mark Wakelin

Hello Mark!

I’ll try to help you with this by Tuesday but it’s difficult to promise anything.

Thanks for understanding,

Hello!

After deeper investigation I figured out that one of the hyperlinks labeled as ‘Maintenance’ in the document has incomplete syntax:

HYPERLINK \"http://intranet.psu.co.uk/Home.aspx\" \\o

After “o” switch if it appears in the field code so named screen tip is expected. Deleting and re-creating this hyperlink from scratch could overcome the issue. Now it is fixed and corrected code will be available with the next hotfix. I’ll consult with my boss whether we can release sooner.

Regards,

Once again, thanks for your swift response. your support is very impressive !

Thanks for your efforts, the hotfix would be great.

I will also check the production of my word document with regard to the missing “/o” switch and correct.

Many Thanks

Mark

We have released a new version of Aspose.Words that contains a fix for your issue.

Issue #4388 - Exception: Cannot get field part because at end of field code (PDF, HTML)

The new version of Aspose.Words is available for download from here.

Best regards.