/** * Creates a new JPEG Image XObject from an input stream containing JPEG data. * * The input stream data will be preserved and embedded in the PDF file without modification. * @param document the document where the image will be created * @param stream a stream of JPEG data * @return a new Image XObject * * @throws IOException if the input stream cannot be read */ public static PDImageXObject createFromStream(PDDocument document, InputStream stream) throws IOException { return createFromByteArray(document, IOUtils.toByteArray(stream)); }
return JPEGFactory.createFromByteArray(document, byteArray);
/** * Creates a new JPEG Image XObject from an input stream containing JPEG data. * * The input stream data will be preserved and embedded in the PDF file without modification. * @param document the document where the image will be created * @param stream a stream of JPEG data * @return a new Image XObject * * @throws IOException if the input stream cannot be read */ public static PDImageXObject createFromStream(PDDocument document, InputStream stream) throws IOException { return createFromByteArray(document, IOUtils.toByteArray(stream)); }
/** * Creates a new JPEG Image XObject from an input stream containing JPEG data. * * The input stream data will be preserved and embedded in the PDF file without modification. * @param document the document where the image will be created * @param stream a stream of JPEG data * @return a new Image XObject * * @throws IOException if the input stream cannot be read */ public static PDImageXObject createFromStream(PDDocument document, InputStream stream) throws IOException { return createFromByteArray(document, IOUtils.toByteArray(stream)); }
return JPEGFactory.createFromByteArray(document, byteArray);
return JPEGFactory.createFromByteArray(document, byteArray);