0

iframe working perfectly in web browser but its not working in mobile browser both andriod and iPhone. The source is in blob. I have also tried google doc but working preview error.

This is how to works in web browser

here is the code

const response = await axiosInstance.post('/api/employee/generatepdf', {
    workOrder,
    customerId,
  });

  const blob = base64ToBlob(response.data.attachment, 'application/pdf');
  const url = URL.createObjectURL(blob);
  const pdfWindow = window.open('');
  pdfWindow.document.write(
    "<iframe width='100%' height='100%' src='" + url + "'></iframe>"
  );

I tried using anchor tag even uses href, nothing works

I just want that it either show/download pdf in mobile devices

0 Answers0