title: Error: Header doesn't contain versioninfo
body: <p>I'm trying to create some pdf pages on the fly and merging them using PDFBox PDFMergerUtility. Basically I've set of documents to be merged and now I want to add a cover page at the top with some dynamic text and image.</p>
  <pre><code>PDFMergerUtility ut = new PDFMergerUtility();
  
          // Creating PDF document object
          PDDocument document = new PDDocument();
  
          PDPage blankPage = new PDPage();
          // Adding the blank page to the document
          document.addPage(blankPage);
  
          // Start a new content stream which will &quot;hold&quot; the to be created content
          PDPageContentStream contentStream = new PDPageContentStream(document, blankPage);
  
          // Define a text content stream using the selected font, moving the cursor and
          // drawing the text &quot;Hello World&quot;
          contentStream.beginText();
          // Setting the font to the Content stream
          contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);
  
          // Setting the position for the line
          contentStream.newLineAtOffset(25, 500);
  
          String text = &quot;This is the sample document and we are adding content to it.&quot;;
  
          // Adding text in the form of string
          contentStream.showText(text);
          contentStream.endText();
  
          // Make sure that the content stream is closed:
          contentStream.close();
  
          ut.addSource(document.getPage(0).getContents());
  
      
          // Save the merged pdf to outputstream
          ByteArrayOutputStream destStream = new ByteArrayOutputStream();
          ut.setDestinationStream(destStream);
          ut.mergeDocuments(MemoryUsageSetting.setupTempFileOnly());
  </code></pre>
  <p>But I'm getting following error:</p>
  <pre><code>java.io.IOException: Error: Header doesn't contain versioninfo
          at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:175)
          at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:154)
          at org.apache.pdfbox.Loader.loadPDF(Loader.java:456)
          at org.apache.pdfbox.Loader.loadPDF(Loader.java:377)
          at org.apache.pdfbox.multipdf.PDFMergerUtility.legacyMergeDocuments(PDFMergerUtility.java:457)
          at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:355)
          at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:339)
          at com.iof.services.AuditDocumentService.mergeAttachments(AuditDocumentService.java:210)
          at com.iof.services.AuditDocumentService.downloadAuditDocument(AuditDocumentService.java:118)
          at com.iof.services.AuditDocumentService.lambda$0(AuditDocumentService.java:95)
          at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
          at com.iof.services.AuditDocumentService.downloadAuditDocument(AuditDocumentService.java:85)
          at com.iof.schedulers.AuditDocumentScheduler.downloadAuditDocument(AuditDocumentScheduler.java:17)
          at jdk.internal.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:568)
          at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
          at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
          at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
          at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
          at java.base/java.lang.Thread.run(Thread.java:833)
  </code></pre>
  <p>Can someone help me with what I'm doing wrong?</p>