What I want to do it write a utility that will detect and or get the
text from a PDF that is obscured by a black piece of data.  There have
been cases recently which have caused some embarrasement where people
tried to "black out" text in the hopes of the text not being read by
other people.  The following link is an example...

http://www.thememoryhole.org/feds/justice_redaction.htm

Thank you.

On 10/10/05, Brent Vaughn <[EMAIL PROTECTED]> wrote:
> I'm not sure what you mean by "blacked out" text.  I am trying to write
> to the UnderContent layer of an existing PDF that I read into a
> PDFReader.
>
>
>
> Here is the code:
>
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> PdfReader reader = new PdfReader("C:/Dev/TestPDFs/36CH5002.pdf");
> PdfStamper stamper = new PdfStamper(reader, baos);
> BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA,
> BaseFont.CP1250,true);
> for (int i = 0; i < reader.getNumberOfPages(); i++)
> {                       {
> Rectangle rect = reader.getPageSizeWithRotation(i + 1);
> stamper.setRotateContents(true);
> PdfContentByte under = stamper.getUnderContent(i + 1);
> StringBuffer wmark = new StringBuffer("SPECIAL");
> under.beginText();
> under.setFontAndSize(bf, 66);
> under.setColorFill(Color.LIGHT_GRAY);
>
>
> under.showTextAligned(Element.ALIGN_CENTER,
> wmark.toString(),rect.width()/2,rect.height() / 2, 45);
>
> under.endText();
> }
>
> -----Original Message-----
> From: Mark [mailto:[EMAIL PROTECTED]
> Sent: Thursday, October 06, 2005 6:54 PM
> To: Brent Vaughn
> Cc: [email protected]
> Subject: Re: [iText-questions] PdfReader and layers
>
> are you trying to uncover "blacked out" text?  If so, could you
> provide any sample code?  I am trying to do the same thing....
>
>
> On 10/6/05, Brent Vaughn <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Can you write to the UnderContent layer when you read in an already
> created
> > pdf?  When I try to do it, it doesn't throw any errors, but it won't
> show
> > text in the PDF?
> >
> >
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to