Send the File data as stream and open in pdf viewer ,and control the toolbar buttons

I have created a pdf template with the help of itextsharp and stored in a stream ,

need  to pass the stream and open it in a pdf viewer and have a control in the toolbar options is that possible in syncfusion


3 Replies

CK Chinnamunia Karthik Chinna Thambi Syncfusion Team October 11, 2023 12:08 PM UTC

To load a document from a stream, you must convert the stream into a base64 string and then load it into the PDF Viewer.


Sample:  https://www.syncfusion.com/downloads/support/directtrac/general/ze/LoadTheDocumentFromTheStreamMVC1224672323.zip


Steps to load the document:


  • Run the provided sample.
  • Click the "Load the document from the stream" button. This action sends a request to the server.
  • On the server-side, a PDF document is created using iTextSharp, and the resulting stream is sent to the client.
  • On the client-side, the stream is converted into a base64 string using the FileReader.
  • Finally, the PDF Viewer loads the document using the base64 string.


This process allows you to dynamically load a PDF document from a stream into the PDF Viewer in your application.



SM Sathish M replied to Chinnamunia Karthik Chinna Thambi October 16, 2023 10:43 AM UTC


 facing the issue when using the large files (more than 1 Gb) ,not able to load the stream in the json result its throwing Outofmemoryexception how can i solve this issue



CK Chinnamunia Karthik Chinna Thambi Syncfusion Team October 23, 2023 12:25 PM UTC

Kindly provide the following details to assist us in further analyzing the problem and to provide the necessary information:

 

  • Kindly share the sample where the reported issue has occurred.
  • Please share the document where the reported issue occurred, along with details on how the document was loaded, whether through the UI or programmatically.
  • Provide the machine configuration details and confirm whether the issue is occurring in the local environment or in a cloud environment

Loader.
Up arrow icon