@@ -0,0 +1,1132 @@
+/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage pdf;%0A%0A/**%0A *%0A * @author Floriane%0A */%0Aimport org.apache.pdfbox.pdmodel.*;%0A//import org.apache.pdfbox.pdmodel.graphics.PDXObject;%0Aimport org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;%0Aimport java.io.*;%0A %0Apublic class JPG%7B%0A    %0A     //Marche avec les images de types JPG, TIFF (only G4 compression), PNG, BMP and GIF%0A    public static void main(String%5B%5D args) %7B%0A        PDDocument doc = null;%0A        try%7B%0A%0A         doc = new PDDocument();%0A         PDPage page = new PDPage();%0A         doc.addPage(page);%0A         %0A         PDImageXObject image = null;%0A         %0A         image = PDImageXObject.createFromFile(%22image.jpg%22, doc);%0A         %0A         PDPageContentStream content = new PDPageContentStream(doc, page);%0A %0A%0A         content.drawImage(image,20,20);%0A         content.close();%0A        %0A        doc.save(%22ImageNowPdf.pdf%22);%0A       %0A        %7D catch (Exception e)%7B%0A             System.out.println(%22Exception%22);%0A        %7D%0A    %7D%0A%7D

Test image