File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
microfrontends/SignDocuments/src/Component/component Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,17 @@ function Header({
60
60
event . preventDefault ( ) ;
61
61
62
62
const pdf = await getBase64FromUrl ( pdfUrl ) ;
63
+ const isAndroidDevice = navigator . userAgent . match ( / A n d r o i d / i) ;
64
+ 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
65
+ if ( isAndroidDevice || isAppleDevice ) {
66
+ const byteArray = Uint8Array . from ( atob ( pdf ) . split ( '' ) . map ( char => char . charCodeAt ( 0 ) ) ) ;
67
+ const blob = new Blob ( [ byteArray ] , { type : 'application/pdf' } ) ;
68
+ const blobUrl = URL . createObjectURL ( blob ) ;
69
+ window . open ( blobUrl , '_blank' ) ;
70
+ } else {
71
+ printModule ( { printable : pdf , type : "pdf" , base64 : true } ) ;
72
+ }
73
+
63
74
64
75
printModule ( { printable : pdf , type : "pdf" , base64 : true } ) ;
65
76
} ;
You can’t perform that action at this time.
0 commit comments