Skip to content
Snippets Groups Projects
Select Git revision
  • e37ded52f9439b049e378e63f28f5f1bb7f14cb1
  • master default protected
  • release_3.0.0
  • test
  • feature_pre_sql
  • develop
  • 3.0.1
  • 3.0.0
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.3.7
  • 1.3.6
  • 1.3.5
  • 1.3.4
  • 1.3.3
  • 1.3.2
  • 1.3.1
  • 1.3.0
  • 1.2.6
  • 1.2.5
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
26 results

development.config.php.dist

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    PdfMergeShellCommandQpdf.php 974 B
    <?php
    
    namespace UnicaenPdf\Command;
    
    use UnicaenPdf\Command\PdfMergeShellCommandInterface;
    use UnicaenShell\Command\ShellCommand;
    
    /**
     * Commande de concaténation de N fichiers PDF.
     *
     * Version utilisant 'qpdf'.
     */
    final class PdfMergeShellCommandQpdf extends ShellCommand implements PdfMergeShellCommandInterface
    {
        public function getName(): string
        {
            return 'MergeShellCommandQpdf';
        }
    
        public function checkRequirements(): void
        {
            $this->assertExecutableExists();
        }
    
        public function generateCommandLine()
        {
            // Commande de fusion (cf. https://qpdf.readthedocs.io/en/10.5/cli.html#page-selection-options)
            $command = $this->executable .
                sprintf(' --warning-exit-0 %s --pages . %s -- %s',
                    array_shift($this->inputFilesPaths),
                    implode(' ', $this->inputFilesPaths),
                    $this->outputFilePath
                );
    
            $this->commandLine = $command;
        }
    }