> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Jay Chiu
> Sent: Wednesday, March 03, 2004 4:40 AM
> To: [EMAIL PROTECTED]
> Subject: [iText-questions] Question about background image
> 
> I need add background images to certain areas in pdf files. Can
> someone please tell me what approach I may use for the following
> two cases?
> 
> (1) Adding a small image to a bigger area
> Support the image original size is 300x300, scale of 1/3 is
> required to get better resolution, and the area size is 200.
> Thus 4 images need to be laid out in this area. It seems I can
> not use watermark in this case. 

Use a page event to place the images or whatever you want.

> 
> (2) Add a big image to a smaller area
> Support the image final size is 200x200 and the area isze is
> 100x100. Then we only want to display the top left section of
> the image in the area. I can not find image chopping function in
> Itext API. 

Use a clip area in PdfContentByte. Ex:

cb.saveState();
cb.rectangle(x, y, w, h); //the clipping dimensions
cb.clip();
cb.newPath()
cb.addImage(...);
cb.restoreState();

Best Regards,
Paulo Soares




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to