einbetten von PDF-Datei in html mit object-tag

I m embeding ein pdf-Dokument in meinem html-code. Dafür habe ich diesen code schrieb.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org

/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title></title>
</head>
<body>
<object height="100%" width="100%" type="application/pdf" data="yii.pdf#toolbar=1&amp;navpanes=0&amp;scrollbar=1&amp;page=1&amp;view=FitH">

<p>It appears you don't have a PDF plugin for this browser. No biggie... you can <a href="/pdf/sample.pdf">click here to download the PDF file.</a></p>

</object>

</body>
</html>

Aber Ergebnis ist eine leere Seite auf FF4 und IE9 bettet die pdf-Datei, sondern seinem Behälter ist sehr klein, fast 30% der Seite. wenn ich Option erste Zeile ich.e DOCTYPE beide Browser rendert pdf-Datei, wie es sollte.
Folgender code funktioniert einwandfrei.

<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title></title>
</head>
<body>
<object height="100%" width="100%" type="application/pdf" data="yii.pdf#toolbar=1&amp;navpanes=0&amp;scrollbar=1&amp;page=1&amp;view=FitH">

<p>It appears you don't have a PDF plugin for this browser. No biggie... you can <a href="/pdf/sample.pdf">click here to download the PDF file.</a></p>

</object>

</body>
</html>

Will ich mit "doctype" in meine Seite, so dass andere Seiten funktionieren. Gibt es einen Weg, das zu beheben erste code enthält doctype?

InformationsquelleAutor mysterious | 2011-05-31
Schreibe einen Kommentar