Package org.apache.pdfbox.util

Examples of org.apache.pdfbox.util.PDFMergerUtility


  @Override
  public InputStream merge(final InputStream[] sources) {
    try {
      Assert.notEmpty(sources, "sources");

      PDFMergerUtility merger = new PDFMergerUtility();
      for (InputStream source : sources) {
        merger.addSource(source);
      }

      ByteArrayOutputStream bos = new ByteArrayOutputStream();

      merger.setDestinationStream(bos);
      merger.mergeDocuments();

      ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());

      return bis;
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.util.PDFMergerUtility

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.