GrofGraf / laravel-pdf-merger

Package for Laravel that merges multiple PDFs into one.
MIT License
29 stars 44 forks source link

Combining PDFs from a URL #8

Open iapparatus opened 4 years ago

iapparatus commented 4 years ago

How do I combine files from a URL, such as AWS s3? Is it possible to override local path?

chadpriddle commented 2 years ago

Yes, just put in the full URL path using the string method

$merger = \PDFMerger::init(); $merger->addPDFString(file_get_contents('https://aws.com/path-to-aws-pdf-1.pdf), 'all', 'P'); $merger->addPDFString(file_get_contents('https://aws.com/path-to-aws-pdf-2.pdf), 'all', 'P'); $merger->merge(); $merger->save(base_path('public/pdf/merged.pdf'));