Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

PDF with java

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I generated a pdf file using itext library . I want to change the font type , style , size , color and so on in the table inside that pdf file.In general i want to change everything in any table inside the generated pdf file from java.
Thank you very much for your help
 
Saloon Keeper
Posts: 7173
166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's just about impossible to change layout and formatting once a PDF has been generated. It's much easier to recreate the PDF from scratch with the correct formatting.
 
MohamedAhmed Ibrahim
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can format every thing in the pdf file but i cannot format the table inside it
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

MohamedAhmed Ibrahim wrote:I can format every thing in the pdf file but i cannot format the table inside it


You can reformat everything after the PDF is generated?
 
MohamedAhmed Ibrahim
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to format the tables in java code , how can i do that ?
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

MohamedAhmed Ibrahim wrote:I need to format the tables in java code , how can i do that ?


Seems to me that you need to search the iText API documentation. Or find an iText forum and ask these questions there.

Winston
 
Tim Moores
Saloon Keeper
Posts: 7173
166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

MohamedAhmed Ibrahim wrote:I can format every thing in the pdf file but i cannot format the table inside it


Do you mean after the fact? Initially it's certainly possible to format everything in a PDF, including table contents, in any way you like.
 
MohamedAhmed Ibrahim
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not know if i was not clear enough .
I need to format the tables in pdf file generated by java using itext library. I can not change the font style or size of the table or anything related with the table
 
Ranch Hand
Posts: 155
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try This mY friend. It defines the Font type and the Size you want to use even in the Table.
Font f4 = new Font(Font.NORMAL, 13, Font.BOLD);
f4.setColor(new java.awt.Color(0, 61, 126));
Paragraph p4 = new Paragraph(firstline, f4);
p4.setAlignment(Element.TABLE);
PdfPTable table = new PdfPTable(1);
table.setWidthPercentage(100);
PdfPCell cell = new PdfPCell();
cell.setBorder(Rectangle.BOTTOM);
cell.setBorderWidthBottom(1f);
cell.setUseBorderPadding(true);
cell.setPadding(0);
cell.setBorderColor(new java.awt.Color(0, 61, 126));
cell.addElement(p4);
table.addCell(cell);

output.add(table);
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic