[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] URL hyperlinks in PDF from grops and ps2pdf?
From: |
Deri James |
Subject: |
Re: [Groff] URL hyperlinks in PDF from grops and ps2pdf? |
Date: |
Tue, 21 Feb 2012 10:43:16 +0000 |
User-agent: |
KMail/1.13.7 (Linux/2.6.38.8-desktop-10.mga; KDE/4.6.5; x86_64; ; ) |
On Tuesday 21 Feb 2012 07:21:15 Clarke Echols wrote:
> I use groff to produce technical white papers. I run gv and
> monitor a PostScript file so every time I update the file while
> writing in vi (by pressing a function key that contains the groff
> command as a vi macro).
>
> When I need to print the file, I send it from gv to a LaserJet
> printer.
>
> But I also often need to convert the PostScript document file to
> PDF format so I can load it onto a website for visitors to
> download. I normally use ps2pdf to make the conversion.
>
> There are times when it would be nice if I could include a live
> hyperlink to a web URL inside the PDF (and have it look like a
> hyperlink in the PostScript file too).
>
> I don't want to produce an HTML file from groff, which leaves
> me with the question:
>
> Is there an easy way to put an html hyperlink inside of a
> groff-generated PostScript file?
>
> Thanks,
>
> Clarke
See Keith Marshall's documentation of the pdfmark macro set. It says to use:-
.pdfhref W [-D <URI>] [-P <prefix-text>] [-A <affixed-text>] [--] descriptive
text ...
as an example:-
.\"======================================
For example, we could introduce a reference to
.pdfhref W -D http://groff.ffii.org -A , the groff web site
in which the actual URI is concealed,
.\"======================================
Run this snippet with:-
groff -mpdfmark snippet.trf > snippet.ps; ps2pdf snippet.ps
If you have a recent CVS version of groff you can also try:-
groff -Tpdf snippet.trf > snippet.pdf
Cheers
Deri