OutputStream os = image.getPDStream().createOutputStream();
InputStream is = ximage.getPDStream().createInputStream();
boolean endOfFile = false;
int loopCount = 0;
while(!endOfFile) {
if(is.read() > -1) {
os.write(is.read());
loopCount++;
}
else endOfFile = true;
}
Why can´t I copy the value from an input stream to an output stream? Is
there some kind of block on pdf? Cause the is.read() method always return
-1.
But with contentStream.drawXObject(ximage, coordinates[0],coordinates[1],
size[0], size[1]); I can draw it, I mean, there is data on the inputStream.
Or I´m not getting how pdfbox works.