Skip to content
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

PDF Merge Issue: Downloaded File Contains No Content #58

Open
MZubairNaeem opened this issue Oct 25, 2024 · 1 comment
Open

PDF Merge Issue: Downloaded File Contains No Content #58

MZubairNaeem opened this issue Oct 25, 2024 · 1 comment

Comments

@MZubairNaeem
Copy link

I'm experiencing an issue when attempting to merge PDF files using the IlovePDF API. Although my credits are being deducted each time I run the code, the downloaded PDF file ends up being empty (no content).

Here is the code I am using for the merge operation:

`$ilovepdf = new Ilovepdf(env('ILOVEPDF_PUBLIC_KEY'), env('ILOVEPDF_SECRET_KEY'));

// Start a merge task
$merger = $ilovepdf->newTask('merge');

// Add the tender PDF to the merge task
$merger->addFile(storage_path('app/files/toc/tender/bid/Tender_'.$tender->bid_no.'.pdf'));

// Rest of Documents
foreach ($TocsWithDocumentsAttached as $key => $section) {
foreach ($section as $serial => $toc) {
$merger->addFile(storage_path('app/'.$toc->file));
}
}

// Execute the merge task
$merger->execute();
$merger->download();
`
Steps to Reproduce:

Initialize the IlovePDF client with valid API keys.
Start a merge task and add multiple PDF files.
Execute the merge and attempt to download the resulting PDF.
Expected Behavior: The merged PDF should contain the content of all added files.

Actual Behavior: The downloaded PDF file is empty.

Additional Information:

I've verified that the file paths are correct and the files exist before merging.
No errors are thrown during the execution of the merge task.
Any help in resolving this issue would be greatly appreciated! Thank you.

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
@MZubairNaeem and others