Skip to main content
Question

Preview the uploaded PDF in counter party application.

  • October 3, 2022
  • 1 reply
  • 28 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 ?

 

Did this topic help you find an answer to your question?
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

shalgrim
Forum|alt.badge.img+8
  • Zapier Staff
  • 406 replies
  • October 6, 2022

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!