C1Report では、下記の PDF のセキュリティ情報を設定することができます。
セキュリティ情報を設定するには、PdfFilter.PdfSecurityOptions プロパティを使用します。
| Visual Basic |
コードのコピー
|
|---|---|
' PDFフィルタを生成して詳細なPDFセキュリティ情報を設定します。 Dim pdf As New PdfFilter("security.pdf") ' ユーザーパスワード pdf.PdfSecurityOptions.UserPassword = "user" ' 所有者パスワード pdf.PdfSecurityOptions.OwnerPassword = "new" 'pdf.Password = "old" ' 印刷と注釈を許可 pdf.PdfSecurityOptions.AllowPrint = True pdf.PdfSecurityOptions.AllowEditAnnotations = True ' 編集とコピーを禁止 pdf.PdfSecurityOptions.AllowEditContent = False pdf.PdfSecurityOptions.AllowCopyContent = False ' フォントを埋め込んでPDFファイルを出力します。 pdf.EmbedFonts = True C1Report1.RenderToFilter(pdf) |
|
| C# |
コードのコピー
|
|---|---|
// PDFフィルタを生成して詳細なPDFセキュリティ情報を設定します。
PdfFilter pdf = new PdfFilter("security.pdf");
// ユーザーパスワード
pdf.PdfSecurityOptions.UserPassword = "user";
// 所有者パスワード pdf.PdfSecurityOptions.OwnerPassword = "new"; //pdf.Password = "old";
// 印刷と注釈を許可
pdf.PdfSecurityOptions.AllowPrint = true; pdf.PdfSecurityOptions.AllowEditAnnotations = true;
// 編集とコピーを禁止 pdf.PdfSecurityOptions.AllowEditContent = false;
pdf.PdfSecurityOptions.AllowCopyContent = false;
// フォントを埋め込んでPDFファイルを出力します。 pdf.EmbedFonts = true;
c1Report1.RenderToFilter(pdf);
|
|