开发者

How to embed a PDF in a Mobile Web App

开发者 https://www.devze.com 2023-03-07 04:01 出处:网络
I am trying to embed a pdf in my mobile web app and I can\'t seem to get the pdf to automatically scale to the width of the device.

I am trying to embed a pdf in my mobile web app and I can't seem to get the pdf to automatically scale to the width of the device.

I have the following code to show the pdf.

    <embed type="application/pdf" width="100%" height="100%" src="file.pdf" />

If I remove the viewport specification the pdf scales correctly so I am wondering if there is a value I should be changing in this that would allow it to show correctly?

    开发者_C百科<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;" />

Any help would be great, thanks


You really shouldn't be embedding PDF's for a mobile app. Let the phone's native capabilities handle displaying a PDF. <a target="_blank" href="file.pdf">PDF</a>

0

精彩评论

暂无评论...
验证码 换一张
取 消