Convert base64 to pdf in reactJS

Hello,
I am struggling with converting base64 to pdf. I tried the Rect-pdf package still not working. In the documentation, they have mentioned like

  • Import by adding import { Document } from 'react-pdf'.
  • Use by adding <Document file="..." />. file can be a URL, base64 content, Uint8Array, and more.

<Document file={data:application/pdf;base64,${pdf}} onLoadSuccess={onDocumentLoadSuccess}>



Page {pageNumber} of {numPages}


And I tried in this way but still not working. I am at the end of the deadline for my work. Your help will be appreciated .