PDF Security

Шифрование

Зашифруйте свои PDF‑файлы с помощью .NET‑инструментов Documentize, чтобы защитить конфиденциальную информацию.

Расшифровать

Расшифруйте свои PDF‑файлы с помощью .NET‑инструментов Documentize.

Подпись

Цифрово подписывайте PDF-файлы с помощью .NET-инструментов Documentize — обеспечьте безопасность, подлинность и соответствие требованиям без труда.

Очистка

Очистите скрытые данные из PDF с помощью .NET‑инструментов Documentize, гарантируя удаление или преобразование чувствительной или лишней информации, такой как метаданные, вложения, аннотации, JavaScript, формы, слои, поисковый индекс или приватный контент.

Подразделы PDF Security

Шифрование

The Documentize PDF Security for .NET is a powerful tool designed to enhance the security of your PDF documents by providing encryption, decryption and signing capabilities. It ensures that your sensitive information remains confidential and protected from unauthorized access.

Как зашифровать PDF

Чтобы зашифровать PDF‑документ, выполните следующие шаги:

  1. Создайте экземпляр EncryptOptions с желаемыми пользовательским и владельским паролями.
  2. Добавьте входной PDF‑файл с помощью метода AddInput.
  3. Добавьте выходной PDF‑файл с помощью метода AddOutput.
  4. Выполните шифрование с помощью метода Encrypt класса PdfSecurity.
1// Create EncryptOptions object to set instructions
2var options = new EncryptOptions("123456", "qwerty");
3// Add input file path
4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Encrypt(options);

Ключевые возможности:

  • Encrypt PDF Documents: Secure your PDF files by adding user and owner passwords.
  • Automation: Integrate encryption and decryption into your .NET applications for automated workflows.
  • Compliance: Ensure your documents meet industry standards for document security.

Расшифровать

The Documentize PDF Security for .NET is a powerful tool designed to enhance the security of your PDF documents by providing encryption, decryption and signing capabilities. It ensures that your sensitive information remains confidential and protected from unauthorized access.

Как расшифровать PDF

Чтобы расшифровать PDF‑документ, выполните следующие шаги:

  1. Создайте экземпляр DecryptionOptions с необходимым паролем.
  2. Добавьте входной PDF‑файл с помощью метода AddInput.
  3. Добавьте выходной PDF‑файл с помощью метода AddOutput.
  4. Выполните дешифрование с помощью метода Decrypt класса PdfSecurity.
1// Create DecryptOptions object to set instructions
2var options = new DecryptOptions("123456");
3// Add input file path
4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Decrypt(options);

Ключевые особенности:

  • Decrypt PDF Documents: Remove encryption from PDFs when needed.
  • Automation: Integrate encryption and decryption into your .NET applications for automated workflows.
  • Compliance: Ensure your documents meet industry standards for document security.

Подпись

The Documentize PDF Security for .NET component allows users to digitally sign PDF documents. It offers a streamlined process for adding signatures, ensuring authenticity, and securing PDF content. The component supports both visible and invisible signatures and provides options to customize the signature’s position, reason, contact information, and more.

Как подписывать PDF‑документы

Чтобы подписать PDF‑документ с помощью файла PFX, выполните следующие шаги:

  1. Создайте объект класса SignOptions, указав путь к файлу PFX и пароль.
  2. Добавьте входной PDF и путь к выходному файлу в параметры.
  3. Вызовите метод Sign для применения подписи.
1// Create SignOptions object to set instructions
2var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
3// Add input file path
4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Sign(options);

Как использовать поток для файла PFX

Можно также подписать PDF, используя сертификат PFX, предоставленный в виде потока, а не пути к файлу. Это позволяет более гибко работать с хранилищем сертификатов.

1using var pfxStream = File.OpenRead(@"path_to_your_pfx_file.pfx");
2var options = new SignOptions(pfxStream, "password_of_your_pfx_file");
3options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
4options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
5// Perform the process
6PdfSecurity.Sign(options);

Как добавить невидимую подпись

Чтобы добавить невидимую подпись (которая защищает документ, но не отображается в нём), просто установите свойство Visible в false.

  1. Создайте экземпляр SignOptions.
  2. Установите Visible в false.
  3. Добавьте входные и выходные файлы.
  4. Вызовите Sign для применения невидимой подписи.
1var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
2options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
3options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
4// Configure invisible signature
5signOptions.Visible = false;
6// Perform the process
7PdfSecurity.Sign(options);

Как использовать дополнительные параметры подписи PDF‑документов

Можно задать дополнительные параметры, такие как Reason, Contact, Location, PageNumber.

  1. Создайте объект SignOptions, указав путь к файлу PFX и пароль.
  2. Добавьте входной PDF и путь к выходному файлу.
  3. Установите нужные значения параметров.
  4. Вызовите метод Sign.
 1// Create SignOptions object to set instructions
 2var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
 3// Add input file path
 4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
 5// Set output file path
 6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
 7// Optional parameters
 8options.Reason = "my Reason";
 9options.Contact = "my Contact";
10options.Location = "my Location";
11options.PageNumber = 3;
12// Perform the process
13PdfSecurity.Sign(options);

Как добавить отметку времени в PDF

