title: Editing existing pdf in Java
body: <p>I'm testing Java lib to edit existing pdf but the issue is that a can't load my existing pdf.
  I have the same result with iText and pdfbox, I can load the file the data seems here(pdf weigh ko) but the pdf created is empty (nothing display).</p>
  
  <p>I'm doing it on a app engine server, with the two lib I can create pdf and display it in my browser with servlet or webservice.</p>
  
  <p>I'm totaly lost, try tons of code but always the same result!</p>
  
  <p>iText with importedPage :</p>
  
  <pre><code>    Document document = new Document();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      PdfWriter docWriter = PdfWriter.getInstance(document, baos);
      document.open();
  
      // Load existing PDF
      PdfReader reader = new PdfReader("WEB-INF/pdf.pdf");
      document.newPage();
      PdfImportedPage page = docWriter.getImportedPage(reader, 1);
      PdfPTable table = new PdfPTable(2);
      table.addCell(Image.getInstance(page));
      document.add(table);
  
      document.close();
      docWriter.close();
  </code></pre>
  
  <p>pdfbox : </p>
  
  <pre><code>     PDDocument document = new PDDocument();
       PDDocument sourceDocument = PDDocument.load("WEB-INF/pdf.pdf");
       PDPage templatePdfPage = (PDPage)sourceDocument.getDocumentCatalog().getAllPages().get(0);
       document.addPage(templatePdfPage);
       document.save(output);
  </code></pre>