We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Assign an unsaved PDF

I have created a PDFDocument via PDFConverter in Memory. Can I assign this to a PDFViewer to let the user see it?

9 Replies

AA Akshaya Arivoli Syncfusion Team June 14, 2017 07:37 AM UTC

Hi Carsten, 
 
Thank you for contacting Syncfusion Support, 
 
We can load the PDF document memory stream into the PDF viewer to view the document without saving the same. We have created the sample, which converts the Word Document to PDF memory stream and then loads the stream into the PDF viewer, also shared the same for your reference in the following location, 
 
 
Please try the above sample and revert us with more details if your requirement is differing from the above sample. These details will be helpful for us to investigate more on your requirement and assist you better. 
 
Regards, 
Akshaya 



CW Carsten Wuttke June 26, 2017 10:47 AM UTC

Hi Akshaya,


nice. But is it possible without the API. During form_load?

Greetings,

Carsten



AA Akshaya Arivoli Syncfusion Team June 27, 2017 11:35 AM UTC

Hi Carsten, 

Thank you for your update. 

We can create and load the PDF document into the PDF viewer in the Page_Load event by using the DocumentPath property of PDF viewer control during the initial loading of the page. However, we have processed the further functions of PDF document in the PDF viewer using the WebAPI controller so it required to process the document in server side and send the required details to the client. We have created the simple sample which creates the PDF document in the Page_Load event and load the same in the PDF viewer. We have shared the sample in the following location, 


Please try the above sample and revert us with more details if your requirement is differing from the above sample. These details will be helpful for us to investigate more on your requirement and assist you better.  
  
Regards,  
Akshaya  



CW Carsten Wuttke July 6, 2017 09:58 AM UTC

Hello Akshaya,

managed the WEP-API to show me what I want. But how can I set the filename of the PDF in Memory? I can't find it. Or am I too blind... ;-) It always comes out with "sample.pdf" when I download.



AA Akshaya Arivoli Syncfusion Team July 7, 2017 10:28 AM UTC

Hi Carsten,  

Thank you for your update. 

We can customize the name of the downloaded PDF document once the document is loaded from the memory stream in the PDF viewer using the fileName property. We have created the simple sample in which fileName is customized in the documentLoad event and shared the same in the following location, 


Please try the sample and revert us with more details about your requirement, if your requirement is differing from the provided sample. 

Thanks, 
Akshaya 



CW Carsten Wuttke July 10, 2017 08:01 AM UTC

Hi Akshaya,thx at first. Is it also possible in the PDFViewerController in C#? As the viewed PDF is generated in the Controller and only there the filename is in clear text. Or do I have to create an AJAX in the onDocumentLoaded?Made an AJAX-call for the filename. Having it in the AJAX-result. Called your code. But when I DL the file it still downloads as "sample.pdf"... Sadly I can't run you previous sample. Working currently with GAC-Version 15.1460.0.33 and too afraid to update (had often big probs after updating a component) So I added it into the default asp.net webforms example. And it got worse. After setting the filename in Java it fell back to "sample.pdf"!!!! Sadly I couldn't attach the sample


AA Akshaya Arivoli Syncfusion Team July 12, 2017 12:16 PM UTC

Hi Carsten, 

Thank you for your update. 

We have provided the support for customizing the name of the PDF document when downloading, from the Essential Studio version 15.1.0.41. So, we request you to update to the latest version of the Essential Studio for using this feature. Also, we can customize the filename from the server side (i.e, in the PDFViewerController.cs) using the FilePath API after the PDF document is loaded. Please find the code snippet below, 

helper.Load(Helper.GetFilePath("HTTP Succinctly.pdf")); 
PdfViewerHelper.FilePath = "abc.pdf"; 

Please find the link for downloading the latest Essential Studio version, 


Please let us know if you need further assistance on this. 

Thanks, 
Akshaya 



CW Carsten Wuttke July 12, 2017 12:43 PM UTC

Hi Akshaya,

so you are saying I can't manipulate the filename in 15.1.0.33 (as the code-snippet doesn't work...)? And is it 100% that everything works as expected when I upgrade to 15.2.0.46

Greets,

Carsten



AA Akshaya Arivoli Syncfusion Team July 13, 2017 09:46 AM UTC

Hi Carsten, 

Thank you for your update. 

Yes, the support for customizing the name of the PDF document when downloading is working as expected from the Essential Studio version 15.2.0.46. Kindly upgrade to the Essential Studio latest version (15.2.0.46) as mentioned earlier using the below link, 


Please let us know if you need further assistance on this. We are always happy to assist you. 

Regards, 
Akshaya 


Loader.
Live Chat Icon For mobile
Up arrow icon