mostafa-mansour1 / previewAnyFile

Cordova Plugin to preview any file in native mode by providing the local or external URL
MIT License
33 stars 31 forks source link

previewAnyFile.previewBase64 error #32

Closed lethieuluong closed 3 years ago

lethieuluong commented 3 years ago

Hi, I use previewAnyFile.previewBase64 in ionicvue to open base64 pdf like:

      previewAnyFile.previewBase64('data:application/pdf;base64,.......')
      .catch((error: any) => showError(error));

and got this error: Error: the old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, 'Service', 'action', [arg1, arg2]);

I know you have a zip file provided for AngularJs as a fix, do you have a fix for Ionicvue, too ? e.g. correct the preview.js in \android\app\src\main\assets\public\plugins\cordova-plugin-preview-any-file\www

Thanks

mostafa-mansour1 commented 3 years ago

I am not using ionic vue Can you use direct cordova plugin?

window.PreviewAnyFile.previewBase64( win => console.log("open status",win), error => console.error("open failed", error), 'JVBERi0xLjMKJcTl8uXr.....',{mimeType:'application/pdf'} );

Regards,


Mostafa Mansour Software Engineer 00971 524988466 0020 1113019196

On 23 Jul 2021, at 7:46 PM, lethieuluong @.***> wrote:



Hi, I use previewAnyFile.previewBase64 in ionicvue to open base64 pdf like:

  previewAnyFile.previewBase64('data:application/pdf;base64,.......')
  .catch((error: any) => showError(error));

and got this error: Error: the old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, 'Service', 'action', [arg1, arg2]);

I know you have a zip file provided for AngularJs as a fix, do you have a fix for Ionicvue, too ? e.g. correct the preview.js in \android\app\src\main\assets\public\plugins\cordova-plugin-preview-any-file\www

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mostafa-mansour1/previewAnyFile/issues/32, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSFOB3FQLNZTTA3L3WKYJTTZGTIFANCNFSM5A4NKBYQ.

lethieuluong commented 3 years ago

if I use:

window.PreviewAnyFile.previewBase64

I got a compile error:

PreviewAnyFile does not exist on type windows

what I did is:

npm install cordova-plugin-preview-any-file npm install @ionic-native/preview-any-file ionic cap sync

what do it need else from code so that window.PreviewAnyFile is usable ? sorry I'm pretty new with this topic. If you offer a support I will ask my company to purchase this. Thanks.

mostafa-mansour1 commented 3 years ago

Use it like

(window).PreviewAnyFile. previewBase64

Or

Let cloneWindow:any = window

cloneWindow.PreviewAnyFile. previewBase64

Regards,


Mostafa Mansour Software Engineer 00971 524988466 0020 1113019196

On 24 Jul 2021, at 7:52 PM, lethieuluong @.***> wrote:



if I use:

window.PreviewAnyFile.previewBase64

I got a compile error:

PreviewAnyFile does not exist on type windows

what I did is:

npm install cordova-plugin-preview-any-file npm install @ionic-native/preview-any-file ionic cap sync

what do it need else from code so that window.PreviewAnyFile is usable ? sorry I'm pretty new with this topic. If you offer a support I will ask my company to purchase this. Thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/mostafa-mansour1/previewAnyFile/issues/32#issuecomment-886087588, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSFOBYSV2F4QJNBLDK3ZR3TZL4VBANCNFSM5A4NKBYQ.