简体   繁体   English

如何在adobe reader中的离子2应用程序中打开离线pdf

[英]how to open an Offline pdf in ionic 2 application in adobe reader

Trying the below code to open an offline pdf in ionic 2 application but the code is opening a pdf file in cleverdox viewer instead of adobe reader, how could i set adobe reader by default here to make pdf functional. 尝试下面的代码在离子2应用程序中打开离线pdf但代码是在cleverdox查看器而不是adobe reader打开pdf文件,我怎么能默认设置adobe reader来使pdf功能化。 Thanks in Advance. 提前致谢。

 open() { const options: DocumentViewerOptions = { title: 'My PDF' } this.document.viewDocument('file:///android_asset/www/assets/test.pdf', 'application/pdf', options) } 

No idea if you got this resolved but here's what fixed the issue for me: 不知道你是否解决了这个问题,但是这就解决了我的问题:

Make sure you are using the latest version of the document Viewer plugin. 确保您使用的是最新版本的文档查看器插件。

open() {
  const options: DocumentViewerOptions = {
    title: 'My PDF',
    openWith: { enabled: true }, //this will allow you to open the document with an external application
    // any more options
  };
  this.document.viewDocument('file:///android_asset/www/assets/test.pdf', 'application/pdf', options);
}

The problem with @rj7 's code is that he added a function into what should be a nested object. @ rj7代码的问题在于他将一个函数添加到应该是嵌套对象的内容中。 For more information on the options you can pull through into this function, see the following URL: https://github.com/sitewaerts/cordova-plugin-document-viewer 有关可以使用此功能的选项的更多信息,请参阅以下URL: https//github.com/sitewaerts/cordova-plugin-document-viewer

Hope that helps to anyone stuck in the future. 希望有助于未来的任何人。

Try openWith() like below, 尝试下面的openWith(),

open()
  {
  const options: DocumentViewerOptions = {
  title: 'My PDF',
  openWith() {
    enabled: true
   }
  }
  this.document.viewDocument('file:///android_asset/www/assets/test.pdf', 'application/pdf', options)
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Adobe Reader专门打开文件PDF? - How open file PDF exclusively with Adobe reader? 在Adobe Reader中打开PDF,而不是在浏览器中打开 - Open PDF in Adobe Reader, not in Browser 如何从Adobe Reader中的Android应用程序从服务器打开pdf - How to open pdf from server from Android app in Adobe Reader 如何在浏览器中显示pdf并允许Adobe Reader下载/打开它? - How to show pdf in browser and allow to download/open it by adobe reader? 使用Adobe Acrobat Reader打开pdf并跳到书签 - Open pdf with Adobe Acrobat Reader and jump to bookmark 无法使用 Adob​​e Reader 打开自己创建的 pdf - Failed to open self created pdf with Adobe Reader Adobe Reader无法打开PDF / A3附件 - Adobe Reader does not open PDF/A3 attachments 具有acrobat阅读器的c#wpf应用程序,即使在其他计算机上安装了Adobe Reader,当在其他计算机上安装时也无法打开pdf - c# wpf application with acrobat reader, when install on other machine cannot open pdf even if adobe reader is installed on machine 如何通过Delphi 2009打开PDF文件(窗口默认程序Adobe Reader)? - How can I Open PDF files (window default program Adobe Reader) through Delphi 2009? 是否可以在Adobe Reader中以预定义的放大率打开PDF文件? - Is it possible to have a PDF file open at a predefined magnification in Adobe Reader?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM