gotenberg-php-client icon indicating copy to clipboard operation
gotenberg-php-client copied to clipboard

how to convert a remote office url file?

Open nguyendatdh93 opened this issue 5 years ago • 2 comments

Hi!. I have used aws s3 to store uploaded file. There are doc & docx file. I can get url of file from s3. How can i convert file with DocumentFactory? Thanks!

nguyendatdh93 avatar Nov 24 '20 08:11 nguyendatdh93

The Document constructor accepts a StreamInterface - so I think you'll need to create a stream for these URLs (eg. Guzzle has an implementation which you might be able to use if you're using the AWS SDK and it's S3 stream wrapper - https://github.com/guzzle/streams/blob/master/src/Stream.php#L45)

rodnaph avatar Dec 29 '20 10:12 rodnaph

Just noticed there's a method in the DocumentFactory called createFromPath that would probably work too - with the AWS stream wrapper.

rodnaph avatar Dec 29 '20 14:12 rodnaph