cesarjz wrote:

Hello Bruno, congratulations for the best PDF library,
I develop a change in your library for add a background image to a sign
field in the layer n0 , the size of the image fit to the sign field.

It`s a simple change but the look of the sign field is better with a
background image, i think :-)
I send to you the patch files to to pass from 1.3 version to my version
and viceversa and if you considere a good change , add to your library.
Thanks for your attention.


Thank you for the code enhancement.
I forward your mail to the mailinglist as I don't have the time to integrate it rightnow.
This way it gets archived and it makes a good change to be added to iText 1.3.1.
best regards,
Bruno


----------- 1 patch -----------
128a129


private String imageFileName ;


311c312,317
< ---


public void setImageFileName(String imageFileName){
this.imageFileName = imageFileName ;
}
public String getImageFileName(){
return this.imageFileName;
}


324c330,334
< t.setBoundingBox(new Rectangle(100, 100));
---


if (rect!=null){
t.setBoundingBox(new Rectangle(rect.width(),


rect.height()));


}else{
t.setBoundingBox(new Rectangle(100, 100));
}


326c336,349
< t.setLiteral("% DSBlank\n");
---


// if (imageFileName != null){
com.lowagie.text.Image image =


com.lowagie.text.Image.getInstance(imageFileName);


image.setAbsolutePosition(0,0);
if (rect!=null){
image.scaleToFit(rect.width(), rect.height());
}else{
image.scaleToFit(100, 100);
}
t.addImage(image);
}else {
t.setLiteral("% DSBlank\n");
}



----------- 2 patch -----------


129d128
< private String imageFileName ;
312,317c311
< public void setImageFileName(String imageFileName){
< this.imageFileName = imageFileName ;
< }
< public String getImageFileName(){
< return this.imageFileName;
< }
---




330,334c324
< if (rect!=null){
< t.setBoundingBox(new Rectangle(rect.width(),
rect.height()));
< }else{
< t.setBoundingBox(new Rectangle(100, 100));
< }
---


t.setBoundingBox(new Rectangle(100, 100));


336,349c326
< // < if (imageFileName != null){
< com.lowagie.text.Image image =
com.lowagie.text.Image.getInstance(imageFileName);
< image.setAbsolutePosition(0,0);
< if (rect!=null){
< image.scaleToFit(rect.width(), rect.height());
< }else{
< image.scaleToFit(100, 100);
< }
< t.addImage(image);
< < }else {
< t.setLiteral("% DSBlank\n");
< }
---


t.setLiteral("% DSBlank\n");









------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to