I am working on a flutter project in which the API returns PDF. But it is in the form of text like this
%PDF-1.4 1 0 obj << /Title (��) /Creator(��) /Producer(��)
How can I save it as a .pdf
.
I am working on a flutter project in which the API returns PDF. But it is in the form of text like this
%PDF-1.4 1 0 obj << /Title (��) /Creator(��) /Producer(��)
How can I save it as a .pdf
.
API is basically returning you bytes. Just write those bytes directly to a file usinng java.nio.Files class or FileOutputStream as you like. Remember to not convert bytes to String as it may affect the encoding and charset, possibly corrupting your file