PHP code example of einfacharchiv / unpack-pdf-attachments

1. Go to this page and download the library: Download einfacharchiv/unpack-pdf-attachments library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

einfacharchiv / unpack-pdf-attachments example snippets


(new Pdf())
    ->setPdf('document.pdf')
    ->unpack();

Pdf::unpackAttachments('document.pdf');

(new Pdf())
    ->setPdf('document.pdf')
    ->setOptions(['output tmp'])
    ->unpack();

Pdf::unpackAttachments('document.pdf', ['output tmp']);

(new Pdf('/snap/bin/pdftk'))
    ->setPdf('document.pdf')
    ->unpack();

Pdf::unpackAttachments('document.pdf', [], '/snap/bin/pdftk');
bash
which pdftk