Skip to content

not working on Windows 10 #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ronga opened this issue Mar 18, 2021 · 4 comments
Closed

not working on Windows 10 #234

ronga opened this issue Mar 18, 2021 · 4 comments

Comments

@ronga
Copy link

ronga commented Mar 18, 2021

I lifted this straight from the readme doc and it doesn't seem to work, I was getting a blank until I added echo ('error'); in the error checking at the end, at which point I did get an error message:

 require_once('C:\PHP8\vendor\autoload.php'); 
    use mikehaertl\pdftk\Pdf;


// Extract pages 1-2 into a new file
$pdf = new Pdf('C:\PHP8\CSA AND IPS IMA 8807.pdf');
$result = $pdf->cat(1, 2)
        ->saveAs('C:\PHP8\CSA1.pdf');
if ($result === false) {
    echo ('error');
    $error = $pdf->getError();
}

Any help is appreciated as I've been on this almost a week already.

@mikehaertl
Copy link
Owner

Same as #233 i.e. set binary to the path to pdftk.exe?

@ronga
Copy link
Author

ronga commented Mar 21, 2021

For some reason, pdftk.exe was not installed anywhere through composer. I just downloaded it manually and put it in Program Files (x86) as you suggested. Worked like a charm. Thank you sir, your genius piece of work saved us hundreds of man-hours!

@ronga ronga closed this as completed Mar 21, 2021
@mikehaertl
Copy link
Owner

It's not expected to be installed via composer. See this note in the README:

The pdftk command must be installed and working on your system

@ronga
Copy link
Author

ronga commented Mar 21, 2021

I see, I must have missed that. I did see your other thread where you mentioned installing pdftk via composer.

Again, thank you for all the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants