2017-09-14 61 views
0

我有一个问题,其中有时(不确切时),显示一个嵌入文档docs.google.com不显示文档,直到我调整浏览器窗口的大小。谷歌文档嵌入式文档直到调整大小才显示?

抓住一些爆米花,这里有一个电影,显示了问题:

enter image description here

这里是我的代码:

HTML:

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

C#代码begind(在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&embedded=true来重现它,但它从来没有发生过这种方式。

注意:有时文档从来没有displayd,就好像它从未加载,并且iFrame保持空白。

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

+0

您是否尝试在像素中设置宽度?例如500px – Saeed

+0

@Saeed没有帮助 - 修正'宽度'相同的问题。 –

回答

0

您可以尝试设置默认文档大小。这是我从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;