Hi,
Im having an issue with converting hyperlinks from a Word docx to PDF.
It seems to be if the text begins with "http://" or "www.", it will be converted to a hyperlink in the PDF. If you have chosen to create a hyperlink in Word with custom text (eg. "Google" with a hyperlink to "http://www.google.com"), this is not being converted to a hyperlink in the PDF.
Here are the examples and results:
SUCCESS: http://www.google.com (plain text)
SUCCESS: www.google.com (plain text)
FAIL: maps.google.com (plain text)
FAIL: google.com (plain text)
SUCCESS: http://www.google.com (hyperlinked)
SUCCESS: www.google.com (hyperlinked)
FAIL: Google (hyperlinked)
FAIL: Google (hyperlinked)
I have tested this with http://asp.syncfusion.com/demos/reporting/Pdf/Import%20and%20Export/DoctoPDF/cs/DoctoPDF.aspx and get the same results.
Code im using is below, word document has been attached.
using (MemoryStream stream = new MemoryStream(wordDocBytes))
{
WordDocument wordDoc = null;
wordDoc = new WordDocument(stream, FormatType.Docx);
//Initialize chart to image converter for converting charts in word to pdf conversion
wordDoc.ChartToImageConverter = new ChartToImageConverter();
wordDoc.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Normal;
DocToPDFConverter converter = new DocToPDFConverter();
//Convert word document into PDF document
PdfDocument pdfDoc = converter.ConvertToPDF(wordDoc);
using (MemoryStream outputStream = new MemoryStream())
{
pdfDoc.Save(outputStream);
pdfBytes = outputStream.ToArray();
}
pdfDoc.Close(true);
wordDoc.Close();
}
Thanks
Anthony
Attachment:
Hyperlink_test_ee3992f4.7z