Examples of PDFMergerUtility


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

Examples of org.pdfbox.util.PDFMergerUtility

        if ( args.length < 3 )
        {
            usage();
        }

        PDFMergerUtility merger = new PDFMergerUtility();
        for( int i=0; i<args.length-1; i++ )
        {
            sourceFileName = args[i];
            merger.addSource(sourceFileName);
        }
       
        destinationFileName = args[args.length-1];
       
        merger.setDestinationFileName(destinationFileName);
       
        merger.mergeDocuments();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.