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