Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8703745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:56:13+00:00 2026-06-13T02:56:13+00:00

I am currently working with Itextsharp and I have some trouble with PDfPtables. Sometimes

  • 0

I am currently working with Itextsharp and I have some trouble with PDfPtables.
Sometimes they get too big for a page and, when added to a document, are broken up on multiple pages.
Sadly ths rational behviour is not acceptable for some of my superiors – they keep insisting that the table shall be “shrunk” to a page. Is there a way to achieve this? There are some tantalizing hints that i could be possible – but hints are all that i have.

What is the alternative? Perhaps I could delete the fat table from the document and build the table again with smaller Fonts and Cells, but that would be very cumberosme – I would prefer to “zoom out”, in lack of a better word.

My current code:

Dim test As PdfContentByte = mywriter.DirectContent
Dim templ = test.CreateTemplate(mywriter.PageSize.Width, mywriter.PageSize.Height)
Table.WriteSelectedRows(0, Table.Rows.Count - 1, 0.0F, mywriter.PageSize.Height, templ)
Dim myimage = Image.GetInstance(templ)
'   myimage.ScaleAbsolute(mywriter.PageSize.Width, mywriter.PageSize.Height)

would scaleabsolute be necessary?
myimage.SetAbsolutePosition(0, 0)
test.AddImage(myimage)

This code puts something one the page, but it has the height of the page and the width is about a quarter of the page – wi will try to find the bug…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:56:14+00:00Added an answer on June 13, 2026 at 2:56 am

    Create the table and define a ‘total width’. As soon as iText knows the width of the table, you can calculate the height of all the rows. Once you know the height, you can check:

    1. Does the table fit the page? Just add it as is. Maybe using WriteSelectedRows if you don’t want to take any page margins into account.
    2. Isn’t there enough space on the page? Add the table to a PdfTemplate (there’s more than one way to do this), wrap the PdfTemplate inside an Image. Scale the image, and add it to the document.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im currently working with jQuery ajax and i get some unexpected error. I use
Currently working on a VBScript to automate some of the dirty PST ingestion work
Currently working on something which uses ajax for some pagination. What I'm looking to
Im currently working with two actors in scala. One, the producer , produces some
Im currently working on a Python/Pygame module to wrap some basic sprite animation. Animation
I'm currently working on learning some game development with Java. I'm working on the
I am currently working on a one-page layout for a website. Each section of
Im currently working on making a flash platformer engine...but my collision detect needs some
Currently working on trying to figure out asynchronous submission in ColdFusion. I always have
Currently working on a 2-way lookup association generic, sorted by TKey. At some point

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.