Overload Print functionality in client side Blazor App

I have a client side Blazor App.  I would like to change the functionality of the Print button without having to create a custom toolbar.  Is that at all possible?

Thanks,
Arthur

13 Replies

AA Akshaya Arivoli Syncfusion Team March 25, 2020 07:22 AM UTC

Hi Arthur, 

Thank you for contacting Syncfusion support. 

Can you please provide more details about your requirement, use case scenario, also confirm us whether you want to customize the Print functionality of the PDF Viewer in the Client side or Server side, details about the changes which you want to done with print functionality. These details will be helpful for us to investigate more on your requirement and assist you better.  

Regards, 
Akshaya 



AB Arthur Butler March 25, 2020 05:37 PM UTC

I have a client side Blazor App.  When the user selects the Print button, I want to check for a cookie in the browser.  If this does not exist, then I want to display a message box.  If the cookie does exist, then I want to launch my custom app via a custom browser protocol.  In Javascript, I would do this something like document.location = "foo://print";.

Regards,
Arthur


AA Akshaya Arivoli Syncfusion Team March 26, 2020 01:10 PM UTC

Hi Arthur, 
  
Thank you for your update. 
  
Currently we do not have support to customize the print function in our PDF Viewer. Can you please confirm us whether your requirement will be achieved if we expose the BeforePrint event. In that event you can achieve your requirement in your application level, before the print function starts. Please let us know whether the above details meet your requirement, if not please revert us with more details. It will be helpful for us to provide you precise solution. 
  
Regards, 
Akshaya 



AB Arthur Butler March 31, 2020 06:39 AM UTC

Yes, BeforePrint will work assuming I can cancel the default Print behavior.


AA Akshaya Arivoli Syncfusion Team April 1, 2020 06:34 AM UTC

Hi Arthur , 

Thank you for your update. 

Currently we do not have events to notify the printing operations in our PDF Viewer. We will analyze further on exposing the events to achieve your requirement and update you with more details on April 3rd, 2020 

Regards, 
Akshaya


AA Akshaya Arivoli Syncfusion Team April 3, 2020 01:33 PM UTC

Hi Arthur , 
  
We will expose the event to notify the printing operations in our PDF Viewer. The implementation will be included in our 2020 Volume 1 SP1 release which is expected to be rolled out in the end of April. You can track the status using the below link, 
  
  
Regards, 
Akshaya  



AB Arthur Butler May 14, 2020 05:45 AM UTC

Was this implemented?  If so, what is the API?  Thanks.


AA Akshaya Arivoli Syncfusion Team May 14, 2020 03:10 PM UTC

Hi Arthur , 
 
We have implemented the feature and the implementation was included in our latest weekly release v18.1.0.46. Kindly upgrade to that version to get the implementation. 
 
EVENT: 
 
printStart 
 
PrintStartEventArgs 
 
Property 
Type 
Definition 
fileName 
string 
File name of the currently loaded PDF document in the PDF Viewer. 
cancel 
boolean 
If it is true, the print operation will not work. 
 
EVENT: 
 
printEnd 
 
PrintEndEventArgs 
 
Property 
Type 
Definition 
fileName 
string 
File name of the currently loaded PDF document in the PDF Viewer. 
printDocument 
string 
Defines the base 64 string of the loaded PDF document data. 
 
Regards,   
Akshaya   




AB Arthur Butler May 15, 2020 12:04 AM UTC

This is not working for me.  I am using v18.1.0.52 in a Blazor web assembly app. I set "args.Cancel = true;" in PrintStart, but the print dialog still appears. I know that the code is being called because I set a breakpoint there.

Regards,
Arthur




AB Arthur Butler May 19, 2020 05:51 PM UTC

Same issue with v18.1.0.53 in a Blazor web assembly app.


AA Akshaya Arivoli Syncfusion Team May 20, 2020 05:44 AM UTC

Hi Arthur, 
 
Due to technical issue, we are not integrating the ‘arg.cancel’ behavior with this release. We have completed the changes from our side and currently changes are in testing phase. We will include it in our next weekly release 27th May 2020 without fail. 
 
 
Regards, 
Akshaya  



AA Akshaya Arivoli Syncfusion Team May 29, 2020 06:08 AM UTC

Hi Arthur, 

We have fixed the reported issue and the fix was included in our latest weekly NuGet release v18.1.0.54. Kindly upgrade to that version to get the issue resolved. 

Regards, 
Akshaya  



AB Arthur Butler June 2, 2020 06:45 PM UTC

Thank you, this is working well.

Loader.
Up arrow icon