Home » Questions » Computers [ Ask a new question ]

Preventing ugly hyperlinks in Word-generated PDFs?

Preventing ugly hyperlinks in Word-generated PDFs?

I'm creating a document in Word 2007 on Windows XP, and using the "Save As PDF" add-in. The document contains hyperlinks.

Asked by: Guest | Views: 192
Total answers/comments: 2
Guest [Entry]

"Well, I thought I'd found a better way, but it turns out that Word 2007's ""Save as PDF"" add-in creates unusual links in PDFs. It leaves out the borderWidth property entirely. Acrobat assumes that borderWidth defaults to 0, so the links look fine. Preview.app defaults borderWidth to 1, so the links have a black box.

Unfortunately, Acrobat Pro 9 for Mac can't edit the link's properties through the GUI, probably because of the missing attribute. It can edit the exiting properties through JavaScript, but it won't let you set an attribute that's not already there.

As a quick hack, the following JavaScript will add a menu item to Acrobat called ""Make links invisible"" - place it in your ~/Library/Application Support/Adobe/Acrobat/9.0_x86/JavaScripts directory. It changes the borderColor to white. If you have closely-set type, that won't be any better than black; for my purposes, it worked well enough. It might actually be possible to get the attributes from the existing link, remove it, and create a new link with a proper borderWidth, but I didn't bother trying.

As it turns out, Word 2007 does SO many bad things to the PDF (embedding duplicate fonts, etc) that I ended up buying the Windows version of Acrobat Standard; it adds an Acrobat menu to the Ribbon, and its output looks great.

app.addMenuItem({
cName:""Make links invisible"",
cParent:""Tools"",
cExec:""makeLinksInvisible();""
});

function makeLinksInvisible() {
for ( var p = 0; p < this.numPages; p++)
{
var box = this.getPageBox(""Crop"", p);
var links = this.getLinks(p, box);

for each (l in links) {
l.borderColor = color.white;
}
}

}"
Guest [Entry]

"Man, that Word-generated PDF was ugly.

My idiot-simple solution: don't use Word-generated PDFs. Instead download PDFCreator (free&open source), ""print"" as PDF and use that instead. No ugly boxes, no strange fonts, just the document as it would be printed. Of course, hyperlinks are not preserved; if you're into that kind of stuff, I'd recommend LaTeX ;-)"