开发者

pdftk in php not working

here is the code.... it is not able to merge two pdf files ...can anyone find what 开发者_Go百科the problem is in the code... thanks for ur time....


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