LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2007, 09:35 AM   #1
Tischbein
Member
 
Registered: Oct 2006
Distribution: debian
Posts: 124

Rep: Reputation: 15
postscript hyperlinks


Dear All,

Has anyone here ever made hyperlinks in postscript? Can you recommend a text or tutorial on it?

I draw quite a few diagrams (mathematical constructs mostly) in postscript and I like it so, whilst not ruling other languages out completely I'm quite keen to stick with postscript as a language. I'ts compact (so I spend little time typing) and readable providing that it's well commented.

I'd like to link areas in some diagrams to other pages, and sometimes to other points in the same diagram. I imagine that there is a command rather like stroke or fill that takes such an area and links it to an url.

This is what I've looked at so far:

- I've read on various web discussions that postscript doesn't support hyperlinks natively, but that there are dictionaries that can be imported that do the trick.

- The program html2ps generates postscript with hyperlinks. The way I've tested it is by calling:
html2ps simple.html > simple.ps
Then, because I don't have a postscript viewer on this box (and am too lazy to spend five minutes installing one)
ps2pdf simple.ps
Then look at the simple.pdf with a pdf viewer, and hey presto the links work!

- I've looked inside some output files of html2ps Even for a very simple 3 line html file this is 600 lines long. I've started reverse engineering it, however it'll take me some time and will be quite painful.

- I've heard of pdfmark in the context of postscript hyperlinks. The word appears in the html2ps output which kinda confirms this rumour. I've looked up pdfmark on the web but haven't found any nice short postscript examples of how to use it.

Any help would be greatly appreciated.

Regards, Tischbein
 
Old 08-04-2007, 06:17 PM   #2
Tischbein
Member
 
Registered: Oct 2006
Distribution: debian
Posts: 124

Original Poster
Rep: Reputation: 15
Solved. I just needed to read the Adobe pdfmark documentation and type a little more accurately.

http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/pdfmarkReference.pdf


Here's a toy:

%!PS-Aobe-3.0

%%
% If pdfmark is defined, use it (for hyperlinks & other pdf-not-postscript features)
% otherwise give pdfmark a null definition so that we don't get any errors.

/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse

%
%%

%%
% Document metadata

[ /Author (A clutch of disembodied fingers)
/Title (Aspects)
/DOCINFO pdfmark

%
%%


%%
% A real drawing - an HSBC mark

newpath

100 100 moveto
100 100 rlineto
-100 0 rlineto
100 -100 rlineto
closepath fill

%
%%

%%
% A real hyperlink

[ /Rect [100 100 200 200]
/Border [16 16 1]
/Color [0 0 1]
/Action << /Subtype /URI /URI (http://www.google.com) >>
/Subtype /Link
/ANN pdfmark

showpage

%
%%

%%
% A link to another point in this document

% First an icon
newpath
300 600 50 0 360 arc
fill

% then a link
[ /Rect [250 550 350 650]
/Border [16 16 1]
/Page 1
/View [/XYZ 50 250 null]
/Subtype /Link
/ANN pdfmark

showpage
%
%%

Last edited by Tischbein; 08-04-2007 at 06:18 PM.
 
Old 07-10-2011, 09:50 AM   #3
naarkhoo
LQ Newbie
 
Registered: Mar 2011
Posts: 6

Rep: Reputation: 0
I am trying to rotate the object and its hyperlink boundary in consequent. I use a command like rotate 10 but it only works on the object, not its boundary. I am wondering how can I rotate the object and its boundary together.
 
  


Reply

Tags
postscript, programming



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kmail hyperlinks? Larry Webb Linux - Software 2 01-29-2007 06:42 AM
Hyperlinks in OOo docs leupi Linux - Software 5 04-17-2005 10:55 AM
thunderbird won't open hyperlinks atom Linux - Software 5 04-07-2005 12:19 AM
hyperlinks don't open browser Steel Shepherd Linux - Software 6 02-17-2004 11:11 AM
Hyperlinks in Email MarcRJacobs Linux - Newbie 1 03-20-2003 06:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration