0

I'm trying to use React-PDF to display a pdf within my component but cannot figure out how to provide it with the correct path for my pdf. my file is located under ReactApp/public/pdf/myPdf.pdf

this is where I'm putting my path:

<Document
     file={filepath}
>
</Document>

So far i tried the following without luck:

pdf/GenericCustomerConsentAgreement.pdf

/pdf/GenericCustomerConsentAgreement.pdf

./pdf/GenericCustomerConsentAgreement.pdf

../pdf/GenericCustomerConsentAgreement.pdf

%PUBLIC_URL%/pdf/GenericCustomerConsentAgreement.pdf

I can, however load the file by using:

localhost:61631/pdf/GenericCustomerConsentAgreement.pdf

AnKing
  • 1,994
  • 6
  • 31
  • 54

0 Answers0