1

Tested with IE9 and Firefox, problem does not occur in Firefox.

I am using

<object data="/generatepdf/docid=23" width="960" height="1360"></object>

to embed a pdf, and when I break into the server code of the generator or check the weblog, I can see that the data url is always being called exactly three times for one single request - generating the same pdf three times.

When I replace the same thing with

<iframe src="/generatepdf/docid=23" width="960" height="1360"></iframe>

then I do not get this weird effect. But I like the way displays better, no scrollbars and the pdf seems to get more control (a toolbar that appears on mouseover), plus the iframe sometimes overlaps with an autocomplete.


Your property should be Attached DependancyProperty. Update your property declaration like:

public static readonly DependencyProperty OpenDropDownAutomaticallyProperty = 
                           DependencyProperty.RegisterAttached("OpenDropDownAutomatically",
                             typeof(bool),
                             typeof(ComboBox_ForceDropDown),
                             new UIPropertyMetadata(false, onOpenDropDownAutomatically_Changed)
                            );
4

2 回答 2

1

答案就在这里(Pete 的评论):

MVC Filestream 多次调用

IE 的行为是“设计使然”,它首先要确定内容类型(通过检查 useragent = "contype" 然后返回没有数据的文档很容易在服务器上捕获),然后再次加载文档只是为了它的味道(或者至少我还不能确定如何摆脱第二次获取 - 引荐来源正在改变,这可能会有所帮助),然后最后第三次调用加载文档。KB 记录了 IE 5.5 的这种行为,但我在 IE 8 + 9 中看到了同样的情况。

于 2013-10-24T15:21:46.737 回答
-1

如果您唯一关心的是 PDF 文件的打开方式,那么您可以使用 PDF 打开参数来更改 Adob​​e PDF 插件的行为,如下所示:

http://example.org/doc.pdf#Chapter6
http://example.org/doc.pdf#page=3
http://example.org/doc.pdf#page=3&zoom=200,250,100
http://example.org/doc.pdf#zoom=50
http://example.org/doc.pdf#page=72&view=fitH,100
http://example.org/doc.pdf#pagemode=none
http://example.org/doc.pdf#pagemode=bookmarks&page=2
http://example.org/doc.pdf#page=3&pagemode=thumbs
http://example.org/doc.pdf#collab=DAVFDF@http://review_server/Collab/user1
http://example.org/doc.pdf#page=1&comment=452fde0e-fd22-457c-84aa-2cf5bed5a349
http://example.org/doc.pdf#fdf=http://example.org/doc.fdf

您可以在此处找到更多信息http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf

于 2015-01-18T07:18:09.307 回答