« Return to Thread: Different coloured text on same line and image scale problem

Re: Different coloured text on same line and image scale problem

by Elrinth :: Rate this Message:

Reply to Author | View in Thread

Ok so I solved it myself. I type the Company logo + Product name via:
PdfContentByte cb = writer.DirectContent;
        cb.BeginText();
        cb.SetFontAndSize(bf, 12);
        cb.SetColorFill(new Color(0x33, 0x33, 0xff));
        cb.SetTextMatrix(45, 740);
        cb.ShowText("Company Name"); // set position in document
        cb.EndText();

        cb.BeginText();
        cb.SetFontAndSize(bf, 12);
        cb.SetColorFill(new Color(0, 0, 0));
        cb.SetTextMatrix(115, 740); // set position in document
        cb.ShowText("Product Name");
        cb.EndText();


I still haven't figured out how to align images properly tho. The PaddingLeft seems to set PaddingRight automagically and for all other cells also. Very weird.
But I successfully resized an image via:
curImg.ScaleAbsoluteWidth(100);

I'll keep ya updated whenever I fix the other shiz.

 « Return to Thread: Different coloured text on same line and image scale problem