Transparancy Issue for showing Text on Image
- From: "Paulo Soares" <psoares (at) consiste.pt>
- Date: Mon, 13 Nov 2006 16:52:02 -0000
You need over.setGState(gs) to set the opacity but that's not the
problem. Where do you get "document" from? PdfStamper doesn't have any.
You should use PdfReader.getPageSize().
Paulo
> -----Original Message-----
> From: itext-questions-bounces (at) lists.sourceforge.net
> [mailto:itext-questions-bounces (at) lists.sourceforge.net] On
> Behalf Of pranav pandya
> Sent: Monday, November 13, 2006 1:34 PM
> To: itext-questions (at) lists.sourceforge.net
> Subject: [iText-questions] Transparancy Issue for showing
> Text on Image
>
> Hi,
>
> I am a new member to this forum. I want to display a Text as
> watermark on each page of iText. I have developed the code
> for the same which shows things well for major pdfs. However
> I am having one PDF which contains scan images only, no text.
>
> When I apply my code to generate the watermark to it, It does
> not show the watermarked text on it.
>
> My code snippet for watermarking the text is
>
> //opacity settings
>
> PdfGState gs = new PdfGState();
> gs.setFillOpacity(0.5f);
>
> while(i<totalpages)
> //i is the page no...a loop through PDF pages
> over = stamp.getOverContent(i);
> over.beginText();
>
> over.setTextMatrix(document.top(),document.bottom()-20);
> over.setFontAndSize(bf,120);
>
> over.setColorFill(Color.orange);
> over.showTextAligned(Element.ALIGN_CENTER, "WaterMark
> Test ", document.getPageSize().width() / 2,
> document.getPageSize().height() / 2, 55);
>
> over.setFontAndSize(bf,20);
>
> over.showTextAligned(Element.ALIGN_CENTER, "Contract
> Signature : Test Line 1 applied",
> document.getPageSize().width() / 2 + 50,
> document.getPageSize().height() / 2, 55);
>
> //text ends
> over.endText();
>
> ------------------Code Ends
>
> I want to show above both lines as texts in every PDF page.
> My PDF is containing only whole page scan images at each
> page. No Text data it contains.
>
> Pls. help me how can I add watermarked text on such PDFs.
>
> Regds,
> Pranav
>
>
>
> <http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.re
> diff.com/signature-home.htm/1507191490 (at) Middle5?PARTNER=3>
>
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions