【问题标题】:Google docs embedded document not showing until resize?谷歌文档嵌入文档直到调整大小才显示?
【发布时间】:2017-09-14 06:18:05
【问题描述】:

我有一个问题,在我调整浏览器窗口大小之前,有时(具体时间不清楚)显示带有docs.google.com 的嵌入文档不会显示该文档。

吃点爆米花,这部电影说明了问题:

这是我的代码:

HTML:

<iframe runat="server" id="frame" style="width:100%;height:600px;border:0;"></iframe>

C# 代码开始(在Page_Load 方法中):

frame.Attributes["src"] = "https://docs.google.com/gview?url=https://example.com/1.doc&embedded=true";

我尝试通过直接浏览https://docs.google.com/gview?url=https://example.com/1.doc&amp;embedded=true 来复制它,但它从来没有以这种方式发生。

注意:有时文档根本不会显示,就好像它从未加载过一样,并且 iFrame 保持完全空白。

任何想法如何解决这个问题?

【问题讨论】:

  • 您是否尝试以像素为单位设置宽度?例如 500px
  • @Saeed 没有帮助 - 修复了 width 相同的问题。

标签: c# google-chrome iframe document google-docs


【解决方案1】:

您可以尝试设置默认文档大小。这就是我从 Google Docs 打印信封的方法

 var envelope10={};
  envelope10[DocumentApp.Attribute.PAGE_HEIGHT]=296;
  envelope10[DocumentApp.Attribute.PAGE_WIDTH]=684;
  envelope10[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
  envelope10[DocumentApp.Attribute.FONT_SIZE] = 18;
  envelope10[DocumentApp.Attribute.BOLD] = true;
  envelope10[DocumentApp.Attribute.LINE_SPACING]=1;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-12
    • 2018-05-25
    • 2013-04-24
    • 2014-01-08
    • 1970-01-01
    • 2011-09-15
    • 2018-03-21
    • 1970-01-01
    相关资源
    最近更新 更多