October 22, 2024
Chicago 12, Melborne City, USA
pdf

IFrame and Object elements not supporting base64 when displaying pdf-s on smallers screen sizes (mobile)


I want to display a pdf from contentBase64, using Object does not work with Safari browser for some reason. Just displays a grey screen. Works with chrome on desktop view but not with mobile. So I tried using IFrame, which works fine on Safari, but then again Chromes mobile view is not supported.

Am i doing something wrong or do these elements really not support mobile view?

        <iframe
          aria-label="contract"
          width={'100%'}
          title="pdf-container"
          src={`data:${contentType};base64,${contentBase64}`}
          height="440px"
          name={fileData?.name}
        >
          <p>{'Document not found'}</p>
        </iframe>



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video