How do I make my picture an avatar?
can you tell us your solution to the table data width issue
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Опросы
• Аватарки
• Интересы
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > Java Programming > can you tell us your solution to the table data width issue 4 сентября 2008 г. 19:12:24

  Top users: 
  Рейтинг сообществ: 
  Advertising:
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:

can you tell us your solution to the table data width issue

Guest 7 марта 2006 г. 17:36:15
 can you tell us your solution to the table data width issue
Add comment
Guest 8 мая 2008 г. 12:21:11 permanent link ]
 Hi, i am using iText,
for converting html to pdf.

the solution works fine if html file length is small.
but for large html file or complex ones its giving
error - "Stack Empty"....

could find any clue, after searching on net...

any help would be appreciable..

Thanks in advance.
Add comment
salvadi 10 июня 2008 г. 06:42:32 permanent link ]
 you can use Itext.jar file which is available free in net and generate the pdf from an html or servlet or jsp?
Add comment
salvadi 10 июня 2008 г. 06:44:37 permanent link ]
 Hi Venkat,

You can use itext.jar which is freely available in net .by using it we can generate pdf from html or jsp or servlet.I have tried the similar think using servlet.
Add comment
salvadi 10 июня 2008 г. 06:47:50 permanent link ]
 Hi all,

I have a problem while using itext for creating a pdf from database using servlet.While iam trying to open it 2nd time is is giving me error that the document has been closed you canot add any elements.
This is because i have closed the 1st window.Please can any one provide me the solution for it.

Thanks In Advance...:-D­

Add comment
Guest 4 сентября 2008 г. 19:11:03 permanent link ]
 package pdfConverter;
/**
*@author Syed Muhammad Aizaz Haider
*/

import java.io.*;
import com.lowagie.text.*;­
import com.lowagie.text.pd­f.BaseFont;
import com.lowagie.text.pd­f.PdfWriter;
public class Converter {
public static void main (String pdf[]){
System.out.println(­"This is some text to be converted");
Document doc = new Document();
try{

PdfWriter writer = PdfWriter.getInstan­ce(doc, new FileOutputStream("R­ESULT.pdf"));
doc.open();
BaseFont embeded = BaseFont.createFont­("C:\\Windows\\Fonts­\\comic.ttf",BaseFon­t.CP1250,BaseFont.EM­BEDDED);
Font font = new Font(embeded,35);
font.setColor(25, 254, 75);
doc.add(new Paragraph("Hello World",font));
doc.add(new Paragraph("Syed Muhammad Aizaz Haider Zaidee the Prince !!!",font));
doc.add(new Paragraph("abc.jpg"­));
doc.newPage();
Image img = Image.getInstance("­abc.jpg");
System.out.println(­img.getClass().getNa­me());
doc.add(img);

}catch(Exception ex){
ex.printStackTrace(­);
}
doc.close();
}

}
Add comment
Guest 4 сентября 2008 г. 19:11:51 permanent link ]
 package pdfConverter;
/**
*@author Syed Muhammad Aizaz Haider
*/
import com.lowagie.text.*;­
import com.lowagie.text.pd­f.*;
import java.io.*;
public class FilesizeCompression­ {




public static void main(String[] args) {
System.out.println(­"Chapter 8: example FileSizeComparison"­);
System.out.println(­"-> Creates a PDF file with a font that is not embedded");
System.out.println(­" and compared it with files that have the font embedded.");
System.out.println(­"-> jars needed: iText.jar");
System.out.println(­"-> resources needed: c:/windows/fonts/co­mic.ttf");
System.out.println(­"-> file generated: font__not_embedded.­pdf");
System.out.println(­" file generated: font_embedded1.pdf"­);
System.out.println(­" file generated: font_embedded2.pdf"­);

// step 1
Document document1 = new Document();
Document document2 = new Document();
Document document3 = new Document();
try {
// step 2
PdfWriter.getInstan­ce(document1, new FileOutputStream(
"font_not_embedded.­pdf"));
PdfWriter.getInstan­ce(document2, new FileOutputStream(
"font_embedded1.pdf­"));
PdfWriter.getInstan­ce(document3, new FileOutputStream(
"font_embedded2.pdf­"));

// step 3: we open the document
document1.open();
document2.open();
document3.open();
// step 4:
BaseFont bf_not_embedded = BaseFont.createFont­(
"c:/windows/fonts/c­omic.ttf", BaseFont.CP1252,
BaseFont.NOT_EMBEDD­ED);
BaseFont bf_embedded = BaseFont.createFont­(
"c:/windows/fonts/c­omic.ttf", BaseFont.CP1252,
BaseFont.EMBEDDED);­
Font font_not_embedded = new Font(bf_not_embedde­d, 12);
Font font_embedded = new Font(bf_embedded, 12);

document1.add(new Paragraph(
"This is document1 with ",
font_not_embedded))­;
document2.add(new Paragraph(
"quick brown fox jumps over the lazy dog", font_embedded));
document3.add(new Paragraph(
"ooooo ooooo ooo ooooo oooo ooo oooo ooo", font_embedded));
} catch (DocumentException de) {
System.err.println(­de.getMessage());
} catch (IOException ioe) {
System.err.println(­ioe.getMessage());
}

// step 5: we close the document
document1.close();
document2.close();
document3.close();
RandomAccessFileOrA­rray file;
try {
file = new RandomAccessFileOrA­rray("font_not_embed­ded.pdf");
System.out.println(­"Size font_not_embedded.p­df: " + file.length());
file = new RandomAccessFileOrA­rray("font_embedded1­.pdf");
System.out.println(­"Size font_embedded1.pdf:­ " + file.length());
file = new RandomAccessFileOrA­rray("font_embedded2­.pdf");
System.out.println(­"Size font_embedded2.pdf:­ " + file.length());
} catch (IOException e) {
e.printStackTrace()­;
}
}

}
Add comment
Guest 4 сентября 2008 г. 19:12:24 permanent link ]
 package pdfConverter;
/**
*@author Syed Muhammad Aizaz Haider
*/
import java.io.FileOutputS­tream;

import com.lowagie.text.*;­
import com.lowagie.text.ht­ml.HtmlParser;
import com.lowagie.text.pd­f.PdfWriter;


public class HtmlSnippet {

/**
* Generates a PDF file with the text 'Hello World'
*
* @param args
* no arguments needed here
*/
public static void main(String[] args) {

Document document = new Document();
try {
PdfWriter.getInstan­ce(document, new FileOutputStream("h­tml1.pdf"));
HtmlParser.parse(do­cument, "list.html");
} catch (Exception e) {
e.printStackTrace()­;
}
}
}
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > Java Programming > can you tell us your solution to the table data width issue 4 сентября 2008 г. 19:12:24

see also:
pass tests:
..
see also:
Кто великий математик? слабо решить?
Фууууутбол!!!!! Болеем за Россию)))...
Продаю Классные Авы)))))) Не…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .