Set output location for pdftk sample.pdf burst

I have a question, I use tdftk to split the pages of a PDF file with php. using the following command

$command = escapeshellcmd("pdftk ").escapeshellarg("/var/www/card/card.pdf")." ".escapeshellcmd(" burst"); $result = passthru($command); 

it works very well and breaks pages into files.

Now my question is, can I set the output location where the package files should be stored.

by default, it places the files in the root of the site’s site, where I want the files in the / var / www / card / pages / directory.

Is there a way to do this in PDFTK?

Please help me with this ...

+6
source share
1 answer

I wanted to do the same: you can specify the output directory and name format with the "output" pdftk parameter. ex:

 pdftk your_file.pdf burst output your_directory/page_%02d.pdf 

See the pdftk document for more information:

http://www.pdflabs.com/docs/pdftk-man-page/#dest-op-burst

Hope this helps, Vincent

+16
source

Source: https://habr.com/ru/post/892149/


All Articles