What is wrong with my PDF after managing to put them to .ZIP and download successfully

100 Views Asked by At

I successfully downloaded .zip file which contains downloaded pdfs. My problem is when i extract it and open it, pdfs have some weird letters. It's my first time doing such thing so i'm somehow stuck and i don't know what might cause this problem. I get status 200 in postman and message "written" in terminal from console.log. Here's a screenshot of my code, and pdf also. If anyone knows, please help, i've been trying for a few days :/

code pdf

pdf properties 1

pdf properties 2

1

There are 1 best solutions below

3
On

Those pdf files may be referencing fonts that are not available on the viewing device. Try downloading them individually and see if you get the same results. Update - The fonts all check out. Nothing exotic.

The only server side / transport issue that comes to mind is accessing a binary file in text mode but the correct content-type should preclude anything like that.

PDFs are already compressed, zip files only add value for batch download.

The symptom that the pdf properties are corrupted points to a pdf writer rendering bug. Some ways to confirm that hypothesis are to:

  • Lint the pdf file to ensure it is whole.
  • Try viewing it in a multitude of readers.
  • Submit to VirusTotal for malware evaluation.