M
M
makar042019-04-01 13:24:24
PHP
makar04, 2019-04-01 13:24:24

How to get printed PDF document from byte array?

Good day! We have to download printed forms, receipts, invoices, etc. using the supplier's API. The response to the request returns an array of bytes, format and file extension. In this case, I'm trying to get a printable PDF of a receipt. How can I convert this byte array into a normal printed document?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
irishmann, 2019-04-01
@makar04

Create a file with the desired extension, open it for writing, write an array of bytes. Then give this file for download

R
Ronald McDonald, 2019-04-01
@Zoominger

Save this array to a file, obviously.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question