I’m having some trouble scaling an image that i am inserting.
I must be doing something wrong, because it does not change at all, no matter what i do.
This is the code i have at the moment, but it does not seem to work.
The image gets inserted fine, it just doesn’t scale, no matter what values i try.
Any obvious things i am doing wrong? Any common things that people do wrong?
I am working in C#, but i assume the syntax is the same (more or less) in all languages.
Image imgSpine = Image.GetInstance(strSpine);
imgSpine.ScaleAbsolute(2, 55);
SpineCell.Image = imgSpine;
SpineCell.Image.Border = Rectangle.NO_BORDER;
SpineCell.VerticalAlignment = Element.ALIGN_TOP;
SpineCell.HorizontalAlignment = Element.ALIGN_LEFT;
pTable.AddCell(SpineCell);
Looking at the source,
cell.Imageis always scaled to fit the cell. You’ll want to wrap your image in aChunkor some similarElementthat’ll hold anImage.The
call.Imageproperty is also always written to a thePdfPTable.TEXTCANVAScanvas in the PdfPTable, so you don’t have any control over Z order.Options:
Number 1 is probably much easier.