The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
May I know how to load the PDF from my local drive in react pdf viewer.
I tried this code with the document path its not working. it's not loading from my local drive. can you please help?
return<PdfViewerComponentid="container"documentPath="file:///E://High School Math.pdf"serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"style={{ 'height':'640px' }}>
AAAkshaya Arivoli Syncfusion Team August 20, 2020 12:14 PM UTC
Hi Feroz,
Thank you for contacting Syncfusion support.
We can create the PDF Viewer web service project and then we can provide the document location in GetDocumentPath() of PdfViewerController.cs .Please refer to the below link to create PDF Viewer web service project.
Please try it and revert us with more details about your requirement and the use case, if you need further assistance.
Regards,
Akshaya
FEFerozAugust 20, 2020 12:21 PM UTC
Hi Akshaya,
Thanks for replying back.
I’m not sure how it got changed to .NET project, Im trying to implement
in React JS app.Can you provide me how to embed local pdf path in React JS application.
MSMohan Selvaraj Syncfusion Team August 21, 2020 07:27 AM UTC
Hi Feroz,
Syncfusion PDF Viewer control is client and server based. So we can only load the PDF file which is available in the server location. For example: If the document path is like “E://viewer.pdf” and the local web service has been used then the PDF document will be rendered correctly in PDF Viewer control. But when the web-service is hosted in the IIS or Azure then it will check the E:// in the hosted environment not in the local machine. So the PDF document has to be placed in the server location for loading the PDF file from the path or we can load the PDF document as base64 string in the load() method of our PDF Viewer control. In the previous provided code-snippet the document path is provided as “E://document.pdf” but the serviceUrl used is our demo application url("https://ej2services.syncfusion.com/production/web-services/api/pdfviewer). So they will search the E://docuemnt name in the hosted service environment. So only the PDF document is not rendered in our PDF Viewer control.
Regards,
Mohan S
Marked as answer
Need More Help?
Get personalized assistance from our support team.