Given stream is not seekable In FPDI
An HTTP stream wrapper does not support seeking.
You have to download the bucket to a temporary file or variable. A simple file_get_contents()
should do it:
$fileContent = file_get_contents('https://path/to/s3/file','rb');// ...$pdf->setSourceFile(StreamReader::createByString($fileContent));
For those who try to load the file from the same server (not apply to this case but could help others solve this error): change http://example.com/path/file.pdf to a local path like this /home/user/public_html/path/file.pdf