Http links are not always clickable

If I have a doc file with an http link in it, and if the link text is identical to the actual URL, then the link will work after converting the doc to PDF. But if the link text that is shown is not the same as the URL, then the final PDF will contain only highlighted text, but no link.

 

- some details plus some sample code.

- test was done on Windows 7 (32 bit) using PdfCreator 2.2.2.
load the attached code as an .rtf file and note that both links work. Then convert it to .pdf and note that only the first link works.

..............................

{\\rtf1\\ansi\\ansicpg1252\\uc1 \\deff0\\deflang1033\\deflangfe1033{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2{\\*\\panose 02020603050405020304}Times New Roman;}{\\f16\\froman\\fcharset238\\fprq2 Times New Roman CE;}{\\f17\\froman\\fcharset204\\fprq2 Times New Roman Cyr;}
{\\f19\\froman\\fcharset161\\fprq2 Times New Roman Greek;}{\\f20\\froman\\fcharset162\\fprq2 Times New Roman Tur;}{\\f21\\froman\\fcharset186\\fprq2 Times New Roman Baltic;}}{\\colortbl;\\red0\\green0\\blue0;\\red0\\green0\\blue255;\\red0\\green255\\blue255;
\\red0\\green255\\blue0;\\red255\\green0\\blue255;\\red255\\green0\\blue0;\\red255\\green255\\blue0;\\red255\\green255\\blue255;\\red0\\green0\\blue128;\\red0\\green128\\blue128;\\red0\\green128\\blue0;\\red128\\green0\\blue128;\\red128\\green0\\blue0;\\red128\\green128\\blue0;
\\red128\\green128\\blue128;\\red192\\green192\\blue192;}{\\stylesheet{\\widctlpar\\adjustright \\fs20\\cgrid \\snext0 Normal;}{\\*\\cs10 \\additive Default Paragraph Font;}{\\*\\cs15 \\additive \\ul\\cf2 \\sbasedon10 Hyperlink;}}{\\info
{\\title Link that works: http://launchpad}{\\author Alvin Penner}{\\operator Alvin Penner}{\\creatim\\yr2015\\mo12\\dy15\\hr11\\min46}{\\revtim\\yr2015\\mo12\\dy15\\hr11\\min46}{\\version2}{\\edmins1}{\ ofpages1}{\ ofwords22}{\ ofchars127}{\\*\\company  }{\ ofcharsws155}
{\\vern89}}\\widowctrl\\ftnbj\\aenddoc\\formshade\\viewkind1\\viewscale162\\viewzk2\\pgbrdrhead\\pgbrdrfoot \\fet0\\sectd \\linex0\\endnhere\\sectdefaultcl {\\*\\pnseclvl1\\pnucrm\\pnstart1\\pnindent720\\pnhang{\\pntxta .}}{\\*\\pnseclvl2\\pnucltr\\pnstart1\\pnindent720\\pnhang
{\\pntxta .}}{\\*\\pnseclvl3\\pndec\\pnstart1\\pnindent720\\pnhang{\\pntxta .}}{\\*\\pnseclvl4\\pnlcltr\\pnstart1\\pnindent720\\pnhang{\\pntxta )}}{\\*\\pnseclvl5\\pndec\\pnstart1\\pnindent720\\pnhang{\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl6\\pnlcltr\\pnstart1\\pnindent720\\pnhang
{\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl7\\pnlcrm\\pnstart1\\pnindent720\\pnhang{\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl8\\pnlcltr\\pnstart1\\pnindent720\\pnhang{\\pntxtb (}{\\pntxta )}}{\\*\\pnseclvl9\\pnlcrm\\pnstart1\\pnindent720\\pnhang{\\pntxtb (}{\\pntxta )}}\\pard\\plain
\\widctlpar\\adjustright \\fs20\\cgrid {\\lang4105 Link that works: }{\\field{\\*\\fldinst {\\lang4105  HYPERLINK http://launchpad.net }{\\lang4105 {\\*\\datafield
00d0c9ea79f9bace118c8200aa004ba90b02000000170000001500000068007400740070003a002f002f006c00610075006e00630068007000610064002e006e00650074000000e0c9ea79f9bace118c8200aa004ba90b4400000068007400740070003a002f002f006c00610075006e00630068007000610064002e006e00
650074002f000000795881f43b1d7f48af2c825dc485276300000000a5ab0000}}}{\\fldrslt {\\cs15\\ul\\cf2 http://launchpad.net}}}{\\lang4105
\\par
\\par Link that does not work : }{\\field\\fldedit{\\*\\fldinst {\\lang4105 HYPERLINK "http://launchpad.net/"}{\\lang4105 {\\*\\datafield
00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b4400000068007400740070003a002f002f006c00610075006e00630068007000610064002e006e00650074002f000000795881f43b1d7f48af2c825dc485276300000000a5ab0000}}}{\\fldrslt {\\cs15\\ul\\cf2
launchpad.net}}}{\\lang4105
\\par
\\par
\\par }}

Hi,


this is a known issue, PDFCreator can’t preserve hyperlinks, only full text links.
It can’t be “fixed” as it is due to the nature of PDFCreator being a virtual printer and the hyperlink information isn’t included in the print job.
There is a third party freeware (PDF-T-Maker) which allows to keep hyperlinks when printing from Word, which can be used in combination with PDFCreator. But this will only work for Word documents.

best regards,

 

That's good to know, a perennial question - many threads on this.

For printing webpages to pdf and preserving their hyperlinks, after seeing forum posts elsewhere I've used for some time wk html to pdf wkhtmltopdf.org

  • I found the "mingw-w64-cross" compiled version worked well on Windows 7 Professional and Home Premium editions, x64, and its use was facilitated further by running it via NirSoft's "Advanced Run" and selecting Run as ... Administrator (force UAC Elevation).

The thought occurs to try using this same application if you want to print to pdf from an application other than MS Word some item that contains hyperlinks - as someone else has observed, if it's eg Writer in Open Office or LibreOffice the export-as-pdf function likely retains the hyperlinks. If it's another application however you could try re-saving the relevant item as html and then feeding that to wkhtmltopdf.exe to make a pdf with hyperlinks preserved.

In the limited number of cases where wkhtmltopdf.exe fails with live webpages I've tried its embedded version in Chromium and if that fails (usually but not exclusively in the case of pages with css compacted menus which fail to display all at once even with bookmarklet "ToggleCSS" activated) then I'll display the page in Firefox v60+ and use the simplify page option if present and also where necessary run ToggleCSS and then run a further bookmarklet "full urls as link text" then print to pdf using PDFCreator. However if running bookmarklet "full urls as link text" makes the page look a mess e.g. with overlapping text then I'll undo/restart and omit that step and print again to pdf with PDFCreator but also run separate bookmarklet "List all Links" and print that to pdf as a separate page using PDFCreator, then combine it (just a list of urls) with the pdf of the substantive page. Bit messy but in extremis it preserves content and links even if you have to do some "interpretation" to match them up in complex pages.
For live webpages printing to pdf with hyperlinks retained, the only other solution I can think of offhand is to use one of the proprietary easy-print Add-ons or similar e.g.
printfriendly.com
however these seem to run the print command their own servers so potentially there's a privacy issue. For those concerned it's probably more prudent to run PDFCreator even if it means employing one of the above shims to preserve hyperlinks.

Bookmarklets at e.g.
squarefree.com/bookmarklets/
bookmarklets.com/

1 Like