Merges all pdfs in the given array into One. Enlarging the first Pdf in Array.

@param string[]|Pdf[] $pdfs Each element could be PDF path or Pdf Object.

@return Pdf the PDF
497117
public function merge(array $pdfs = array())
    {
        $outPdf = $this->getPdfInstance(array_shift($pdfs));
        
        foreach ($pdfs as $pdf) {
            $outPdf->importPdf($pdf, ($pdf instanceof Pdf));
        }
        return $outPdf;
    }
258069
public function merge(string $pr, array $params = [])
    {
        $path = $this->buildPullRequestsPath($pr, 'merge');

        return $this->post($path, $params);
    }
240626
public function addDocuments($documents)
    {
        $update = $this->client->createUpdate();
        $update->addDocuments($documents);
        return $this->createAndExecuteRequest($update);
    }
1123359
protected function mergeOptions(array $options)
    {
        $merged = [];
        foreach ($this->supportedOptions() as $option) {
            $merged[$option] = $this->mergeOption($option, $options);
        }

        return $merged;
    }
560988
public function merge($elements = []): NodeList {
        if (!is_array($elements)) {
            $elements = $elements->toArray();
        }

        return $this->newNodeList(array_merge($this->toArray(), $elements));
    }
745661
public function mergeArguments(array $arguments)
    {
        foreach ($arguments as $key => &$value) {
            $this->arguments[$key] = &$value;
        }

        return $this;
    }
1213311
def merge(self, pdf_files, output):
        """"""
        if self.method is 'pypdf3':
            return self.pypdf3(pdf_files, output)
        else:
            return self.pdfrw(pdf_files, output)
1160272
public static void mergePdf(File[] inputPdfFiles, File outputPdfFile) {
        try {
            PDFMergerUtility mergerUtility = new PDFMergerUtility();
            mergerUtility.setDestinationFileName(outputPdfFile.getPath());
            for (File inputPdfFile : inputPdfFiles) {
                mergerUtility.addSource(inputPdfFile);
            }
            mergerUtility.mergeDocuments(MemoryUsageSetting.setupMainMemoryOnly());
        } catch (IOException ioe) {
            logger.error("Error counting PDF pages => " + ioe);
        }
    }
1086098
public function merge( array $attributes ) {
		foreach ( $attributes as $name => $value ) {
			$this->set_attribute( $name, $value );
		}

		return $this;
	}
838814
public function merge(array $logics)
    {
        foreach($logics as $name => $specs) {
            $this->set($name, $specs);
        }

        return $this;
    }
1294069
protected function mergeAttributes(array $attributes)
    {
        foreach ($this->merged as $resource) {
            $attributes = array_replace_recursive($attributes, $resource->getAttributes());
        }

        return $attributes;
    }
954592
public static function combine(string ... $paths) : string
    {
        $paths = array_map([__CLASS__, 'normalize'], $paths);

        $paths = array_filter($paths, function ($path) {
            return trim($path, DIRECTORY_SEPARATOR) !== '.';
        });

        $combinedPath = implode(DIRECTORY_SEPARATOR, $paths);

        return self::stringReplaceIgnoringStreamWrapper(
            DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR,
            DIRECTORY_SEPARATOR,
            $combinedPath
        );
    }
1032202
protected function mergeTrees(array $trees): array
    {
        if (count($trees) == 0) {
            return [];
        }

        $tree1 = array_shift($trees);
        while (count($trees)) {
            $tree2 = array_shift($trees);
            foreach ($tree2 as $key => $value) {
                if (in_array($key, $this->permissionKeys)) {
                    $tree1 = $tree2;
                    break;
                }
                if (isset($tree1[$key]) && is_array($value)) {
                    $tree1[$key] = $this->mergeTrees([$tree1[$key], $tree2[$key]]);
                    continue;
                }
                $tree1[$key] = $value;
            }
        }

        return $tree1;
    }
65008
public function union($dals) {
		if(!is_array($dals))
			$dals = [$dals];
		$this->unions = array_merge($this->unions, $dals);

		return $this;
	}
156232
protected function mergeConfigs(array $configs)
    {
        $merged = array();
        foreach ($configs as $config) {
            $merged = array_merge($merged, $config);
        }

        return $merged;
    }
973881
public function mergeUserOptions(array $options) {
    foreach ($options as $option=>$value)
      $this->_options[$option] = $value;
    return $this;
  }
616730
public function merge($outputmode = 'browser', $outputpath = 'newfile.pdf') {
        if (!isset($this->_files) || !is_array($this->_files)) {
            throw new Exception("No PDFs to merge.");
        }

        $fpdi = new FPDI;

        // merger operations
        /* @var $file PdfObject */
        foreach ($this->_files as $file) {
            $filename = $file->path;
            $filepages = $file->pages;

            $count = $fpdi->setSourceFile($filename);

            //add the pages
            if ($filepages == 'all') {
                for ($i = 1; $i <= $count; $i++) {
                    $template = $fpdi->importPage($i);
                    $size = $fpdi->getTemplateSize($template);

                    $fpdi->AddPage($file->getOrientationCode(), array($size['width'], $size['height']));
                    $fpdi->useTemplate($template);
                }
            } else {
                foreach ($filepages as $page) {
                    if (!$template = $fpdi->importPage($page)) {
                        throw new Exception("Could not load page '$page' in PDF '$filename'. Check that the page exists.");
                    }
                    $size = $fpdi->getTemplateSize($template);

                    $fpdi->AddPage($file->getOrientationCode(), array($size['w'], $size['h']));
                    $fpdi->useTemplate($template);
                }
            }
        }

        //output operations
        $mode = $this->_switchmode($outputmode);

        if ($mode == 'S') {
            return $fpdi->Output($outputpath, 'S');
        } else {
            if ($fpdi->Output($outputpath, $mode) == '') {
                return true;
            } else {
                throw new Exception("Error outputting PDF to '$outputmode'.");
                return false;
            }
        }
    }