0

I'm looking for a way to find text matching a particular pattern in a PDF and then add a hyperlink to it. Ideally this would be done through ruby. Thanks for any tips.

I've played around with the PDF-reader library and Prawn, but its still not evident that I can do what I'm hoping.

windup
  • 455
  • 1
  • 5
  • 17
  • [Here](http://stackoverflow.com/questions/19414763/detect-and-alter-strings-in-pdfs/19551997#19551997) I answered how to add highlights, with Perl. Adding links (which are annotations, too) will work the same. – user2846289 Jan 22 '14 at 16:08
  • Thanks a lot. Would love to see that in ruby. – windup Jan 22 '14 at 21:17

1 Answers1

0

While you can use prawn to write to a file (How to edit or write on existing PDF with Ruby?), it seems, however, that that searching and replacing is not possible (Replace some text in a PDF template using Prawn in Ruby).

Community
  • 1
  • 1
AGS
  • 14,288
  • 5
  • 52
  • 67
  • My case is simpler in that I'm not trying to replace with something different. I'm replacing with the same thing- only with a hyperlink which would merely change the color to blue and add an underline. If I can't replace a word, then it seems I should at least be able to draw a new word on top of the old word. I obviously don't know how to do it, but to say it is impossible doesn't sound right. – windup Jan 22 '14 at 04:06