Go to specific page when embedding a PDF in HTML

I am trying to insert a pdf file in HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<head>
    <title></title>
</head>
<body leftmargin="0" topmargin="0">

<embed src="mypdffile.pdf#page=9" style="width:595px; height:841px;"></embed>
</body>

According to the PDF SDK https://docs.google.com/viewer?url=http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters_v9.pdf#search=&embedded=true&chrome=true you can go to a specific page when opening a pdf document. But it does not work, at least in Safari with AdobePDFViewer.plugin on MAC OS X.

Did I miss something?

+3
source share
1 answer

You can use the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<object type="application/pdf" data="mypdffile.pdf" width="995" height="841" ></object>
<a href="mypdffile.pdf#page=9">Jump to page 9</a>
</body>
</html>

You can further modify the pdf file and what you want to show / hide adding data attributes (in accordance with adobe directions).

for instance data="mypdffile.pdf#navpanes=0&scrollbar=0&toolbar=0&zoom=100

+3

Source: https://habr.com/ru/post/1762611/


All Articles