title: iText InvalidPdfException Rebuild failed: '>' not expected at file pointer
body: <p>We're trying to concatenate many dynamically generated pdf together using PdfSmartCopy as follow </p>
  
  <pre><code>    Document document = new Document();
      PdfCopy copy = new PdfSmartCopy(document, outputStream);
  
      document.open();
  
      for (PdfReader reader : list) {
           int n = reader.getNumberOfPages();
          // page numbers start at 1
          for (int page = 1; page &lt;= n; page++) {
              copy.addPage(copy.getImportedPage(reader, page));
          }
  
          copy.freeReader(reader);
          reader.close();
      }
  
      document.close();
  </code></pre>
  
  <p>Once in a while, we keep getting this exception <code>InvalidPdfException: Rebuild failed: '&gt;' not expected at file pointer 65537; Original message: Invalid object number. at file pointer</code></p>
  
  <p>Or <code>InvalidPdfException: Rebuild failed: Dictionary key 0 is not a name. at file pointer 65536</code> </p>
  
  <p>Have anyone encountered this before? </p>