Supercharge your PowerPoint Productivity with

Supercharge your PPT Productivity with PPTools

Click here to learn how

Automatic links with PDFMARK code

While you can manually create links in Acrobat/Exchange after you've made PDF, creating the same link on every page of a long document is tedious and bad for the old Carpal Tunnel Syndrome.

Worse, if the original document changes, you'll have to convert it to PDF again, so you'll have to re-create all the links ... manually ... again ... as well.

There's a kinder, gentler solution: PDFMark code in EPS files

PDFMark is PostScript code that, when processed by Distiller, can create links, annotations and all manner of other goodies in the resulting PDF.

The simplest way of getting PDFMark code into your PS so that Distiller can see it is to include it in EPS files that you place appropriately in your original document.

Before proceeding with the how-to, I have to admit that I didn't figure this out on my own.

Thomas Merz did. He published this and a great deal more useful information in his book Web Publishing with Acrobat/PDF (Springer, ISBN 3-540-63762-1). If you're doing more than occasional casual work with PDF, you need this book. For a sample, visit his site, where you can download a PDFMark Primer (in PDF format, naturally)

Now, on with the show ...

To create a link to the next page on every page in your document:

Copy the following text (you may need to remove extra blank lines):

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 72 72 
%%Creator: Your Name Here if you like
%%Title: NEXT PDFMark 
%%BeginProlog
/pdfmark where
	{pop} {userdict /pdfmark /cleartomark load put} ifelse
%%EndProlog

[ /Rect [ 0 0 72 72 ] 
/Border [ 0 0 0 ] 
/Page /Next 
/View [ /XYZ 1 796 0 ] 
/LNK 
pdfmark

Paste the text into an ascii text file (e.g. using Notepad in Windows) and save it as NEXT.EPS

Open your source document and place NEXT.EPS as though it were any normal EPS graphic. Since it has no preview image attached, it will appear to be a blank graphic. Don't worry, that's normal. It won't show up in the final PDF.

To have the link created on every page, you must place NEXT.EPS in such a way that it would print on every page were it a real graphic. In PageMaker, you'd place it on your master page(s). In Word, you can place it in a footer or header.

NEXT.EPS will come into your document at 1" x 1" but you can scale it to any size you like, proportionally or not.

Create a PDF from your document using Distiller, not PDFWriter. You can also use PDFMaker (the Acrobat icons) in Microsoft Office applications. When you open the new PDF, you won't see any visible link, but if you click on the appropriate spot, it will work.

Problem: an invisible link is pretty useless. You can change the parameters in the /Border statement to produce a visible link, but that's still graphically weak. Here are a few better ways of getting attractive navigation buttons:

  • Create a button or other attractive graphic in Corel Draw, Illustrator or other drawing program capable of both placing and exporting EPS files.
  • Place NEXT.EPS into your drawing. Move it over your graphic and scale it to exactly the same size (or slightly larger/smaller if you'd like the clickable area of the link to be a different size). Once you have it sized properly, send NEXT.EPS behind your graphic.
  • Export the drawing including your graphic and NEXT.EPS to a new EPS file. In Corel Draw, you'd select both then choose Selected Only in the EPS export dialog box. In Illustrator, you might first need to scale the graphic + NEXT.EPS up to the full page size before exporting.
  • Place this new EPS into your source document's master page/footer/etc and create a PDF from the document as before.
  • Your graphic will appear on every page in the PDF, and it will be a clickable link to the following page.

or

  • Draw or import any graphic you like directly into your Word, PageMaker or other document
  • Import NEXT.EPS, position it atop your button graphic, scale it to the same size but do not change the "stacking order". In your document, the EPS should obscure the button graphic.
  • When you create PDF using Distiller or the Adobe PDF driver, the EPS, having no graphical content, will disappear but will still create a Next Page link atop your now-visible button graphic.

There are many more examples that explain how to create other types of links using PDFMark code in EPS files on Thomas Merz' site (see URL above). I've also added a few more below.

You can also pop PDFMark code directly into e.g. Microsoft Word's Print fields. For a tutorial on how to do this, see Mark Anderson's site

Example PDFMark EPS

Link to NEXT page (same as above)

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 72 72 
%%Creator: Your Name Here if you like
%%Title: NEXT PDFMark 
%%BeginProlog
/pdfmark where
	{pop} {userdict /pdfmark /cleartomark load put} ifelse
%%EndProlog

[ /Rect [ 0 0 72 72 ] 
/Border [ 0 0 0 ] 
/Page /Next 
/View [ /XYZ 1 796 0 ] 
/LNK 
pdfmark

Link to PREVIOUS page:

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 72 72 
%%Creator: PDFMark
%%Title: PREVIOUS PAGE
%%BeginProlog
/pdfmark where
	{pop} {userdict /pdfmark /cleartomark load put} ifelse
%%EndProlog

[ /Rect [ 0 0 72 72 ] 
/Border [ 0 0 0 ] 
/Page /Prev 
/View [ /XYZ 1 796 0 ] 
/LNK 
pdfmark

Launch another file:

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 72 72 
%%Creator: PDFMark
%%Title: LaunchFILE PDFMark 
%%BeginProlog
/pdfmark where
	{pop} {userdict /pdfmark /cleartomark load put} ifelse
%%EndProlog

[ /Rect [ 0 0 72 72 ] 
/Border [ 0 0 0 ] 
/Action /Launch
% Note that slashes in directory path below are non-standard!
/File (p:/pdfmark/test.txt)
/Subtype /Link
/ANN
pdfmark

Launch a URL

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 72 72 
%%Creator: Steve Rindsberg
%%Title: URL PDFMark 
%%BeginProlog
/pdfmark where
	{pop} {userdict /pdfmark /cleartomark load put} ifelse
%%EndProlog

[ /Rect [ 0 0 72 72 ] 
/Border [ 0 0 0 ] 
/Action << /Subtype /URI /URI (http://www.rdpslides.com/) >>
/Subtype /Link
/ANN
pdfmark


Content authoring & site maintenance by

Friday - The Automatic FAQ Maker