Need help with iTextSharp Table

Last post 10-01-2009 10:17 AM by KenNichols. 4 replies.

Sort Posts:

  • Need help with iTextSharp Table

    09-30-2009, 3:45 PM
    • Member
      22 point Member
    • KenNichols
    • Member since 08-13-2009, 12:55 PM
    • Largo, FL
    • Posts 55

    To make things simple I will use examples from

    http://itextsharp.sourceforge.net/tutorial/index.html

    If the following code is used

    http://itextsharp.sourceforge.net/examples/Chap0501.cs

    You will get the following PDF

    http://itextsharp.sourceforge.net/examples/Chap0501.pdf

    There is too much empty/wasted space above the data. I would like to reduce the height of the cells so I can fit more on the page. How/can this be done?

    I have tried

    aTable.DefaultCell.VerticalAlignment =Element.ALIGN_TOP

    but it doesn't move the data to the top of the cell, it's as if it doesn't realize that the space is there.

     

    Filed under: ,
  • Re: Need help with iTextSharp Table

    09-30-2009, 6:15 PM
    • Contributor
      2,339 point Contributor
    • kwanann
    • Member since 02-05-2009, 12:59 PM
    • SG
    • Posts 478
    • TrustedFriends-MVPs

    Ah, you are actually trying to fiddle around with the margins, refer to

    http://itextsharp.sourceforge.net/tutorial/ch01.html


    on how to change the margins

    MVP ASP.NET C#
    View my blog @ http://jefferytay.wordpress.com
  • Re: Need help with iTextSharp Table

    09-30-2009, 10:34 PM
    • Member
      22 point Member
    • KenNichols
    • Member since 08-13-2009, 12:55 PM
    • Largo, FL
    • Posts 55

    I am trying to change the "cell" top margin not the "page" margins

  • Re: Need help with iTextSharp Table

    10-01-2009, 12:24 AM
    • Contributor
      2,339 point Contributor
    • kwanann
    • Member since 02-05-2009, 12:59 PM
    • SG
    • Posts 478
    • TrustedFriends-MVPs

    Apologies, in this case you should be looking at cellpadding, cellspacing and the like

    http://itextsharp.sourceforge.net/tutorial/ch05.html


    the sample code is at

    http://itextsharp.sourceforge.net/examples/Chap0506.cs

    MVP ASP.NET C#
    View my blog @ http://jefferytay.wordpress.com
  • Re: Need help with iTextSharp Table

    10-01-2009, 10:17 AM
    Answer
    • Member
      22 point Member
    • KenNichols
    • Member since 08-13-2009, 12:55 PM
    • Largo, FL
    • Posts 55

     Sorry, my reply sounded a bit rude. It was unintentional.

     

    I was able to get a usable result by changing

    cell.Leading = 6;

     

Page 1 of 1 (5 items)