aspose file tools*
The moose likes General Computing and the fly likes java.io.IOException: Write error  at PdfFileSpecification Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "java.io.IOException: Write error  at PdfFileSpecification" Watch "java.io.IOException: Write error  at PdfFileSpecification" New topic
Author

java.io.IOException: Write error at PdfFileSpecification

ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 59

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.io.IOException: Write error at PdfFileSpecification
 
Similar Threads
Tiff to Pdf conversion
Converting TIFF to PDF
Display a Chart from a Servlet to JSP
TIFF. DOC, EXCEL to PDF Converter
exception