问题描述:

My code is as under to open a pdf on page , but I want to remove save and print toolbar from my PDF

 protected void Button1_Click(object sender, EventArgs e)

{

string FilePath = Server.MapPath("javascript1-sample.pdf");

WebClient User = new WebClient();

Byte[] FileBuffer = User.DownloadData(FilePath);

if (FileBuffer != null)

{

Response.ContentType = "application/pdf";

Response.AddHeader("content-length", FileBuffer.Length.ToString());

Response.BinaryWrite(FileBuffer);

}

}

网友答案:

When you create the PDF, you can disable the save and print permissions. So, even if the toolbar is displayed, the options won't be enabled. You can modify the permissions on an existing PDF as well. Of course, you need some PDF software or library to modify the permissions.

相关阅读:
Top