You need to have a leading based on the font size or image size, for example 
Paragraph.SetLeading(0, 1.25f).

Paulo 

-----Original Message-----
From: alrts [mailto:edition-b...@swissonline.ch] 
Sent: Wednesday, August 04, 2010 11:15 AM
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Image scaling not possible in some cases


Somehow there was a formatting problem with my thread. Here is it again:

Hi all,

I'd like to put paragraphs in columns and add images in between so that they
don't overlap but follow each other. As it turns out, I can do this but
can't scale the image at the same time.To be more specific:

When I add images 

Image img = Image.getInstance(imgFile);

and when I am in composite mode, which means I work with ColumnText and add
objects (paragraphs, images, ...) by

ct.AddElement(p);
ct.AddElement(img);
ct.AddElement(p);

my image gets blown up to the size set previously by

ct.setSimplaColumn(left, bottom, right, top);

and all attempts to scale the image like

img.ScalePercent(100, 50);

before adding it are just IGNORED. The Paragraph p followed by the image is
placed after the image, not over the image, as want it.

However, when I want to scale the image, I have to add it by

ct.AddParagraph(new Chunk(img, 0, 0));

Then the image is not blown up as above and I am even able to scale the
image (all these functions work), however the image is placed over the
existing text and the next paragraph is likewise not placed below the image
but over it. Hence the yLine is not updated after image insertion.

So it seems that I can't have both worlds, what would mean: Being able to
scale the image und at the same time place it between paragraphs without
adjusting the yLine or by other absolute positioning means.

Am I missing a point or are my observations correct ?

I'd appreciate any comments.

PS: I'm using iTextSharp but I don't think that this causes a the problem
here.


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.


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to