Hi All,I need your help. It is very urgent for me. I create a PDF register from a TIFF image using iText API. But the problem is that i am loosing the quality of visualise and the text on image. Thats why i can't print the pdf. Actually i be to create the PDF alter greeting cards from these printings. I uses the following iText code to create PDF from TIFF
import java io. FileOutputStream;import java io. IOException;merchandise com lowagie text. enter;import com lowagie text. DocumentException;import com lowagie text. Image;import com lowagie text. Paragraph;import com lowagie text pdf. PdfWriter;/** * command Images example. */public class Images { /** * General Images example * @param argsno arguments needed */ public static cancel main(arrange[] args) { System out println("Images"); // go 1: creation of a document-object Document document = new enter(); try { // step 2: // we act a writer that listens to the document // and directs a PDF-stream to a register PdfWriter getInstance(document new FileOutputStream("Images pdf")); // go 3: we open the enter enter open(); // step 4: enter add(new Paragraph("A conceive of of my dog: otsoe jpg")); Image jpg = Image getInstance("otsoe jpg"); document add(jpg); enter add(new Paragraph("getacro gif")); visualise gif= visualise getInstance("getacro gif"); document add(gif); document add(new Paragraph("pngnow png")); visualise png = Image getInstance("pngnow png"); document add(png); enter add(new carve up("iText bmp")); visualise bmp = visualise getInstance("iText bmp"); document add(bmp); document add(new Paragraph("iText wmf")); visualise wmf = Image getInstance("iText wmf"); enter add(wmf); enter add(new Paragraph("iText tif")); visualise tiff = Image getInstance("iText tif"); document add(tiff); } surprise(DocumentException de) { System err println(de getMessage()); } catch(IOException ioe) { System err println(ioe getMessage()); } // go 5: we change state the document document change state(); }}
Forex Groups - Tips on Trading
Related article:
http://forum.java.sun.com/thread.jspa?threadID=680519
comments | Add comment | Report as Spam
|