Anchor link PDF work around

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 08:46:39

问题


In IE currently anchor linking to a section on a PDF only works if the PDF in question is cached or has been downloaded recently on the user's computer.

Example

User clicks anchor link to pdf first time 
    PDF loads at the beginning of document
User goes back to website and clicks link again
    PDF loads at anchor linked position

Does anyone know of a work around in which the PDF will load at the desired position upon first clicking the link?

Note that the anchor links are of the type #page=200 and fit these guidelines http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf


回答1:


Here is my current solution, while not perfect it works.

<div class="hidden" id="iframes"></div> //-- hidden div at bottom of page 

$(function() {
    var urls = ["url one", "url two", "etc..."];
    $(urls).each(function(index, url) {
        var iframe = $("<iframe />").attr({ src: url });
        $("#iframes").append(iframe);
    });
});


来源:https://stackoverflow.com/questions/4997017/anchor-link-pdf-work-around

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!