File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 60

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: java.io.IOException: Write error at PdfFileSpecification