我正在使用Spire XLS库将excel转换为pdf。 有没有办法将只读/不可编辑的属性添加到pdf文件中?
我的编码如下。感谢。
Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
//set cell value
using (MemoryStream memoryStream = new MemoryStream())
{
wb.SaveToStream(memoryStream, Spire.Xls.FileFormat.PDF);
byte[] bytes = memoryStream.ToArray();
memoryStream.Close();
using (MailMessage mailMessage = new MailMessage())
{
// SMTP Setting
mailMessage.Attachments.Add(new Attachment(new MemoryStream(bytes), "Attachment.pdf", "Application/pdf"));
}
}