docs: public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
          //get Ghostscript instance
          Ghostscript gs = Ghostscript.getInstance();
  
          //prepare Ghostscript interpreter parameters
          //refer to Ghostscript documentation for parameter usage
          //gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf
          List<String> gsArgs = new ArrayList<String>();
          gsArgs.add("-gs");
          gsArgs.add("-dNOPAUSE");
          gsArgs.add("-dQUIET");
          gsArgs.add("-dBATCH");
          gsArgs.add("-sDEVICE=pdfwrite");
          gsArgs.add("-sOutputFile=" + outputPdfFile.getPath());
  
          for (File inputPdfFile : inputPdfFiles) {
              gsArgs.add(inputPdfFile.getPath());
          }
  
          //execute and exit interpreter
          try {
              synchronized (gs) {
                  gs.initialize(gsArgs.toArray(new String[0]));
                  gs.exit();
              }
          } catch (UnsatisfiedLinkError e) {
              logger.error(e.getMessage());
              throw new RuntimeException(getMessage(e.getMessage()));
          } catch (NoClassDefFoundError e) {
              logger.error(e.getMessage());
              throw new RuntimeException(getMessage(e.getMessage()));
          } catch (GhostscriptException e) {
              logger.error(e.getMessage());
              throw new RuntimeException(e.getMessage());
          } finally {
              //delete interpreter instance (safer)
              try {
                  Ghostscript.deleteInstance();
              } catch (GhostscriptException e) {
                  //nothing
              }
          }
      }