Question

Preview the uploaded PDF in counter party application.

  • 3 October 2022
  • 1 reply
  • 24 views

We have a problem with previewing the uploaded PDF in the integration process of our development.

below code snipt is used to make the stream of the uploaded file.

const makeDownloadStream = (url: any, z: ZObject) =>
new Promise((resolve, reject) => {
https
.request(url, (res: any) => {
res.pause();
resolve(res);
})
.on('error', reject)
.end();
});

when this upload_as parameter is set to the PDF, then the uploaded PDF can be previewed as empty white color PDF(without any character).

const formData = new FormData();
const stream = makeDownloadStream(`${bundle.inputData.file}`, z);
formData.append('upload_as', `${bundle.inputData.upload_as}`);
formData.append('file', `${stream}`, { filename: bundle.inputData.name });

Follow image is the input form of the PDF.

IS there any suggestion to preview the PDF in correctly ?

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 6
Badge +8

Hi @PASINDU ,

Are you asking if there is a way to preview the PDF in the Zap editor itself? No, we don’t offer that.

Let us know if you have any other questions!