-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
previewPath function doesn't seem to be compatible with Cordova #41
Comments
the same error , I don't know how to sollution this question |
don't use ionic wrapper, use it directly like
|
Today I try to use previewPath in ionic capacitor to open an external pdf file via a link - the message return success but it can not preview the file :( My code look like this:
and the result: |
I see the link is not a direct link to the file
It redirects you to
<https://file-examples.com/storage/febd341d226359c2099c083/2017/10/file-sample_150kB.pdf>
[X]
file-sample_150kB<https://file-examples.com/storage/febd341d226359c2099c083/2017/10/file-sample_150kB.pdf>
PDF Document · 143 KB<https://file-examples.com/storage/febd341d226359c2099c083/2017/10/file-sample_150kB.pdf>
The plugin cannot do a redirect
Regards,
…___________________________
Mostafa Mansour
Software Engineer
00971 524988466
On 27 Oct 2022, at 4:59 PM, Tan Vo ***@***.***> wrote:
Hi @mostafa-mansour1<https://github.com/mostafa-mansour1>
Today I try to use previewPath in ionic capacitor to open an external pdf file via a link - the message return success can not preview the file :(
My code look like this:
public async previewFile(): Promise<void> {
await this.loadingService.presentLoader('Loading...');
this.documentService
.previewPath('https://file-examples.com/wp-content/uploads/2017/10/file-sample_150kB.pdf', {
name: 'tan_vo.pdf',
mimeType: 'application/pdf'
})
.subscribe((res) => {
console.log(res);
this.loadingService.dismissLoader();
});
}
and the result:
[image]<https://user-images.githubusercontent.com/8901498/198290937-4d057d09-2786-4952-928a-65ffcc61e642.png>
—
Reply to this email directly, view it on GitHub<#41 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABSFOB2HAZEKNVHOMXZZU4LWFJ4B7ANCNFSM5H2A2XQQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thank you for your answer. I manage to preview the pdf file via a new link https://www.africau.edu/images/default/sample.pdf When I read the document, you mentioned about your pull request didn't merge yet and need to copy after install the link since 02.02 -> So did you merge it? Also please update the link (How to use in ionic project) -> PAGE NOT FOUND |
I didn’t merge it
Will do soon
Regards,
…___________________________
Mostafa Mansour
Software Engineer
00971 524988466
On 27 Oct 2022, at 5:22 PM, Tan Vo ***@***.***> wrote:
Hi @mostafa-mansour1<https://github.com/mostafa-mansour1>
Thank you for your answer.
I manage to preview the file pdf file via a new link https://www.africau.edu/images/default/sample.pdf
When I read the document, you mentioned about your pull request didn't merge yet and need to copy after install the link since 02.02 -> So did you merge it?
[image]<https://user-images.githubusercontent.com/8901498/198295592-8a8056da-da67-4f37-80a6-948ea2efb1e2.png>
Also please update the link (How to use in ionic project) -> PAGE NOT FOUND
—
Reply to this email directly, view it on GitHub<#41 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABSFOB2ZXRITK7YTLFS4VEDWFJ6Y5ANCNFSM5H2A2XQQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
For some reason only
preview
works butpreviewPath
does not. When I usepreviewPath
I get the following error:I'm using the latest version (0.2.9) with Capacitor 3 and Ionic
@ionic-native/core 5.36.0
(I don't know if that's relevant).Let me know if you need any more information for reproduction or when I can test something for you 🙂
The text was updated successfully, but these errors were encountered: