?
Solved

how to write coloum names in vertical format in pdf

Posted on 2011-02-23
3
Medium Priority
?
654 Views
Last Modified: 2013-11-23
I am using pdf for printing.. I have many coloums hence the width of each coloum is less.
Therefore the coloum name doesnt fit properly in the coloum.
To avoid this I want to print it in vertical format. Can anyone suggest any solution for this??
0
Comment
Question by:Aurii
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:Dejan Pažin
ID: 34960240

Here is an example from the book:

http://itextpdf.com/examples/iia.php?id=202

0
 
LVL 17

Accepted Solution

by:
Dejan Pažin earned 1000 total points
ID: 34960266

Forget the above example, this is what you need:

PdfPCell cell = new PdfPCell(new Phrase("Table Header 1"));
cell.setRotation(90);
0
 

Author Comment

by:Aurii
ID: 34960373
I refered the link ..how to implement it in my code

           Document document = new Document(PageSize.A4.rotate());
            PdfWriter.getInstance(document, new FileOutputStream("C:/Reports/Voucher"+i9+".pdf"));
            document.open();
           
           float[] width = {0.5f, 0.5f, 0.5f,1.0f,2.0f,2.5f,0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f};
            PdfPTable table = new PdfPTable(width);
            table.setWidthPercentage(100);
          
          PdfPCell cell = new PdfPCell(new Phrase("UkEkquk ua 8  vkdkj.kh ;knhpk mrkjk", FontFactory.getFont("k30", BaseFont.CP1257, BaseFont.EMBEDDED, 26, Font.BOLD)));
           
            cell.setHorizontalAlignment(Element.ALIGN_CENTER);
            cell.setBorderWidth(0);
            cell.setColspan(14);
            cell.setUseDescender(true);
            table.addCell(cell);
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question