Add API to Existing Solution
I just want to view a pdf in a frame. On webforms I used an HtmlGenericControl.
If I used the PDF Viewer I believe that I need to use the api for this? If so, can I add the API to my existing solution?
Thank you.
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
AA
Akshaya Arivoli
Syncfusion Team
July 16, 2020 10:00 AM UTC
Hi Stephen,
Thank you for contacting Syncfusion support.
Our PDF Viewer control is both server and the client side oriented. PDF viewer control processes the PDF document in the server side(developed with .NET environment) and send the processed PDF data to the client using the Web service to render the PDF document and for further operations in PDF viewer.
Our PDF Viewer Server Side Blazor application has the built-in server side codes, so it does not required to configured separately in the project. Please refer to the below UG link to create PDF Viewer Server side blazor project,
Server Side Blazor: https://blazor.syncfusion.com/documentation/pdfviewer/getting-started/server-side-application/
PDF Viewer Client side Blazor application requires the Web service project and it is referred using the serviceUrl project. Please refer to the below UG link to create PDF Viewer Client side blazor project,
Client Side Blazor: https://blazor.syncfusion.com/documentation/pdfviewer/getting-started/client-side-application/
We can also create our own web Service Project using this link, https://www.syncfusion.com/kb/11063/how-to-create-the-pdf-viewer-web-service-application-in-net-core-3-0-and-above-version
Please try it and revert us with more details if you need any further assistance.
Regards,
Akshaya
Marked as answer
SL
slynch
July 16, 2020 05:08 PM UTC
Thank you. The youtube video helped me accomplish this. Do you have an example for AWS S3 rendering of pdf. I have 2 methods,1) a stream and 2) a presigned URL.
I have the stream coming down as a filestream and I quess I need to convert to bytes and then to base64 but I get an error that cannot convert filesstream to string.
var streamPath = AwsService.ReadFileAsync("123.pdf", "ABC");
byte[] bytes = System.IO.File.ReadAllBytes(streamPath);
DocumentPath = "data:application/pdf;base64," + Convert.ToBase64String(bytes);
Regarding presigned url, how do I assign a url?
public string DocumentPath { get; set; } = @"http:\\abc.com\test.pdf";
<SfPdfViewerServer DocumentPath="@DocumentPath" Width="1060px" Height="500px"></SfPdfViewerServer>
AA
Akshaya Arivoli
Syncfusion Team
July 20, 2020 09:42 AM UTC
Hi Stephen,
Thank you for your update.
We can convert the URL/byteArray/MemoryStream into Base64 string and display the same in PDF Viewer.
We have created the sample for the same and shared in the below link,
Please try it and revert us with more details about your issue and the modified sample if you still need further assistance.
Regards,
Akshaya
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
- Marked answer
-
SL slynch
- Jul 15, 2020 02:17 PM UTC
- Jul 20, 2020 09:42 AM UTC