Hi,
i am getting java.io.IOException: Write error at PdfFileSpecification. please help me on this,
RandomAccessFileOrArray myTifFile = new RandomAccessFileOrArray(file);
int numberOfPages = TiffImage.getNumberOfPages("D://myTifFile.tif");
FileOutputStream os=new FileOutputStream("D://mypdffile.pdf");
com.itextpdf.text.Document TifftoPDF=new com.itextpdf.text.Document();
PDFWriter writer = PDFwriter.getInstance(TifftoPDF, os);
writer.setStrictImageSequence(true);
TifftoPDF.open();
for(int tiffImageCounter = 1;tiffImageCounter <= numberOfPages;tiffImageCounter++) {
com.itextpdf.text.Image img = TiffImage.getTiffImage(myTifFile, tiffImageCounter);
Rectangle pageSize = new Rectangle(img.getWidth(),
img.getHeight());
TifftoPDF.setPageSize(pageSize);
TifftoPDF.newPage();
TifftoPDF.add(img);
}
TifftoPDF.close();
TifftoPDF.toString();
PdfFileSpecification.fileEmbedded(writer, "D://mypdffile.pdf", null, null, true, "applications/pdf", null);
Thanks,
Ramesh