-2

here is the code.... it is not able to merge two pdf files ...can anyone find what the problem is in the code... thanks for ur time....

user813995
  • 7
  • 1
  • 4

1 Answers1

1

You're using the wrong syntax.

Right code should looks like such this:

// prepare command escaping paths of your files
$parts = '';
foreach( array( 'file1.pdf', 'file2.pdf' ) as $part )
    $parts .= escapeshellarg( $part ) . ' ';

// build command
$command = sprintf( 'pdftk %s cat output %s', $parts, escapeshellarg($output) );

// launch it
system( $command, $returnvalue );
if( $returnvalue )  printf 'There was an error.';

Next time note: please choose a more-specific title and remove unnecessary code.

Fabio Mora
  • 5,339
  • 2
  • 20
  • 30