Class PdfMergeSource


  • public final class PdfMergeSource
    extends java.lang.Object
    One source PDF added to a PdfMerger, and the page range selected from it. Returned by PdfMerger.addSource(byte[]); call selectPages(java.lang.String) on it directly.

    Thread-safety: safe to hand off to another thread (e.g. the thread that called addSource(...) passing this instance to a different thread that then calls selectPages(...)) -- the page selection is published via a volatile field, so a later mergeToBytes() call on any thread sees it correctly.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PdfMergeSource selectPages​(java.lang.String pageRange)
      Selects which pages of this source to include in the merged output, and in what order -- e.g.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • selectPages

        public PdfMergeSource selectPages​(java.lang.String pageRange)
                                   throws PdfMergeException
        Selects which pages of this source to include in the merged output, and in what order -- e.g. "2-5,8,10-12" (1-based, matching how page ranges are normally described to a human). May be called again to replace a previous selection.
        Throws:
        PdfMergeException