Page 1 of 1

blurring text

Posted: 2010-04-04T09:19:48-07:00
by ccurvey
I'm so close, but I can't get it just right.

I have a 1-page PDF containing text. I want to convert this into a PDF with all but one line blurred. (This is kind of cheapo redaction -- I want the user to see that they're looking at an invoice sent to my firm, but not see other customers' information.)

I've gotten this far:

Code: Select all

convert.exe "c:\temp\foo.pdf" -region (792x71+0+0 -blur 0x2) -region (792x715+0+76 -blur 0x2) "c:\temp\bar.pdf"
and it looks great, but the unblurred section is still, well, blurry. I'm not sure if the blurring effect is bleeding out into the unblurred section, or if it's just the rasterizing of the text. I've been trying to play with density+resize without any visible success.

Can someone help me get this incantation right?

Re: blurring text

Posted: 2010-04-04T09:57:13-07:00
by snibgo
Your command doesn't follow IM syntax. (Sadly, IM is poor at reporting bad syntax.) Try:

Code: Select all

convert.exe "c:\temp\foo.pdf" -region 792x71+0+0 -blur 0x2 -region 792x715+0+76 -blur 0x2 "c:\temp\bar.pdf"
To test just the general rasterizing effect, try:

Code: Select all

convert.exe "c:\temp\foo.pdf" "c:\temp\bar2.pdf"

Re: blurring text

Posted: 2010-04-04T13:35:22-07:00
by el_supremo
When IM rasterizes the PDF it uses a default density of 72dpi which will make the text look rather poor. Add a -denisty command before reading the PDF to change the default e.g.:

Code: Select all

convert.exe -density 300 "c:\temp\foo.pdf" -region 792x71+0+0 -blur 0x2 -region 792x715+0+76 -blur 0x2 "c:\temp\bar.pdf"
Of course, this will probably change the coordinates of the regions which need blurring but once you figure out the new region, the unblurred text should look better.

Pete