Take the 2-minute tour ×

I am trying to create an interface to allow easy editing of PDFs like VuePDF in an application I am building. This is not core to the application and will only be used by the admin.

I was wondering if there was a per-built stack for editing PDFs in the browser window?

Basically the admin user needs to black-out private data, like names and addresses.

If there is not currently a solution I was thinking of some like:

  • Using ImageMagik to create JPEG version of each page
  • Using the canvas element to add black marks to the image
  • Recording the location of top-left and bottom right of each black mark
  • Sending back the coordinates and adding black rectangles to the original PDF

Is that correct?

share|improve this question
I dunno how strict your security/privacy requirements are for the resulting "blackened" rectangles. But you should be aware of the following: just overlaying blackened rectangles is like putting the info behind a black curtain that can easily be pulled aside. PDF text and other objects behind the black rectangles can easily be un-hidden. In order to really make that text un-recoverable, you need to apply a "flattening" operation to the page after putting the black overlay on top. Only this can "burn in" the black pixels in a way that forever looses the original content. –  Kurt Pfeifle Sep 14 '10 at 6:47
@dale-hurley I need to do something similar but instead of obscuring I just need to draw boxes and get coordinates into a database would you be prepared to share your solution? –  Justin Erswell Dec 18 '12 at 17:30
add comment

1 Answer

If you draw over the PDF, the data will still be there in the PDF and easy to extract. I wrote a blog article explaining the issue at http://www.jpedal.org/PDFblog/?p=553

You need to replace the text in the PDF command stream as well.

share|improve this answer
Thank you you are 100% right –  Dale Hurley Sep 15 '10 at 13:24
add comment

Your Answer


