简体   繁体   English

#Zoom = 75 PDF无法在Safari中使用

[英]#Zoom=75 PDF Won't Work For Safari

I am trying to make all linked pdf files that open in a new window to have #zoom=75 appended. 我正在尝试使在新窗口中打开的所有链接的pdf文件附加#zoom = 75。 I've accomplished this and it works nicely in Chrome but Safari doesn't seem to recognize any sort of parameters to the URL (such as zoom or page). 我已经做到了,它在Chrome中很好用,但Safari似乎无法识别URL的任何类型的参数(例如缩放或页面)。 Is there any way around this? 有没有办法解决? Or is Safari unable to zoom or scale PDFs. 还是Safari无法缩放或缩放PDF。

$("a[href*='.pdf']").each(function(){
    this.href = this.href + '#zoom=75';
});

You won't be able to achieve any degree of consistency with the initial view. 您将无法与初始视图实现任何程度的一致性。 Two reasons, 1) very few PDF viewers respect the "open parameters" established by Adobe and 2) very few PDF viewers respect the "initial view" settings in a PDF, so even if you modified the PDF to set the default zoom to be 75%, you still wouldn't get any consistency. 原因有两个:1)很少有PDF查看器会尊重Adobe建立的“打开参数”,以及2)很少有PDF查看器会尊重PDF中的“初始视图”设置,因此即使您修改了PDF并将默认缩放设置为75%,您仍然不会获得任何一致性。

The only reliable solution is to take control of how the PDF is rendered rather than rely on the browser or OS level viewer. 唯一可靠的解决方案是控制PDF的呈现方式,而不是依赖浏览器或OS级别的查看器。 Tools like PDF.js can do that for you but there are others. 诸如PDF.js之类的工具可以为您做到这一点,但还有其他工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM