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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save success message

Thread ID:

Created:

Updated:

Platform:

Replies:

144127 Apr 20,2019 03:21 AM UTC Apr 22,2019 06:10 AM UTC ASP.NET MVC - EJ 2 1
loading
Tags: PDF Viewer
Saurabh D
Asked On April 20, 2019 03:21 AM UTC

Hello,

I'm looking to allow the user to fill PDF forms via the pdf viewer - please refer to the attached sample shared that was provided to me on a seperate thread. I'm looking to provide the user a custom "Save" button (rather than using the Download button on the PDF Viewer), that will basically call the Download method on the server side that will save the filled document.

I'm using the below javascript to make the call on the button click:

    function savePdf() {
        var pdfviewerObj = $("#pdfviewer").data("ejPdfViewer");
        pdfviewerObj.download();
        alert("done");
    }

Ideally, I would like to show the user a "Save Successful" message after the save is done on the server side. However, I'm observing that when I call the pdfViewerObj.download() method, it does not wait for the method to complete on the server-side, and immediately goes to the next line and shows "Done". This is not the behavior I was looking for, because I would like the download() call to wait for the server side method to execute successfully before going to the next line.

Is there any workaround to this? Or any other way so that I can show a "Success" message after the Download() method executes on the server side.

Thanks.


Attachment: PdfViewer_MVCsample1139086068_b50f6eb7.zip

Ramya Thirugnanam [Syncfusion]
Replied On April 22, 2019 06:10 AM UTC

Hi Saurabh, 
 
Thanks for contacting Syncfusion support. 
 
We can show the alert message after the execution of the download() API of ejPdfViewer control by passing a boolean value to the download(isAsynchronous) API. Initially, the download() API will behave asynchronously. When the “isAsynchronous” parameter is set false, the request for download will behave synchronous and the alert will be executed after the completion of download(isAsynchronous) API. Please find the code example below for the download(isAsynchronous) API. 
 
Code Example: 
 
        var pdfviewer = $("#pdfviewer").data("ejPdfViewer"); 
        pdfviewer.download(false); 
        alert("Done"); 
                                                                                                                                               
We have modified the sample to achieve your requirements and it can be downloaded from the following link. 
                                                                                                                                               
 
Regards, 
Ramya T 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon