0

It's not a massive deal but would like consistency across browsers and the document would be easier read if it fills the box. In Chrome, increasing the 'width' only increases the margin around the pdf and not itself as it does in Firefox. Any ideas appreciated.

.box {
    height: 70%;
    margin-left: 22%;
    margin-top: 6%;
    width: 57%;
}

<div class="box">
   <object data="/name.pdf" type="application/pdf" width="100%" height="100%">
   <p>It appears you don't have a PDF plugin for this browser.</p>
   </object>
</div>

EDIT: I have added some parameters on the pdf such as ..name.pdf#zoom=100%" but still does not change up in Chrome. Anyone ? ?


The situation is not as bad as you interpreted it to be.

The 20 minutes timeout of the IIS site does not consume cpu if there are no requests happening. The 240 minutes CPU/day means that a single core may be under full load created by your site for 240 minutes.

So if you produce very litte CPU load with your application you can handle lots of requests/visits throughout the day.

4

1 回答 1

0

如果您不需要pdf的数据,只需使用iframe而不是object,

    <div class="tip-win is-display">
        <div class="tip-head">
            <span class="tip-title">Tips</span>
            <span class="close-btn" id="close-btn">✖&lt;/span>
        </div>

        <div class="tip-content" id="tip-content">
            <div>This is a test message</div>
        </div>
        <div class="tip-foot">
            <a class="mini-button blue tip-btn" id="ok-btn">ok</a>
            <a class="mini-button blue tip-btn" id="cancel-btn">cancel</a>
        </div>
    </div>

    <div class="tip-div">
        <iframe id="tip-iframe" class="tip-iframe is-display" height="422" width="602" ></iframe>
    </div>

    <div class="pdf-iframe" id="targetElementID">
        <iframe id="ipdf" src="yyytest.pdf" height="100%" width="100%"></iframe>

    </div>

    css:
    .tip-win {
        position: absolute;
        z-index: 100;
        background: #f6f6f6;
        border: 1px solid #bbb;
        height: 420px;
        width: 600px;
        top: 15%;
        left: 30%
    }

    .tip-div {
        position: absolute;
        z-index: 20;
        top: 15%;
        left: 30%
    }

    .pdf-iframe {
        position: absolute;
        z-index: 10;
        margin-top: 45px;
        height: 90%;
        width: 100%
    }
    .tip-iframe{
        border:none;
    }
    .is-display{
        display: none;
    }
    .tip-head{
        border-bottom: 1px solid #ddd;
        background: #eee;
    }
    .tip-title{
        display: inline-block;
        margin: 5px 20px;
    }
    .close-btn{
        height: 32px;
        line-height: 32px;
        float: right;
        text-align: center;
        width: 32px;
        border-left: 1px solid #bbb;
    }
    .close-btn:hover{
        cursor: pointer;
        background: #ccc;
    }
    .tip-content{
        height: 336px;
        overflow-y: scroll;
        padding-left: 20px;
    }
    .tip-foot{
        border-top: 1px solid #ddd;
        padding: 10px;
        text-align: center;
        background: #eee;
    }
    .tip-btn{
        font-size: 12px;
        padding: 4px 16px !important;
    }

    <script>
    $('#tip-content').html(message);   

        $('.is_display').css('display','block');   
        $('.sb-btn').attr('disabled','disabled'); 

        $('.tip-btn').click(function(){  
            var id = $(this).attr('id');
            if(id==="ok-btn"){
                closeTip();
                send2SB02();
            }else{
                closeTip();
            }
        });
        // “X”
        $('#close-btn').click(closeTip);

    function closeTip() {
        $('.is_display').css('display','none');   
        $('.sb-btn').removeAttr('disabled'); 
        return false;
    }
    </script>
于 2016-09-28T10:20:13.380 回答