Solved

how to write coloum names in vertical format in pdf

Posted on 2011-02-23
3
628 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
  • 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 250 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

803 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