0
%!PS
/Helvetica findfont 20 scalefont setfont
20 dup moveto (Comparator) show newpath
[ /Rect [ 20 dup moveto (Comparator)  false charpath pathbbox newpath ] 
/DST /Color [.7 0 0] %use Page 2 to make this work temporary
/Subtype /Link 
/ANN  pdfmark
showpage

For the above postscript, I donot know the destination page number until the full pdf is generated.The description for Comparator is found at the end of pdf in a description table.I tried to link it via Latex with \hypertarget but didn't work. Comparator in pdf can exists more than once and they should be be linked to my description table at the end. Which way is best to complete my task? please advise.

Jwary
  • 137
  • 2
  • 16
  • I recognize parts of it ;-) I thought you translate ps->pdf, but normally pages would not change any more once you have the postscript? – Stefan Hegny Jul 25 '16 at 18:51
  • Hello again :) . I am translating PS to Latex then to PDF . I should some how link the DST in pdfmark with the data in the description table. – Jwary Jul 26 '16 at 08:47
  • I think you have the choice to link to the page number, or a link target on that page - the page number is fix once you have the postscript, isn't it? – Stefan Hegny Jul 26 '16 at 09:20
  • No I don't have the page number until the full pdf is generated. I should create a bookmark for each item in description table then link it with the pdfmark in postscript. But I am not successful in doing this – Jwary Jul 26 '16 at 10:07
  • But you can generate the pdf once ahead without your links first and the page numbers will be exactly the same as when you insert your links and then generate a pdf again - adding the links can't modify the page numbers. Or how could they? – Stefan Hegny Jul 26 '16 at 16:53
  • This is more complicated thing to do.Already my pdf is very large and generating it twice is going to increase the time. Also I would like to somehow make this generic.I have a TT file where I am using hypertarget{parametr_name} then \input{parametr file path} . At the same time in my PS file I am using above script (posted) in generic way /DST parametr_name which doesn't work at the moment but I want to make it work. – Jwary Jul 28 '16 at 09:59
  • I see. But then, why don't you use hyperref to let it generate the link instead of trying yourself? - Still do not understand the question completely - you are asking about the right value for the /DST (destination)? That will point to the place where you specified the hypertarget? You still could generate one test pdf file using a test tex file where you let the hyperref package build the link and then you inspect the pdf and see what it inserts into /DST, and then do the same for all positions yourself. - if it inserts the pagenumber explicitly then you're probably lost... – Stefan Hegny Jul 28 '16 at 12:49
  • Hello Stefan , hyperref and hypertarget for some reason did not get linked with my pdfmark DST but the good news is when I used postscript code inside latex (using special tag ) to specify my DST parametr, linked the target perfectly :) . Thanks for your kind discussion . – Jwary Jul 28 '16 at 14:58

0 Answers0