...
PdfWriter.getInstance(document, outputStream); // outputstream from java
I successfully downloaded this pdf file by fetch api and postman, but failed by axios, even though the size was normal.
// I successfully downloaded this pdf file by fetch api and postman, but failed by axios, even though the size was normal(blank content).
axios({
url: `xxx`,
method: 'get',
responseType: 'arraybuffer'
}).then(resp => {
const url = window.URL.createObjectURL(new Blob([resp.data], {type:"application/pdf"}));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'test.pdf');
document.body.appendChild(link);
link.click();
})
Can someone help me?