Reputation: 11257
I'm showing multipage PDFs using html5 object tag.
<object data="receipt.pdf"/>
The object tag, additionally, renders some additional controls for the PDF - there is a header with some buttons (pdf_name, page number, rotate, download, print).
The Problem: When the user scrolls the pdf down, the header hides. It is essential for our case, the page number to be always shown.
Question: Is there some object
data property (or option), governing the behavior of the said header.
Upvotes: 0
Views: 530
Reputation: 1455
I think what you are asking is not currently supported. I have made a walkaround this and I don't see any possibility for doing it. Take into account that what opens the PDF is an Acrobat's extension where you don't have access to the code. For example, in Chrome, I have seen that the behavior that hide and shows the toolbar is a Javascript called viewer-pdf-toolbar.js
that has the following piece of code:
_onAnimationFinished: function() {
this.style.transform = this.opened ? 'none' : 'translateY(-100%)';
}
If you open the developer tools and do an inspection on the HTML object it will open the index.html of the chrome extension, where the toolbar has this HTML when not visible:
<viewer-pdf-toolbar id="toolbar" style="transform-origin: 50% 0px 0px; transform: translateY(-100%);"></viewer-pdf-toolbar>
And this when it is visible transform changed:
<viewer-pdf-toolbar id="toolbar" style="transform-origin: 50% 0px 0px; transform: none;"></viewer-pdf-toolbar>
Nevertheless, Acrobat let you open the PDF with some parameters such as enable/disable the navigation and toolbar. Take a look to the following document:
https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf
But the option of don't hide the toolbar seems to not be implemented, maybe they will include it in the future.
Upvotes: 1