[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] pdfmark strikes back + general script/groff handshake
From: |
Carlos J. G. Duarte |
Subject: |
Re: [Groff] pdfmark strikes back + general script/groff handshake |
Date: |
Tue, 16 Dec 2003 11:58:14 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031014 Thunderbird/0.3 |
Hi there,
Sigfrid Lundberg - LUB NetLab wrote:
[...]
manuscript catalogue I'm building). I've got two problems with this, the
first being that I don't understand what in the scripts that generates the
anchor text and what embeds the URI:
.ds pdfref-1 ps: exec [ /Rect [145610 u 89240 u 313860 u 96140 u] \
/Border [0 0 \\n[wid]] \
/Action << /Subtype /URI /URI (\\$1) >> \
/Subtype /Link \
/ANN pdfmark'\c
Well, I took some shortcuts to WL's solution. These shortcuts make the
solution somehow simpler, but messier in some sense (can't win them
all!) One of the cuts was those pdfref-1 strings... I take the fact the
references are output by the .PSHREF macro, so the script searches for
this text (^\.PSHREF) and when it finds, it outputs the PS inline code.
So things get automatized and we don't need to maintain those DS strings.
Now, the small .PSHREF macro I've send was just a simple one for
testing. That uses the same string both for text and anchor. The real
PSHREF I'm using is this (the script will continue to work with no change):
.de PSHREF \" HREF continuation_char NAME
. \" exemplo: .PSHREF http://www.google.com . "google"
.fam HN
.tm TM:pshref: \\$1
.ie !'\\$3'' \{\
\O1\m[white]|\m[]\h'-\w'|'u'\O2\c
\\m[blue]\\$3\\m[]\c
\O1\m[white]|\m[]\h'-\w'|'u'\O2\c
.\}
.el \{\
\O1\m[white]|\m[]\h'-\w'|'u'\O2\c
\\m[blue]\\$1\\m[]\c
\O1\m[white]|\m[]\h'-\w'|'u'\O2\c
.\}
.ie !'\\$2'' \&\\$2
.el \&
.fam
..
As for your second question, there is PDF support for internal links,
but I've never used it. The inline PS code must be output in two phases,
one to define the link and other to reference it. I've seen past posts
on this list containing code and examples to do it in groff.
Hmm... I'm sure you can find it on google, but at the time I did save
that stuff, so I'm now uploading it to this place:
http://cgd.sdf-eu.org/pdf-groff/
you can find here groff code that suppost pdfmark stuff and three
documents about PDF from adobe (one PDF reference and two on PDFMARK).
None of this stuff is mine, and I didn't change the files in anyway (I
think!).
best regards,
--
carlos