Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/448.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Sencha Touch 2上的PDF查看器_Javascript_Pdf_Embed_Sencha Touch 2 - Fatal编程技术网

Javascript Sencha Touch 2上的PDF查看器

Javascript Sencha Touch 2上的PDF查看器,javascript,pdf,embed,sencha-touch-2,Javascript,Pdf,Embed,Sencha Touch 2,我在Sencha touch2上遇到了一个奇怪的情况 我在这个框架中阅读和显示PDF文件时遇到了一个问题。我在sencha论坛/谷歌等网站上看到了这一点,但我并没有找到真正的解决方案 我有一个带有PDF url的JSON对象提要(PDF不是本地的) 我试过这个: 我有卷轴问题,t只显示第一页,因为Sencha有自己的卷轴面板。。。等 是,亲爱的,您可以使用下面的示例在sencha touch-2上轻松查看pdf文档: Ext.Viewport.add({ //f

我在Sencha touch2上遇到了一个奇怪的情况

我在这个框架中阅读和显示PDF文件时遇到了一个问题。我在sencha论坛/谷歌等网站上看到了这一点,但我并没有找到真正的解决方案

我有一个带有PDF url的JSON对象提要(PDF不是本地的)

我试过这个:


  • 我有卷轴问题,t只显示第一页,因为Sencha有自己的卷轴面板。。。等




  • 是,亲爱的,您可以使用下面的示例在sencha touch-2上轻松查看pdf文档:

    Ext.Viewport.add({
            //first we define the xtype, which is tabpanel for the Tab Panel component
            xtype: 'tabpanel',
    
            //next we define the items that will appear inside our tab panel
            items: [
                {
                    //each item in a tabpanel requires the title configuration. this is displayed
                    //on the tab for this item
                    title: 'Tab 1',
    
                    //next we give it some simple html
                    items: {
                        html: '1',
                        centered: true
                    },
    
                    //then a custom cls so we can style it
                    cls: 'card1'
                },
                {
                    //title
                    title: 'Tab 2',
    
                    //the items html
                    items: {
                        html: '2',
                        centered: true
                    },
    
                    //custom cls
                    cls: 'card2'
                },
                {
                    //title
                    title: 'Tab 3',
    
                    //the items html
                    items: {
                        html: '<embed type="application/pdf" width="800px" height="800px" src="YourFile.pdf" />',
                        centered: true
                    },
    
                    //custom cls
                    cls: 'card3'
                }
            ]
        });
    
    Ext.Viewport.add({
    //首先我们定义xtype,它是tabpanel组件的tabpanel
    xtype:'tabpanel',
    //接下来,我们定义将出现在选项卡面板中的项目
    项目:[
    {
    //选项卡面板中的每个项目都需要标题配置。这将显示
    //在该项的选项卡上
    标题:“表1”,
    //接下来我们给它一些简单的html
    项目:{
    html:'1',
    对
    },
    //然后是一个定制的cls,这样我们就可以设计它了
    cls:“card1”
    },
    {
    //头衔
    标题:“表2”,
    //这些项目是html
    项目:{
    html:'2',
    对
    },
    //自定义cls
    cls:“card2”
    },
    {
    //头衔
    标题:“表3”,
    //这些项目是html
    项目:{
    html:“”,
    对
    },
    //自定义cls
    cls:“card3”
    }
    ]
    });
    
    是的,亲爱的,您可以使用以下示例在sencha touch-2上轻松查看pdf文档:

    Ext.Viewport.add({
            //first we define the xtype, which is tabpanel for the Tab Panel component
            xtype: 'tabpanel',
    
            //next we define the items that will appear inside our tab panel
            items: [
                {
                    //each item in a tabpanel requires the title configuration. this is displayed
                    //on the tab for this item
                    title: 'Tab 1',
    
                    //next we give it some simple html
                    items: {
                        html: '1',
                        centered: true
                    },
    
                    //then a custom cls so we can style it
                    cls: 'card1'
                },
                {
                    //title
                    title: 'Tab 2',
    
                    //the items html
                    items: {
                        html: '2',
                        centered: true
                    },
    
                    //custom cls
                    cls: 'card2'
                },
                {
                    //title
                    title: 'Tab 3',
    
                    //the items html
                    items: {
                        html: '<embed type="application/pdf" width="800px" height="800px" src="YourFile.pdf" />',
                        centered: true
                    },
    
                    //custom cls
                    cls: 'card3'
                }
            ]
        });
    
    Ext.Viewport.add({
    //首先我们定义xtype,它是tabpanel组件的tabpanel
    xtype:'tabpanel',
    //接下来,我们定义将出现在选项卡面板中的项目
    项目:[
    {
    //选项卡面板中的每个项目都需要标题配置。这将显示
    //在该项的选项卡上
    标题:“表1”,
    //接下来我们给它一些简单的html
    项目:{
    html:'1',
    对
    },
    //然后是一个定制的cls,这样我们就可以设计它了
    cls:“card1”
    },
    {
    //头衔
    标题:“表2”,
    //这些项目是html
    项目:{
    html:'2',
    对
    },
    //自定义cls
    cls:“card2”
    },
    {
    //头衔
    标题:“表3”,
    //这些项目是html
    项目:{
    html:“”,
    对
    },
    //自定义cls
    cls:“card3”
    }
    ]
    });
    
    我发现我使用或计划使用的替代方案很少:

  • 谷歌PDF浏览器,这对我来说并不完美,当您登录并且会话过期时,它会出现一些会话问题
  • 如果您的应用程序可以打开PDF的新窗口,您可以在浏览器版本中打开一个新窗口,例如,您可以在Phonegap ChildBrowser中查看PDF
  • 我曾经为1个应用程序使用第三方服务ex:,但对我来说并不真正有效,因为我需要在应用程序中预览后上传pdf,这不是即时的
  • 我接下来要做的就是使用pdfjs。我仍然需要处理跨域文档,但这就是我的全部
    如果你有一个真正的解决方案,那将是非常棒的,但这个问题是我的应用程序实施过程中的一个诡计,不确定在这种情况下哪个是真正的解决方案。

    我发现我使用的或我计划使用的替代方案很少:

  • 谷歌PDF浏览器,这对我来说并不完美,当您登录并且会话过期时,它会出现一些会话问题
  • 如果您的应用程序可以打开PDF的新窗口,您可以在浏览器版本中打开一个新窗口,例如,您可以在Phonegap ChildBrowser中查看PDF
  • 我曾经为1个应用程序使用第三方服务ex:,但对我来说并不真正有效,因为我需要在应用程序中预览后上传pdf,这不是即时的
  • 我接下来要做的就是使用pdfjs。我仍然需要处理跨域文档,但这就是我的全部
    如果你有一个真正的解决方案,那将是非常棒的,但是这个问题在我的应用程序实现时是一个诡计,不确定在这种情况下哪个是真正的解决方案。

    它不滚动,它显示jut第一页,那就是allit不滚动,它显示jut第一页,这就是你找到解决方案了吗?当它显示第一页时,当你在iPad上时,它是否允许你在另一个阅读器中打开?多谢了。问题不仅在于页面没有滚动……在iOS上,它看起来是一个静态图像(在我看来,它的大小不正确),而且你在里面什么都不能做。你还有其他选择吗?在ST2面板中不打开文档(PDF或其他格式不太重要)是一个巨大的缺陷…iframe的PDF大小有问题。对我来说,在iPad Safari中,PDF的大小不太合适,而且它的正确部分不在视图中……你有相同的问题吗?没有任何效果,我现在使用的是另一种方式,即google PDF viewer。但对我来说仍然不是最好的解决方案,仍然在寻找真正的解决方案你找到解决方案了吗?当它显示第一页时,是否允许您在打开时在另一个阅读器中打开