How to specify parameters to google chrome adobe pdf viewer?

后端 未结 4 354
一生所求
一生所求 2020-11-30 05:32

I have an embed tag like this:


the #zoom=50

相关标签:
4条回答
  • 2020-11-30 06:01

    Use iframe:

    1. It works in Mozilla
    2. It works in Chrome
    3. No Javascript needed

    Example:

    <div id="mypdf">
    <iframe src="/cennik.pdf#zoom=65" style="width: 100%; height: 800px;" frameborder="0" scrolling="no">
            <p>Your web browser doesn't support iframes.</p>
       </iframe>
    </div>
    
    0 讨论(0)
  • 2020-11-30 06:09

    Chrome 86 (2020) on parameters - From the chromium issue (and my notes)

    • view: implemented (accepts Fit, FitH, FitV - for vertical resp horizontal fit)
    • toolbar: implemented (hides top-bar, but not zoom-buttons bottom right)
    • zoom: implemented
    • scrollbar: not implemented
    • page: implemented
    • nameddest: implemented
    • search: filed bug 792647 to track separately
    • navpanes: does not apply
    • statusbar: does not apply
    0 讨论(0)
  • 2020-11-30 06:14

    After checking various chrome bug reports, I can confirm that Google Chrome ignores the default functionality of Adobe PDF viewer. At the time of this answer there is no way to pass parameters (like zoom) to the Chrome PDF viewer.

    EDIT

    Progress has been made on this by the Chromium team. The work was being done with reference to both the Acrobat SDK and RFC 3778. As of Dec 2017 Chromium added support for view, zoom, page, toolbar and nameddest and later made it into Chrome.

    0 讨论(0)
  • 2020-11-30 06:18

    It appears that a later release of Chrome may now be the answer. I had success passing zoom and page parameters through an object tag.

    Case:

    • Set zoom to 200%
    • Set page to 2

    Example:

    <object data="https://your.url/docs/123.pdf#zoom=200&page=2" 
            type="application/pdf" 
            width="100%" 
            height="100%"> 
    </object>
    
    0 讨论(0)
提交回复
热议问题