Hi Ulf,
Thank you for the information.
I tried the example to convert a tif file into PDF.
However the generated PDF file contains only a part of the Tif file.
Are there any specific parameters that we need to take care of inroder to preserve the tif image information.
Following is the snippet of code:
import java.io.FileOutputStream;
import java.io.IOException;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Image;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;
public class TiffToPDFConversion {
public static void main(
String[] args) {
System.out.println("Images");
// 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("D:\\!Anup\\Project\\iText\\Temp\\Images.pdf"));
// step 3: we open the document
document.open();
// step 4:
document.add(new Paragraph("iText.tif"));
Image tiff = Image.getInstance("D:\\!Anup\\Project\\iText\\Temp\\iText.tif");
document.add(tiff);
} catch (DocumentException de) {
System.err.println(de.getMessage());
}
catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
// step 5: we close the document
document.close();
}
}