Reader and Writer work with character data - which PDFs are not. They are binary data, for which you need to use streams.
posted 1 year ago
As Tim says, you are working with a binary file.
In any case, you aren't processing it, you just want to save it to the disk (or wherever), so you ought to use the stream directly.
Read a chunk of bytes, write the chunk of bytes...repeat until you reach the end of the file stream.