Чтобы добавить защищенную отметку времени в PDF‑документ, выполните следующие действия:

  1. Создайте экземпляр AddTimestampOptions для настройки процесса отметки времени.
  2. Добавьте входной PDF‑файл с помощью метода AddInput.
  3. Установите путь к выходному файлу через AddOutput.
  4. Выполните отметку времени, вызвав метод Sign.
1// Create SignOptions object to set instructions
2var options = new SignOptions("path_to_your_pfx_file.pfx", "password_for_your_pfx_file");
3options.TimestampOptions = new TimestampOptions("server_url");
4// Add input file path
5options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
6// Set output file path
7options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
8// Perform the process
9PdfSecurity.Sign(options);

Как использовать пользовательскую аутентификацию с сервером отметок времени

Можно указать учетные данные базовой аутентификации при подключении к серверу отметок времени. Это позволяет работать с серверами, требующими имя пользователя и пароль.

1// Configure the timestamping options with authentication
2options.TimestampOptions = new TimestampOptions("timestamp_server_url", "username:password");

Ключевые возможности:

  • Цифровая подпись PDF‑документов: Защищайте документы видимыми или невидимыми цифровыми подписями.
  • Поддержка PFX: Подписывайте PDF‑файлы с помощью сертификата PFX.
  • Настраиваемые параметры: Конфигурируйте подпись — причина, место, контактные данные и т.д.
  • Видимые и невидимые подписи: Выбирайте, будет ли подпись отображаться в документе.
  • Настраиваемые серверы отметок времени: Используйте свои URL‑адреса серверов отметок времени и учетные данные для аутентификации.

Очистка

The Documentize PDF Security for .NET component allows users to sanitize PDF documents. It offers a streamlined process for remove sensitive or unnecessary information such as metadata, attachments, annotations, JavaScripts, forms, layers, search index, or private content. The component provides options to customize information that will be deleted.

Clearing information

  • Metadata
  • Attachments
  • Annotations
  • Java Scripts
  • Forms
  • Layers
  • Search index

Как очистить PDF‑документы

Чтобы очистить PDF‑файл, выполните следующие шаги:

  1. Создайте объект класса SanitizeOptions, указав путь к входному файлу и путь к выходному файлу.
  2. Вызовите метод Sanitize для выполнения очистки.
1// Create SanitizeOptions object to set input and output files
2var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
3// Perform the process
4PdfSecurity.Sanitize(options);

Как использовать потоки для входных и выходных данных

Можно также выполнять очистку PDF‑документов, предоставленных в виде потока, вместо указания пути к файлу.

1// Prepare input and output streams
2using var inputStream = File.OpenRead("path_to_your_pdf_file.pdf");
3using var outputStream = new MemoryStream();
4// Create SanitizeOptions object to set input and output streams
5var options = new SanitizeOptions(inputStream, outputStream);
6// Perform the process
7PdfSecurity.Sanitize(options);

Как очистить из файла в поток

Можно задать различные типы входных и выходных данных.

1// Prepare output stream
2using var outputStream = new MemoryStream();
3// Create SanitizeOptions object to set input file and output stream
4var options = new SanitizeOptions("path_to_your_pdf_file.pdf", outputStream);
5// Perform the process
6PdfSecurity.Sanitize(options);

Как очистить из файла в поток через свойства

Можно задать разные типы входных и выходных данных, используя свойства.

 1// Prepare output stream
 2using var outputStream = new MemoryStream();
 3// Create SanitizeOptions object
 4var options = new SanitizeOptions();
 5//Set Input file
 6options.Input = new FileData("path_to_your_pdf_file.pdf");
 7//Set Output stream
 8options.Output = new StreamData(outputStream);
 9// Perform the process
10PdfSecurity.Sanitize(options);

Как выполнить очистку без удаления метаданных

Просто установите свойство RemoveMetadata в значение false.

1// Create SanitizeOptions object to set input and output files
2var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
3options.RemoveMetadata = false;
4// Perform the process
5PdfSecurity.Sanitize(options);

Как выполнить очистку без удаления вложений

Просто установите свойство RemoveAttachments в значение false.

1// Create SanitizeOptions object to set input and output files
2var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
3options.RemoveAttachments = false;
4// Perform the process
5PdfSecurity.Sanitize(options);

Как выполнить очистку с конвертацией всех страниц в изображения и указанием DPI результата

В примере показано, как очистить PDF с конвертацией всех страниц в изображения и задать DPI результата. Установите свойство ConvertPagesToImages в true. При необходимости измените ImageDpi.

1// Create SanitizeOptions object to set input and output files
2var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
3// Turn on conversion and set dpi
4options.ConvertPagesToImages = true;
5options.ImageDpi = 200;
6// Perform the process
7PdfSecurity.Sanitize(options);

Как выполнить очистку без удаления JavaScript и действий

Просто установите свойство RemoveJavaScriptsAndActions в значение false.

1// Create SanitizeOptions object to set input and output files
2var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
3options.RemoveJavaScriptsAndActions = false;
4// Perform the process
5PdfSecurity.Sanitize(options);

Как выполнить очистку PDF‑файла в самом коротком виде

1PdfSecurity.Sanitize(new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf"));

Ключевые возможности:

  • Sanitize PDF Documents: Cleaning a document of potentially dangerous data.
  • Customizable options: Choose what to delete and what to leave.
  • Convert to images: Convert pages to images, but stay as PDF.
 Русский