Pessoal, to precisando gerar arquivos em pdf com java, e fiquei muito feliz ao ver um artigo no guj, contudo o link não existe mais
http://www.guj.com.br/java.tutorial.artigo.153.1.guj
Alguém sabe, tem o tutorial, sobre como fazer isso?
Obrigado
Pessoal, to precisando gerar arquivos em pdf com java, e fiquei muito feliz ao ver um artigo no guj, contudo o link não existe mais
http://www.guj.com.br/java.tutorial.artigo.153.1.guj
Alguém sabe, tem o tutorial, sobre como fazer isso?
Obrigado
Use o iText.
Procure nas revistas javamagazine e mundojava pois já foram publicadas matérias a respeito disso.
use o ireport para modelar como vai ser o docto .pdf e use o jasper para gerar!
Vou procurar sobre o iText, obrigado
Se alguém se interessou aki ta um tutorial
http://itextdocs.lowagie.com/examples/com/lowagie/examples/general/HelloWorld.java
E aqui os jars
http://www.lowagie.com/iText/download.html
finotti, é possível gerar pdf de imagem? Vc sabe?
Samuel
Obrigado furutani, mas eu consegui pessoal, dentro do pacote com.lowagie.text tem uma classe Image, e é só fazer isso:
* $Id: HelloWorld.java,v 1.7 2006/09/14 22:52:47 xlv Exp $
package com.lowagie.examples.general;
import java.io.FileOutputStream;
/**
* Generates a simple 'Hello World' PDF file.
*
* @author blowagie
*/
public class GeneratePDF {
/**
* Generates a PDF file with the text 'Hello World'
*
* @param args no arguments needed here
*/
public static void main(String[] args) {
System.out.println("Hello World");
// step 1: creation of a document-object
Document document = new Document();
try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.getInstance(document,
new FileOutputStream("imagem.pdf"));
// step 3: we open the document
document.open();
// step 4: we add a paragraph to the document
document.add(new Paragraph("Inserindo Imagem"));
Image i = Image.getInstance("image/find.png");
document.add(i);
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
// step 5: we close the document
document.close();
}
}