File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
microfrontends/SignDocuments/src/Component/component Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,16 @@ function EmailComponent({
109
109
const handleToPrint = async ( event ) => {
110
110
event . preventDefault ( ) ;
111
111
112
- const base64 = await getBase64FromUrl ( pdfUrl ) ;
113
- printModule ( { printable : base64 , type : "pdf" , base64 : true } ) ;
112
+ const isAndroidDevice = navigator . userAgent . match ( / A n d r o i d / i) ;
113
+ const isAppleDevice = ( / i P a d | i P h o n e | i P o d / . test ( navigator . platform ) || ( navigator . platform === 'MacIntel' && navigator . maxTouchPoints > 1 ) ) && ! window . MSStream
114
+ if ( isAndroidDevice || isAppleDevice ) {
115
+ const byteArray = Uint8Array . from ( atob ( pdf ) . split ( '' ) . map ( char => char . charCodeAt ( 0 ) ) ) ;
116
+ const blob = new Blob ( [ byteArray ] , { type : 'application/pdf' } ) ;
117
+ const blobUrl = URL . createObjectURL ( blob ) ;
118
+ window . open ( blobUrl , '_blank' ) ;
119
+ } else {
120
+ printModule ( { printable : pdf , type : "pdf" , base64 : true } ) ;
121
+ }
114
122
115
123
} ;
116
124
You can’t perform that action at this time.
0 commit comments