安全な PDF ドキュメント

Contents
[ ]

Aspose.Cells はAspose.Cells.Rendering.PdfSecurityセキュリティを扱うための名前空間。以下のサンプル コードは、PDF を Aspose.Cells で保護する方法を示しています。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Open an Excel file
Workbook workbook = new Workbook(dataDir+ "input.xlsx");
// Instantiate PDFSaveOptions to manage security attributes
PdfSaveOptions saveOption = new PdfSaveOptions();
saveOption.SecurityOptions = new Aspose.Cells.Rendering.PdfSecurity.PdfSecurityOptions();
// Set the user password
saveOption.SecurityOptions.UserPassword = "user";
// Set the owner password
saveOption.SecurityOptions.OwnerPassword = "owner";
// Disable extracting content permission
saveOption.SecurityOptions.ExtractContentPermission = false;
// Disable print permission
saveOption.SecurityOptions.PrintPermission = false;
// Save the PDF document with encrypted settings
workbook.Save(dataDir+ "securepdf_test.out.pdf", saveOption);