Question

I am loading a PDF document in my ActiveX using AxAcroPDFLib and iTextSharp libraries. I want to disable the toolbar (that have Save, Print etc options) from the loaded PDF so that user cannot 'Save' the PDF from ActiveX.

I have following code:

axAcroPDF1.Width = someWidth;
axAcroPDF1.Height = someHeight;
axAcroPDF1.LoadFile(documentPath);
axAcroPDF1.setPageMode("none");
axAcroPDF1.setShowToolbar(false);

axAcroPDF1.Show();
axAcroPDF1.Focus();

The axAcroPDF1.setShowToolbar(false) disables the toolbar but the other gray toolbar enables at the bottom ( as shown in figure on this link) of PDF when I move mouse in that area. That toolbar also have saving option in it and I want to disable this one as well.

It would be really nice if it allows to disable only 'Save' option and keep the other options enabled on toolbar.

Was it helpful?

Solution 2

You are asking something that is impossible. Please read this thread dating from December 2011. You'll find a snippet where Leonard Rosenthol, Adobe's PDF architect says: "there is no way to hide the toolbar (or the HUD) in the browser."

Setting the toolbar to false works for the toolbar, but you are referring to the "Heads Up Display" (HUD). As documented by Adobe, there is no way to customize this feature, let me quote Adobe:

the "Heads Up Display" (HUD) is not customizable. There are no APIs to HUD. You can’t use JavaScript to enter Read Mode, exit Read Mode or detect that the document is in Read Mode. Though it might seem like it, this wasn’t an oversight. There are some very sound engineering reasons why this is the case but I won’t go into those here.

OTHER TIPS

I success using

this.axAcroPDF1.src = filePath + "#toolbar=0";

I got succeed using axAcroPDF.src = filepath + "#toolbar = 0"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top