Customize The PDF Viewer When Embedding A PDF - Tinytip

Skip to contentCustomize the PDF viewer when embedding a PDFMarch 4, 2022#html #pdf

If you want to embed a PDF document on your website you can use an iFrame. The browser will automatically render a PDF viewer.

Google Chrome, Firefox and Safari accept some parameters to customize the viewer. Add the parameters as part of the url fragment (after the #). Multiple parameters can be separated by &.

<iframe src="/path/to/document.pdf#toolbar=0"></iframe>

The following parameters are supported:

ParameterValueDescriptionSupport
toolbar1, 0Show or hide the toolbarChrome
viewFitV, FitH, FitChange the zoom level to fit (vertical, horizontal or both)Chrome
zoomnumberSet a specific zoom level in % (example: 300)Chrome, FF
pagenumberSet initial position to a specific page (example: 2)Chrome, FF, Safari
nameddeststringSet initial position to a named destination (like a heading)Chrome
searchstringSearch for a string in the documentFF

Related articles #html

  • Edit any website in design mode
  • The CSS list-style property affects screen readers
  • Let VoiceOver on iOS read a split element as a single element with the text role

Từ khóa » Html Google Pdf Viewer