pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: CMYK images
Date Fri, 24 Feb 2017 18:17:29 GMT
Am 24.02.2017 um 19:05 schrieb Max Rietmeijer | Add to Favorites:
> Worked like a charm. Great! 


The image was swallowed again (mailing list security policy), but I 
believe you :-)


That was some quick code, it reads the file twice. For production you 
may want store it in a ByteArrayOutputStream / input stream like it is 
done in the source code of PDJPegFactory.


It won't work with jai_imageio but this could be done if needed, with 
code like this:


                 ImageInputStream iis = ImageIO.createImageInputStream(f);
                 ImageReader reader = 
ImageIO.getImageReadersByFormatName("JPEG").next();
                 reader.setInput(iis);
                 Raster raster = reader.readRaster(0, null);


The raster can tell the width/height.


Tilman


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message