当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - PDF without Save and Print Toolbar option

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: