locked
itextsharp.dll - adding two images next to each other RRS feed

  • Question

  • User-1014039493 posted


    hi guys,

    do you know an easy way adding two images next to each other (with or without using tables)?

    thanks so much.



     

    Sunday, December 19, 2010 8:33 AM

Answers

  • User-821857111 posted

    Use the SetAbsolutePosition() method: http://www.mikesdotnetting.com/Article/87/iTextSharp-Working-with-images



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 20, 2010 12:27 AM
  • User-1014039493 posted

                            iTextSharp.text.Image jpg4 = iTextSharp.text.Image.GetInstance(new Uri(url4));

                            jpg4.Alignment = iTextSharp.text.Image.ALIGN_CENTER;

                            jpg4.ScaleToFit(200f, 175f);


    PdfPTable table = new PdfPTable(2);

                            PdfPCell cell = new PdfPCell(new Phrase("Header spanning 3 columns"));

                            cell.Colspan = 2;

                            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right

                            table.AddCell(jpg1);

                            table.AddCell(jpg2);

                            table.AddCell(jpg3);

                            table.AddCell(jpg4);

                            doc1.Add(table);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 13, 2011 9:02 AM

All replies

  • User-821857111 posted

    Use the SetAbsolutePosition() method: http://www.mikesdotnetting.com/Article/87/iTextSharp-Working-with-images



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 20, 2010 12:27 AM
  • User-1014039493 posted

    hi mike,

    thanks for your reaction. i've read your blog, great and very helpfull but still looking for a way to create a table with two rows and two collums and inside 4 images. the table should be centered. 

    any help, would be greatly appreciated.


    Monday, December 20, 2010 4:09 PM
  • User-1014039493 posted


    does anyone know how to add two images in a table like?

    <table>
    <tr>
    <td><img scr='' /></td><td><img scr='' /></td>
    </tr>
    </table>

    thanks so much

    Thursday, January 13, 2011 8:36 AM
  • User-1014039493 posted

                            iTextSharp.text.Image jpg4 = iTextSharp.text.Image.GetInstance(new Uri(url4));

                            jpg4.Alignment = iTextSharp.text.Image.ALIGN_CENTER;

                            jpg4.ScaleToFit(200f, 175f);


    PdfPTable table = new PdfPTable(2);

                            PdfPCell cell = new PdfPCell(new Phrase("Header spanning 3 columns"));

                            cell.Colspan = 2;

                            cell.HorizontalAlignment = 1; //0=Left, 1=Centre, 2=Right

                            table.AddCell(jpg1);

                            table.AddCell(jpg2);

                            table.AddCell(jpg3);

                            table.AddCell(jpg4);

                            doc1.Add(table);

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 13, 2011 9:02 AM