msokk / electron-render-service

Microservice for rendering PDF/PNG/JPEG from HTML with Electron
MIT License
102 stars 31 forks source link

Empty PDFs when writing to file using Node.js... #59

Closed respinha closed 6 years ago

respinha commented 6 years ago

After making a simple HTTP POST using fetch, I write the PDF file in the response to my local file system. However, although the PDF file contains the right structure in terms of header and number of pages, the contents aren't being displayed! Furthermore, if I use some app like Postman and save the resulting PDF in my file system the content is correct. I ran vimdiff between both PDF files (the one which I downloaded with my Node service and the one downloaded by Postman) and they seem to differ on the stream after the "</Filter /FlateDecode " sentence. Am I missing anything? Am I supposed to handle any specific encoding format? Also, I tried to run the stability unit test cases and both GET and POST requests were failing.

Reggino commented 6 years ago

Can you provide:

That could give some clues on what is going on....

Thanks