Transparency can only be applied to real raster images. 

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Ziegler Stefan
> Sent: Wednesday, July 18, 2007 1:00 PM
> To: itext-questions
> Subject: [iText-questions] problems with transparency
> 
> Hi
> I've got some problems with setting images transparent. I 
> have a png-file and a pdf-file. The png is the base layer and 
> the pdf overlays the png. The white parts of the pdf should 
> be transparent not white anymore. Here's the code:
> 
> URL PdfUrl = new URL("........");
> PdfReader reader = new PdfReader(PdfUrl);
> 
> Document document = new Document(new Rectangle(width,height));
> 
> PdfWriter writer = PdfWriter.getInstance(document, new 
> FileOutputStream("out.pdf"));
> writer.setPdfVersion(PdfWriter.VERSION_1_2);
> document.open();
> PdfContentByte cb = writer.getDirectContent();
> document.newPage();
> PdfImportedPage tp = writer.getImportedPage(reader, 1);
> 
> Image img = Image.getInstance(tp);
> img.scalePercent(percent);
> 
> //nothing happens here
> //int[] transp = {255, 255, 255, 255, 255, 255};
> //img.setTransparency(transp);
> 
> URL rasterUrl = new URL(".......");
> Image imgRaster = Image.getInstance(rasterUrl);
> 
> imgRaster.setAbsolutePosition(marginXp+marginTitelp, marginYp);
> cb.addImage(imgRaster);
> img.setAbsolutePosition(marginXp+marginTitelp, marginYp);
> cb.addImage(img);
> 
> All I see is the imported pdf-file. I tried the 
> setTransperancy method, but nothing happened. 
> Thanks for your help.
> 
> Regards
> Stefan
> 
> Mit freundlichem Gruss
> Stefan Ziegler
> Leiter Aufsicht
> 
> Kanton Solothurn
> Bau- und Justizdepartement
> Amt für Geoinformation
> Rötistrasse 4
> 4501 Solothurn
> Telefon 032 627 75 96
> Telefax 032 627 75 98
> [EMAIL PROTECTED]
> http://www.so.ch
> 


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.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to