v26.5
New Feature Sanitize for PDF Security
- Sanitize hidden data from a PDF document, ensuring that sensitive or unnecessary information such as metadata, attachments, annotations, JavaScripts, forms, layers, search index, or private content is removed or transformed.
- Class PdfSecurity: added method Sanitize for sanitizing PDF document.
- Class SanitizeOptions: Represents the configuration options for sanitizing hidden data within a document for PdfSecurity class.
- Property Input: Gets or sets Input Data.
- Property Output: Gets or sets Output Data.
- Property ConvertPagesToImages: Gets or sets the option to convert pages to images.
- Property ImageDpi: Gets or sets the option to resolve page images during pages to image conversion.
- Property RemoveAnnotations: Gets or sets a value indicating whether to remove annotations from the document.
- Property RemoveSearchIndexAndPrivateInfo: Gets or sets a value indicating whether the search index and private information should be removed from the document.
- Property FlattenForms: Gets or sets a value indicating whether forms in the document should be flattened during the sanitization process.
- Property FlattenLayers: Gets or sets the option to flatten the layers in the PDF document.
- Property RemoveJavaScriptsAndActions: Gets or sets a value indicating whether JavaScript and associated actions should be removed from the document.
- Property RemoveMetadata: Gets or sets an option to remove metadata from the document.
- Property RemoveAttachments: Gets or sets the option to remove all attached files from the document.
Example Usage:
The example demonstrates how to Sanitize PDF document.
// Create SanitizeOptions object to set input and output files
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF from stream to stream.
// Prepare input and output streams
using var inputStream = File.OpenRead("path_to_your_pdf_file.pdf");
using var outputStream = new MemoryStream();
// Create SanitizeOptions object to set input and output streams
var options = new SanitizeOptions(inputStream, outputStream);
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF from file to stream.
// Prepare output stream
using var outputStream = new MemoryStream();
// Create SanitizeOptions object to set input file and output stream
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", outputStream);
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF from file to stream with manual setting input and output properties.
// Create SanitizeOptions object
var options = new SanitizeOptions();
//Set Input file
options.Input = new FileData("path_to_your_pdf_file.pdf");
//Set Output file
options.Output = new FileData("path_to_result_pdf_file.pdf");
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF without removing Metadata.
// Create SanitizeOptions object to set input and output files
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
options.RemoveMetadata = false;
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF without removing Attachments.
// Create SanitizeOptions object to set input and output files
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
options.RemoveAttachments = false;
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF with converting all pages to images and set result dpi.
// Create SanitizeOptions object to set input and output files
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
// Turn on conversion and set dpi
options.ConvertPagesToImages = true;
options.ImageDpi = 200;
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF without removing JavaScripts and Actions.
// Create SanitizeOptions object to set input and output files
var options = new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf");
options.RemoveJavaScriptsAndActions = false;
// Perform the process
PdfSecurity.Sanitize(options);Example Usage:
The example demonstrates how to Sanitize PDF file in the shortest possible style.
PdfSecurity.Sanitize(new SanitizeOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf"));New Class OptionsWithInputAndOutput
- Represents base Options for operations with 1 Input Data and 1 Output Data.
- Based on OptionsWithInput.
- Property Input: Gets or sets Input Data.
- Property Output: Gets or sets Output Data.
Improved PDF to JPEG Conversion Performance
Updated product page “FAQs” for this site
https://docs.documentize.com/faqs/
Other fixes
- Fixed Large HTML to PDF conversion speed problem
- Fixed PDF to HTML: OutOfMemoryException occurs
- Fixed PDF to PDFA: page content is cut off
- Fixed PDF to PDFA: transparent image rendering problem
- Fixed PDF to PDFA2b: annotations are lost in output
- Fixed PDF to PDF/A - Image appears inverted in output file
- Fixed PDF to PDF/A - Resulting file fails PDF/A_2a compliance
- Fixed PDF to PDF/A - Resulting file fails compliance
- Fixed PDF to PDF/A - Signature turns black after conversion
- Fixed PDF to PDF/A - Text justification changes unexpectedly
- Fixed PDF to PNG - Conversion takes excessive time
- Fixed PDF to PNG - Output image is incorrect
- Fixed PDF to PNG - Output image shows dark banding
- Fixed Unable to validate document’s PDF/A_1b compliance