How to specify the filename of the downloaded PDF programatically

Hello Syncfusion Team,

I am using your PDF Viewer component to show PDFs. When I click on the download button I would like to see the download file name that I set programatically. For example if I download a pdf in from PDF Viewer, I would like to download it as "SummaryDocument.pdf".

Is there any way to specify the download file name programatically for download actions?

Thanks in advance!

Regards,
Istvan

9 Replies 1 reply marked as answer

MS Mohan Selvaraj Syncfusion Team November 24, 2020 12:48 PM UTC

Hi Szöke,  
   
Thanks for using Syncfusion products.  
   
We can specify the filename by using DownloadFileName property during the control initialization. Kindly refer to the code snippet below.  
   
<SfPdfViewerServer @ref="@Viewer" DocumentPath="@documentPath" Width="900px" Height="500px" DownloadFileName="SummaryDocument.pdf">
</SfPdfViewerServer>
  
   
   
However, we are currently facing the issue of changing the filename dynamically, so we will update the further details on November 26th, 2020.  
   
Regards,  
Mohan S 


SI Szöke Istvan November 24, 2020 01:34 PM UTC

Hi Mohan,

Thanks for your update.

Yes, I would like to change the download file name dynamically depending on the opened PDF's filename.

I will wait for more details on November 26th.

Regards,
Istvan


AA Akshaya Arivoli Syncfusion Team November 25, 2020 11:53 AM UTC

Hi Szöke, 

Thank you for your update. 

As mentioned earlier, we will analyze further your requirement to change the download file name dynamically depending on the opened PDF's filename and update you with more details on November 26, 2020 

Regards, 
Akshaya


AA Akshaya Arivoli Syncfusion Team November 26, 2020 05:38 PM UTC

Hi Szöke, 
 
We have Confirmed that “Unable to update the Download Filename dynamically” is a defect and logged the defect report for the same. The fix for the issue will be included in our upcoming weekly NuGet release on 16th  December 2020. You can track the status using the below link  
 

Regards,  
Akshaya   



SI Szöke Istvan November 26, 2020 06:39 PM UTC

Hi Akshaya,

Thanks for the information. I will wait for the bugfix on 16th December.

Regards,
Istvan


AA Akshaya Arivoli Syncfusion Team November 27, 2020 09:54 AM UTC

Hi Szöke,  

As mentioned earlier, we will update you with further details on December 16, 2020 

Regards, 
Akshaya 



AA Akshaya Arivoli Syncfusion Team December 16, 2020 12:41 PM UTC

Hi Szöke , 
We have fixed the reported issue “Unable to update the Download Filename dynamically” and the fix was   included in our latest weekly release v18.3.0.53. Kindly upgrade to that version to get the issue resolved. 

Please find the code snippet and samples from the below link. 

Code Snippet : 
<button @onclick="NameChange">Update</button> 

<SfPdfViewerServer DownloadFileName="@DownloadName"> 
</SfPdfViewerServer> 

@code{ 
    private string DownloadName { get; set; } = "sample.pdf"; 

    public void NameChange(MouseEventArgs eventArgs) 
    { 
        DownloadName = "updated.pdf"; 
    } 
} 



Kindly try it and revert us with more details about your issue, if you still have concerns. These will be helpful for us to investigate further and assist you better.    

Regards, 
Akshaya 


Marked as answer

SI Szöke Istvan December 17, 2020 08:12 AM UTC

Hi Akshaya,

Thanks for your update. The download filename works well now.

Regards,
Istvan


AA Akshaya Arivoli Syncfusion Team December 17, 2020 08:36 AM UTC


Hi Szöke, 

Thank you for your update. We were glad to know that the reported issue was resolved. Kindly revert if you need any assistance in future. 

Regards, 
Akshaya 


Loader.
Up arrow icon