Hello José,
I don't know much about image handling in PDF... But it looks like it
only handles JPEG or PNG.
If you want to embed images from another format, you first have to
convert it.
Thought I'm not familiar with this task so you'll have to take a look
on tools capable of this task.
Julien PLÉE
7 Avenue Barthélemy Salettes et Jean-Marie Manset
31320 Castanet-Tolosan
France
+33 6.50.00.60.48
Le 14 oct. 10 à 14:59, José Rodolfo Carrijo de Freitas a écrit :
On Aug 28, Julien Plée posted a solution to overwrite an image, it
seems to
work perfectly.
But there is a problem with tiff images, maybe because with tiff we
should
use RandomAccessFile.
Have someone made a hack so that the solution can be extended to tiff
images?
InputStream newStream = new FileInputStream(inFile);
OutputStream embeddedStream =
im.getCOSStream().createFilteredStream();
int bSize = 10240;
byte[] b = new byte[bSize];
int bytesRead = 0;
while ((bytesRead = newStream.read(b, 0,
bSize)) > -1) {
embeddedStream.write(b, 0,
bytesRead);
}
embeddedStream.close();