Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Highlight text in pdf using PDFBox tool in java

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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/
 
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic