I recently learned several things about passing hyperlinks from a Crystal report to a PDF while working on a customer project. The goal of the project was for every line of the report (each invoice) to have a clickable hyperlink. Clicking that hyperlink would open the corresponding PDF image for that invoice.
The pdf files were all stored in a network folder accessed by a UNC path. The path to the invoice PDF was stored as a character field in the invoice table. Here is an example:
The report and the hyperlinks all worked fine in Crystal, but the customer wanted to deliver the report as a PDF. We found that once the report was converted to a PDF, the hyperlinks were no longer ‘clickable’.
The first thing I learned was that to get a report hyperlink to survive the transition into a PDF you have to use the Crystal Export function. Using a PDF print driver, like CutePDF or PDF Creator, will not allow the hyperlink to survive the transition. Even if you expose the entire hyperlink so that it is visible in the PDF, it won’t be automatically ‘clickable’.
The second thing I learned was that not all hyperlinks will survive even if you use the Crystal export process. They will survive if they are URL based hyperlinks or MailTo hyperlinks. But any file/path based hyperlinks, like my example above, will still not be clickable in the PDF. As above, even when you make the entire link visible in the PDF it would have to be copied and pasted to work. It won’t be automatically ‘clickable’ within the PDF.
This customer was also planning to use a third party product (Visual Cut by Millet Software) to generate the PDF files at a scheduled time. So I asked Ido Millet about the problem. He was aware of the limitation on file hyperlinks in PDF exports and had built a feature into Visual Cut to overcome it. Visual Cut had a batch file command called PDF_Auto_File_Link that would read through a PDF and convert file hyperlinks into ‘clickable’ links.
So, if you run into a challenge that involves PDF exports with hyperlinks, give me a call. I might just be able to help.