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 6751651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:57:08+00:00 2026-05-26T12:57:08+00:00

What is the recommended way of printing a text document as a pdf using

  • 0

What is the recommended way of printing a text document as a pdf using absolute positioning ?
I am having a table that I have to print. I am also having the data type lengths and starting positions of the columns.
Since the existing table was a character based, there was no problem in its positioning. But even after using a monotype font (Courier, 10) I am not able to properly position the data and last column(s) of each row erroneously skip to the next line.

In order to present my data as close as the character one, I divided the page into different columns(based on its page size) and then add the contents at the desired place. I am adding chunks of data into the paragraph.

paragraph.add(new Chunk(new VerticalPositionMark(), columnNo*ptUnit, false));

I have tried to tweak the page size, font size and margin lengths, but the data is not properly displayed. Have you encountered any such problems ? please do share your thoughts.

  • 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-05-26T12:57:08+00:00Added an answer on May 26, 2026 at 12:57 pm

    Have you tried ColumnText

    When i want to write a paragraph and I do know the amount of lines…I do a cycle incrementing (even it says incrementing and is minus is because the pdf is from “south” to “north” (0 – height) the y in a proportion of the fontsize, something like this

    //_valueArray is my string[]
    //fontSize is the value of the Size of the font...
    //1.5 it's just a magic number :) that give me the space line that i need
    //cbLocal is the PdfContentByte of the pdf
    for (i = 0; i < _valueArray.Length; i++)
    {
        var p = new Phrase(_valueArray[i], font);
        ColumnText.ShowTextAligned(cbLocal, align, p, x, y, 0);
        if (i + 1 != _valueArray.Length)
        {
            y = y - (fontSize*1.5f);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone have a recommended way to find definitions in header files when using
I have noticed that the recommended way to test a view controller in XCode
Is there a recommended way of using Django to clean an input string without
Whats the recommended way for storing authentication information in iOS that could be easily
What is the recommended way to gracefully close a TCP socket? I've learned that
Seems the Google-recommended way (using the android support library) for a fragment or activity
What's the standard/recommended way to test time-dependent methods? As an example: I have a
What is the recommended way to flip a polygon horizontally so that its bounding
The recommended way to make an edit page for ASP.NET MVC is to have
What is the recommended way to embed PDF in HTML? iFrame? Object? Embed? What

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.