How to hide PDF toolbar on a ASP:NET page "embed object"
Roberto Guardamagna
1
Reputation point
Hi,
I can correctly load and display a PDF on an ASP.NET page getting the content from a database table.
When the PDF is displayed a toolbar appears (zoom, download, print etc) and I would like to hide it.
Searching on the net I found that there is the "#toolbar=0" parameter to include in the URL to load the PDF but since the content is loaded directly from a database table, I don't have a "real" URL.
The way I load the PDF is tyhe following:
- at first I create a string with the command:
embed = "<object data=\"{0}{1}\" type=\"application/pdf\" width=\"80%\" height=\"1000px\">";
embed += "</object>";
- the PDF is loaded through an ASHX file: ltEmbed.Text = string.Format(embed, ResolveUrl("~/FileCS.ashx?Id="), ID); where the "ID" is a number that identifies the content to load and "ltEmbed" is a "asp:Literal".
I tried different solutions but no one worked so...is there someone who knows how to hide the PDF viewer toolbar?
Thank you, best regards.
Roberto
Developer technologies | ASP.NET | Other
3,600 questions
Sign in to answer