Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Highlight text in pdf using PDFBox tool in java  RSS feed

 
Gunjan Kumar
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone worked on "Regenerate the PDF appearance stream and draw a highlighted box behind the text".
I have one pdf file and i know the X,Y cordinate and height and width of text to highlight.
I am using pdfbox utility.and i want to highlight the text with yellow color.
Any help would be highly appreciated.
Thanks
Gunjan
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's probably impossible. You may be successful in adding new content (like a colored box) to a PDF *on top of the existing content*, but manipulating existing text is the domain of tools like Acrobat Pro. Furthermore, the library to do that would be iText, not PDFBox (which -to my knowledge- doesn't support this kind of PDF manipulation).
 
Scott Mitchell
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Impossible? Not at all! There's another java library which can do exactly what you want (text highlighting): PDF Clown.
See this post about its upcoming 0.1.1 release: http://pdfclown.wordpress.com/2011/04/12/waiting-for-pdf-clown-0-1-1-release/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!