是否可以通过JavaScript设置默认的缩放或控制Microsoft Edge内置的PDF查看器?
我正在研究一个在iframe中显示PDF的应用程序。我想将其打开为“适合宽度”。在JavaScript中,我添加#view = fith
:
<iframe id="previewFrame" frameborder="0" src="' + link + '#view=FitH"></iframe>
这在Chrome和Firefox中起作用,但不在边缘。
有没有办法将Edge PDF查看器中的默认缩放设置?
或从JavaScript控制查看器,例如pdfzoominbutton.click()
?
update:
该文件的实际链接看起来像
https://myapp/services.asmx/downloadfile?id = someid#view = fith = fith
在服务器端上复杂的过程,但最终将文件加载到流中,然后以响应为stream.copyto(wendys.outputstream);
以响应发送。
I'm working on an application which displays PDF in iframe. I'd like to open it as "Fit to width". In JavaScript I add #view=FitH
:
<iframe id="previewFrame" frameborder="0" src="' + link + '#view=FitH"></iframe>
This works in Chrome and Firefox, but not in Edge.
Is there a way how to set the default zoom in Edge's PDF Viewer?
Or control the Viewer from JavaScript, something like pdfZoomInButton.click()
?
Update:
The actual link to the file looks like this
https://myApp/Services.asmx/DownloadFile?id=someId#view=FitH
On the server side there's quite complicated process but in the end the file is loaded into a stream and then sent as response like this stream.CopyTo(response.OutputStream);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没问题,这些指令用URL术语“碎片”,因此不能从父母那里分散。该约定是由Adobe引入的,供PDF插件与PDF插件一起使用,因此整个字符串需要由PDF查看器处理。所有浏览器的使用方式不同,边缘在尊重Adobe措辞方面更好,而Firefox则使用自己对不同措辞的响应。在所有情况下,它们都是Adobe的全部曲目。除Acrobat以外的其他插件可能只是对某些或无响应,具体取决于它们的传输方式。
边缘 中的内联框架
我看到相反的最新firefox版本不适用于#ACROBATVIEWTAGS 第一个示例是本地第二个示例,没有被移交。
No problem, those directives are in url terms "fragments" thus must not be fragmented from their parent. The convention was introduced by Adobe for use with PDF plugins, so the whole string needs to be handled as one by the pdf viewer. All browsers use differently, Edge is better at respecting Adobe phrasing whereas Firefox use their own response to different phrasing. In all cases they are a sub set of Adobe's full repertoire. Plug-ins other than Acrobat may just respond to some or none, depending on how they are transferred.
The inline Frame in Edge
I see the opposite latest Firefox versions do not work with #AcrobatViewTags 1st example is native 2nd example is where tags do not get handed over.