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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:00:25+00:00 2026-05-14T23:00:25+00:00

I am using iTextSharp to create a pdf in my ASP.NET 3.5 application. Below

  • 0

I am using iTextSharp to create a pdf in my ASP.NET 3.5 application. Below is the current layout of my pdf:

John Doe   EmployeeID 2008      Department1
                                                       Department2
                                                       Department3

Below is the code I am using:

PdfPTable table = new PdfPTable(4);
    table.DefaultCell.Border = 0;
    var empName = new Phrase("John Doe");
    var empIDHeading = new Phrase("EmployeeID");
    var empID = new Phrase("2008");
    var departments = new PdfPCell(CreateDepartments())
                     {
                         Border = 0,
                         NoWrap = true

                     };
    table.AddCell(empName);
    table.AddCell(empIDHeading );
    table.AddCell(empID );
    table.AddCell(departments);

 private PdfPTable CreateDepartments()
   {
      var d1 = new Phrase("Department1");
      var d2 = new Phrase("Department2");
      var d3 = new Phrase("Department3");
      PdfPTable table = new PdfPTable(2);
      table.DefaultCell.Border = 0;
      table.AddCell(d1);
      table.AddCell(d2);
      table.AddCell(d3);
      return table;
   }

How can I modify this code to get the below output:

                                                       Department1
                                                       Department2
John Doe   EmployeeID 2008      Department3

  • 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-14T23:00:26+00:00Added an answer on May 14, 2026 at 11:00 pm

    Set your PdfPTable’s DefaultCell’s VerticalAlignment property to Element.ALIGN_BOTTOM.

    I added one line to your snippet showing this:

    PdfPTable table = new PdfPTable(4); 
        table.DefaultCell.Border = 0; 
        // Added -----
        table.DefaultCell.VerticalAlignment = Element.ALIGN_BOTTOM;
    
        var empName = new Phrase("John Doe"); 
        var empIDHeading = new Phrase("EmployeeID"); 
        var empID = new Phrase("2008"); 
        var departments = new PdfPCell(CreateDepartments()) 
                         { 
                             Border = 0, 
                             NoWrap = true 
    
                         }; 
        table.AddCell(empName); 
        table.AddCell(empIDHeading ); 
        table.AddCell(empID ); 
        table.AddCell(departments); 
    

    Worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Itextsharp version 5.0.6 to convert Asp.net page into PDF. I am
I am using iTextSharp to generate pdf in my .net application. Now I want
I want to convert a ASP.NET web page to pdf using ITextSharp. I did
I'm creating a PDF file on the fly using ITextSharp and ASP.NET 1.1. My
How to open the PDF file after created using iTextSharp on ASP.Net? I don't
I'm using iTextsharp library to create PDF files. I can declare for A4 Landscape
I'm currently converting some legacy code to create PDF files using iTextSharp. We're creating
I create a PDF file using iTextSharp and it's stored in my system desktop
I am trying to create Landscape PDF using iTextSharp but It is still showing
Using iTextSharp (and c#/ASP.NET) is it possible to open an RTF document, manipulate it

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.