Hi!
I recently found this pretty neat lib. There's actually two things I've wondered about and really can't find much documentation about.
Problem 1: How do I create for example something like this?
COMPANY Category, Product Name
I'd like COMPANY to be blue text and "Category, Product Name" to be black text.
I tried achieving it by splitting a it in a table like such:
PdfPTable productNameTable = new PdfPTable(2);
productNameTable.AddCell(new Phrase("COMPANY", blueFont));
productNameTable.AddCell(new Phrase("Category, Product Name", blackFont));
However, it becomes a pretty hugh space inbetween. If I could specify the width of the first cell somehow then it wouldn't be a problem. So I tried making the first cell like PdfPCell and specifying width to it, but seems u can't change that value.
Problem 2: Scaling images to their right size.
Seems my images are upscaled when I insert them into a Table Cell.. How to I prevent this from happening?
I either don't want them to scale at all or that I can specify a max height for each image and the width is scaled to constrain proportions.
Problem 3: Putting images in PdfPCell and adding them as simple AddCell(image) are different?
look:

Here's my code:
PdfPTable colourImgTable = new PdfPTable(2);
colourImgTable.DefaultCell.Border = 0;
colourImgTable.DefaultCell.PaddingTop = 10;
for (int i = 1; i < colourImages.Count; i++)
{
PdfPCell smallCell = new PdfPCell(colourImages[i]);
if (i + 1 % 2 == 0)
smallCell.PaddingRight = 10;
else
smallCell.PaddingLeft = 10;
colourImgTable.AddCell(smallCell);
}
But then the images became like 2. you can see in the image above.
What I wish to achieve is that Padding should only be up and inbetween the two images.
If I do DefaultCell.Padding = 10 I get padding in all directions but the images are atleast the correct size (fit to the table row-col size). But if I add them by PdfPCell they became much larger than the table row-col can handle. Why is this and how do I achieve my goal? :)