简体   繁体   English

HTML,调整大小后嵌入pdf

[英]HTML, resized embed pdf

I have embedded a pdf using this javascript function: 我已经使用此javascript函数嵌入了pdf:

screenshotPreview = function(filename){    

    $("#body").append("<p><embed src=" + filename + " type='application/pdf' width='60%' height='60%' class='pdf_image'></p>");                           

};

However, the width and height adjustment doesn't resize the pdf, it just trims the pdf window size, so the user still needs to scroll within this window to see the whole pdf. 但是,宽度和高度调整并不会调整pdf的大小,它只是调整pdf窗口的大小,因此用户仍然需要在此窗口中滚动才能查看整个pdf。

Any suggestions? 有什么建议么? I've tried using scale='tofit' as well, but see no change. 我也尝试过使用scale ='tofit',但看不到任何变化。

您需要缩放容器而不是嵌入容器。

缩放包含div而不是嵌入的div。

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

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