List of usage examples for com.itextpdf.text Jpeg Jpeg
public Jpeg(byte[] img) throws BadElementException, IOException
Jpeg
-object from memory. From source file:edu.clemson.lph.pdfgen.MergePDF.java
License:Open Source License
/** * This method is very specific to JPG images of CVIs. Assumes them to be letter sized * and landscape orientation. Other sizes will be scaled to fit. * @param jpgBytes byte[] with the contents of a jpg file. * @return//from w w w . java 2 s. com */ public static byte[] jpgToPdfBytes(byte jpgBytes[]) { try { Image jpgImage = new Jpeg(jpgBytes); return imageToPdfBytes(jpgImage); } catch (IOException e) { logger.error(e); } catch (BadElementException e) { logger.error(e); } return null; }