Developer's Guide

PDF Converter

PDF to HTML

Convert PDF to HTML with Documentize's .NET tools—preserve layout and formatting for consistent, professional results.

PDF to HTML

Convert PDF to HTML with Documentize's .NET tools—preserve layout and formatting for consistent, professional results.

PDF to DOC

Convert PDFs to Word documents with Documentize's .NET tools—preserve formatting and structure for easy editing.

HTML to PDF

Convert HTML to PDF with Documentize's .NET tools—preserve layout and formatting for consistent, professional results.

PDF to JPEG

Convert PDFs to JPEG images with Documentize's .NET tools—extract high-quality images from your documents effortlessly.

PDF to PDF/A

Convert PDFs to PDF/A format with Documentize's .NET tools—ensure long-term archiving and compliance with ease.

PDF to PNG

Convert PDFs to PNG images with Documentize's .NET tools—extract high-quality images for web and graphic use.

PDF to TIFF

Convert PDFs to TIFF images with Documentize's .NET tools—extract high-resolution images for professional document management.

PDF to XLS

Convert PDFs to Excel with Documentize's .NET tools—extract tables and data quickly for seamless analysis and processing.

PDF Extractor

Extract Text

Extract text from PDFs accurately with Documentize's .NET tools—retrieve, process, and analyze content effortlessly.

Extract Text

Extract text from PDFs accurately with Documentize's .NET tools—retrieve, process, and analyze content effortlessly.

Extract Images

Effortlessly extract images from PDF documents from within .NET applications

Export Form Data

Extract and export data from PDF forms (AcroForms) into other formats like CSV using C# .NET

PDF Manager

Merge PDF

Merge PDFs easily with Documentize's .NET tools—combine multiple files into one while preserving quality and structure.

Merge PDF

Merge PDFs easily with Documentize's .NET tools—combine multiple files into one while preserving quality and structure.

Split PDF

Split PDFs effortlessly with Documentize's .NET tools—extract pages, create new files, and manage documents with precision

Optimize PDF

Optimize your PDFs effortlessly with Documentize's .NET tools—reduce file size, enhance performance, and maintain quality

Add Table

Generate professional PDF tables with Documentize's .NET tools—customize layouts, styles, and data with ease.

Add TOC

Enhance the organization and navigation of PDF documents by dynamically generating a Table of Contents (TOC)

Use ChatGPT

Enhance your PDFs with AI using Documentize's ChatGPT integration—generate, edit, and analyze content intelligently.

PDF Security

Encrypt

Encrypt your PDF files with Documentize's .NET tools to protect sensitive information.

Encrypt

Encrypt your PDF files with Documentize's .NET tools to protect sensitive information.

Decrypt

Decrypt your PDF files with Documentize's .NET tools to open documents.

Sign

Digitally sign PDF files with Documentize's .NET tools—ensure security, authenticity, and compliance with ease.

PDF Form

PDF Form Flattener

Convert interactive PDF forms into non-editable documents, making them secure from unauthorized modifications

PDF Form Flattener

Convert interactive PDF forms into non-editable documents, making them secure from unauthorized modifications

Sep 12, 2024

Subsections of Developer's Guide

PDF Converter

PDF to HTML

Convert PDF to HTML with Documentize's .NET tools—preserve layout and formatting for consistent, professional results.

PDF to DOC

Convert PDFs to Word documents with Documentize's .NET tools—preserve formatting and structure for easy editing.

HTML to PDF

Convert HTML to PDF with Documentize's .NET tools—preserve layout and formatting for consistent, professional results.

PDF to JPEG

Convert PDFs to JPEG images with Documentize's .NET tools—extract high-quality images from your documents effortlessly.

PDF to PDF/A

Convert PDFs to PDF/A format with Documentize's .NET tools—ensure long-term archiving and compliance with ease.

PDF to PNG

Convert PDFs to PNG images with Documentize's .NET tools—extract high-quality images for web and graphic use.

PDF to TIFF

Convert PDFs to TIFF images with Documentize's .NET tools—extract high-resolution images for professional document management.

PDF to XLS

Convert PDFs to Excel with Documentize's .NET tools—extract tables and data quickly for seamless analysis and processing.

Subsections of PDF Converter

PDF to HTML

The Documentize PDF Converter for .NET provides robust capabilities for converting documents PDF to HTML format, ideal for web applications, archiving, and report generation. With multiple options for handling resources and layouts, the converter adapts to various project requirements.

Converting PDF to HTML

Convert PDF files to HTML to make documents accessible for web-based viewing or integration into applications where HTML format is preferred.

  1. Configure Options: Use PdfToHtmlOptions to customize output, choosing either embedded or external resources.
  2. Define Input and Output Paths: Set the paths for your input PDF and output HTML.
  3. Execute the Conversion: Call the Convert method of PdfConverter to convert the file.

Example: Convert PDF to HTML with Embedded Resources

1// Create PdfToHtmlOptions object to set output data type as file with embedded resources
2var options = new PdfToHtmlOptions(PdfToHtmlOptions.SaveDataType.FileWithEmbeddedResources);
3// Add input file path
4options.AddInput(new FileDataSource("path_to_input.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_output.html"));
7//Perform the process
8PdfConverter.Convert(options);

Available Options for PDF to HTML Conversion

  • SaveDataType:
    • FileWithEmbeddedResources: Generates a single HTML file with all resources embedded.
    • FileWithExternalResources: Saves resources separately, ideal for large HTML files.

PDF to DOC

The Documentize PDF Converter for .NET is a powerful tool designed to convert PDF documents into DOC or DOCX formats. This plugin seamlessly transforms PDF pages into editable Microsoft Word documents, making it easy to reuse, edit, and share content across multiple platforms.

How to Convert PDF to DOC/DOCX

To convert a PDF document to DOC/DOCX format, follow these steps:

  1. Create an instance of PdfToDocOptions to configure the conversion process.
  2. Add the input PDF file using the AddInput method.
  3. Add the output file path for the resulting file using the AddOutput method.
  4. Run the Convert method to execute the conversion.
1// Create PdfToDocOptions object to set instructions
2var options = new PdfToDocOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_file.doc"));
7// Perform the process
8PdfConverter.Convert(options);

Converting PDF to DOC with Custom Options

The PDF to DOC Converter plugin provides several options to customize your conversion process. You can choose between different modes to control how the layout and structure of the PDF are handled during conversion.

 1// Create PdfToDocOptions object to set instructions
 2var options = new PdfToDocOptions();
 3// Add input file path
 4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 5// Set output file path
 6options.AddOutput(new FileDataSource("path_to_result_file.doc"));
 7// Set Mode
 8options.Mode = DocConversionMode.Flow;
 9// Perform the process
10PdfConverter.Convert(options);

Key Features:

  • DOC/DOCX Conversion: Convert PDF documents to editable Microsoft Word formats (DOC or DOCX).
  • Maintain Formatting: Retain the original layout, text, and formatting during the conversion process.
  • Custom Conversion Options: Fine-tune the conversion process with different modes, like Enhanced Flow, for better layout.

HTML to PDF

The Documentize PDF Converter for .NET provides robust capabilities for converting documents between HTML to PDF format, ideal for web applications, archiving, and report generation. With multiple options for handling resources and layouts, the converter adapts to various project requirements.

Converting HTML to PDF

Transform HTML content into high-quality PDFs, perfect for generating printable reports, archiving web content, or creating shareable document formats. To convert an HTML document to a PDF, follow these steps:

  1. Configure Options: Use HtmlToPdfOptions to define layout and media settings.
  2. Specify Paths: Set input HTML and output PDF file paths.
  3. Execute the Conversion: Run the Convert method of PdfConverter to convert the file.

Example: Convert HTML to PDF

1// Create HtmlToPdfOptions
2var options = new HtmlToPdfOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_input.html"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_output.pdf"));
7//Perform the process
8PdfConverter.Convert(options);

Additional Options for HTML to PDF Conversion

  • Media Type:

    • HtmlMediaType.Print: Ideal for generating PDFs suited for printing.
    • HtmlMediaType.Screen: Use when converting content designed for digital viewing.
  • Layout Adjustments:

    • PageLayoutOption: Adjusts how HTML content fits the PDF layout, like ScaleToPageWidth to ensure the content scales to the PDF width.
    • IsRenderToSinglePage: Enables rendering the entire HTML content on a single PDF page if needed for concise presentations.

This converter is versatile for a variety of applications, from generating PDF reports based on web content to converting archives of PDF documents for web-based accessibility. For more advanced configurations, refer to the full Documentize documentation.

PDF to JPEG

The Documentize PDF Converter for .NET is a powerful tool that simplifies the conversion of PDF documents into high-quality JPEG images. This plugin is designed to make your content more accessible across platforms by transforming PDF pages into widely-used image formats.

How to Convert PDF Pages to JPEG

To convert a PDF document into JPEG images, follow these steps:

  1. Create an instance of PdfToJpegOptions to configure the conversion process.
  2. Add the input PDF File using the AddInput method.
  3. Set the output Directory path for the JPEG images using the AddOutput method.
  4. Run the Convert method to convert the PDF pages into JPEG images.
1// Create PdfToJpegOptions object to set instructions
2var options = new PdfToJpegOptions();
3// Add input File path
4options.AddInput(new FileDataSource("path_to_input.pdf"));
5// Set output Directory path
6options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
7// Perform the process
8PdfConverter.Convert(options);

Customizing PDF to JPEG Conversion

You can customize the conversion process by adjusting resolution, selecting page ranges, or setting image quality. Here’s how to convert the first page of a PDF at 200 DPI:

 1// Create PdfToJpegOptions object to set instructions
 2var options = new PdfToJpegOptions();
 3// Process only the first page
 4options.PageList = [1];
 5// Set output resolution to 200 DPI
 6options.OutputResolution = 200;
 7// Set output quality to 50
 8options.Quality = 50;
 9// Add input File path
10options.AddInput(new FileDataSource("path_to_input.pdf"));
11// Set output Directory path
12options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
13// Perform the process
14PdfConverter.Convert(options);

How to get results without a directory, or in the form of streams

The Convert method returns a ResultContainer object that holds information about the conversion results. You can get streams of the converted JPEG files as shown below:

 1// Create PdfToJpegOptions object to set instructions
 2var options = new PdfToJpegOptions();
 3// Add input File path
 4options.AddInput(new FileDataSource("path_to_input.pdf"));
 5// Perform the process
 6var results = PdfConverter.Convert(options);
 7// Get stream results
 8foreach (var result in results.ResultCollection)
 9{
10    var streamResultPage1 = result.ToStream();
11}

Key Features:

  • Convert PDF to JPEG: Effortlessly convert entire PDF documents or specific pages into JPEG images.
  • Custom Resolution: Adjust the resolution (e.g., 300 dpi) for high-quality outputs.
  • Page set: Select specific pages for conversion.
  • Quick Conversion: Fast and efficient process with minimal effort.

PDF to PDF/A

The Documentize PDF Converter for .NET is a powerful tool designed to convert PDF documents into the PDF/A format, ensuring that your content remains compliant with long-term archiving standards. This plugin also supports validating existing PDF documents for PDF/A compliance, offering both conversion and validation features in a single solution.

How to Convert PDF to PDF/A

To convert a PDF document into PDF/A format, follow these steps:

  1. Create an instance of PdfToPdfAOptions to configure the conversion.
  2. Specify the desired PDF/A version (e.g., PDF/A-3B).
  3. Add the input PDF file using the AddInput method.
  4. Add the output file for the resulting PDF/A using the AddOutput method.
  5. Call the Convert method to execute the conversion.
 1// Create the options class to set up the conversion process
 2var options = new PdfToPdfAOptions
 3{
 4    PdfAVersion = PdfAStandardVersion.PDF_A_3B
 5};
 6
 7// Add the source file
 8options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf")); // replace with your actual file path
 9
10// Add the path to save the converted file
11options.AddOutput(new FileDataSource("path_to_the_converted_file.pdf"));
12
13// Run the conversion
14PdfConverter.Convert(options);

Validating PDF/A Compliance

You can validate existing PDF files for PDF/A compliance using the PdfAValidateOptions class.

 1// Create the options class to set up the validation process
 2var options = new PdfAValidateOptions
 3{
 4    PdfAVersion = PdfAStandardVersion.PDF_A_1A
 5};
 6
 7// Add one or more files to be validated
 8options.AddInput(new FileDataSource("path_to_your_first_pdf_file.pdf")); // replace with your actual file path
 9options.AddInput(new FileDataSource("path_to_your_second_pdf_file.pdf"));
10// add more files as needed
11
12// Run the validation and get results
13var resultContainer = PdfConverter.Validate(options);
14
15// Check the resultContainer.ResultCollection property for validation results for each file:
16for (var i = 0; i < resultContainer.ResultCollection.Count; i++)
17{
18    var result = resultContainer.ResultCollection[i];
19    var validationResult = (PdfAValidationResult) result.Data;
20    var isValid = validationResult.IsValid; // Validation result for the i-th document
21}

Key Features:

  • Convert to PDF/A: Seamlessly transform PDF files into the PDF/A format (such as PDF/A-1a, PDF/A-2b, PDF/A-3b) to ensure compliance with archiving standards.
  • Validate PDF/A Compliance: Check existing PDF documents for conformance with PDF/A standards and identify issues if they do not comply.
  • Efficient Workflow: Minimize time and effort with fast and reliable conversion processes.

PDF to PNG

The Documentize PDF Converter for .NET is an advanced tool that allows you to convert PDF documents into high-quality PNG images. This plugin is designed to make your content more versatile, accessible, and easier to share by transforming PDF pages into widely supported image formats.

How to Convert PDF to PNG

To convert a PDF document into PNG images, follow these steps:

  1. Create an instance of PdfToPngOptions to configure the conversion process.
  2. Add the input PDF File using the AddInput method.
  3. Set the output Directory path for the PNG images using the AddOutput method.
  4. Run the Convert method to convert the PDF pages into PNG images.
1// Create PdfToPngOptions object to set instructions
2// Create PdfToPngOptions object to set instructions
3var options = new PdfToPngOptions();
4// Add input File path
5options.AddInput(new FileDataSource("path_to_input.pdf"));
6// Set output Directory path
7options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
8// Perform the process
9PdfConverter.Convert(options);

Customizing PDF to PNG Conversion

You can customize the conversion by adjusting the resolution and selecting specific pages. For example, to convert only the first page of a PDF at 200 DPI:

 1// Create PdfToPngOptions object to set instructions
 2var options = new PdfToPngOptions()
 3// Process only the first page
 4options.PageList = [1];
 5// Set output resolution to 200 DPI
 6options.OutputResolution = 200;
 7// Add input File path
 8options.AddInput(new FileDataSource("path_to_input.pdf"));
 9// Set output Directory path
10options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
11// Perform the process
12PdfConverter.Convert(options);

Handling Conversion Results

The Convert method returns a ResultContainer object that holds information about the conversion results. You can get streams of the converted PNG files as shown below:

 1// Create PdfToJpegOptions object to set instructions
 2var options = new PdfToPngOptions();
 3// Add input File path
 4options.AddInput(new FileDataSource("path_to_input.pdf"));
 5// Perform the process
 6var results = PdfConverter.Convert(options);
 7// Get stream results
 8foreach (var result in results.ResultCollection)
 9{
10    var streamResultPage1 = result.ToStream();
11}

Key Features:

  • Convert PDF to PNG: Quickly and efficiently convert entire PDF documents or specific pages into PNG images.
  • Customizable Resolution: Set the desired DPI (e.g., 300 DPI) for high-quality image output.
  • Page set: Select specific pages for conversion.
  • Easy Output Management: Specify output directories for each converted PNG file.
  • Quick Conversion: Fast, efficient, and requires minimal effort to configure.

PDF to TIFF

The Documentize PDF Converter for .NET is a powerful tool designed to convert PDF documents into high-quality TIFF images. This plugin ensures that your content is accessible across various platforms while maintaining excellent fidelity and versatility. You can customize the conversion process by adjusting resolution, enabling multi-page output, or selecting pages.

How to Convert PDF to TIFF

To convert a PDF document into TIFF images, follow these steps:

  1. Create an instance of PdfToTiffOptions to configure the conversion process.
  2. Add the input PDF file using the AddInput method.
  3. Specify the output file path for the TIFF images using the AddOutput method.
  4. Run the Convert method to convert the PDF pages into TIFF images.
1// Create PdfToTiffOptions object to set instructions
2var options = new PdfToTiffOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output Directory path
6options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
7// Perform the process
8PdfConverter.Convert(options);

Customizing Pages and DPI of PDF to TIFF Conversion

Here’s how to convert 2 pages of a PDF at 400 DPI into a TIFF file:

 1// Create PdfToTiffOptions object to set instructions
 2var options = new PdfToTiffOptions();
 3// Add input file path
 4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 5// Set output Directory path
 6options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
 7// Set Pages
 8options.PageList = [1, 3];
 9// Set result image Resolution
10options.OutputResolution = 400;
11// Perform the process
12PdfConverter.Convert(options);

Multi-Page TIFF Creation

The plugin supports multi-page TIFF generation, allowing you to combine multiple PDF pages into a single TIFF file for efficient archiving or printing.

 1// Create PdfToTiffOptions object to set instructions
 2var options = new PdfToTiffOptions();
 3// Add input file path
 4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 5// Set output Directory path
 6options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
 7// Enable Multi-Page TIFF output
 8options.MultiPage = true;
 9// Perform the process
10PdfConverter.Convert(options);

Customizing Pages and DPI of PDF to TIFF Conversion

Here’s how to convert 2 pages of a PDF at 400 DPI into a TIFF file:

 1// Create PdfToTiffOptions object to set instructions
 2var options = new PdfToTiffOptions();
 3// Add input file path
 4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 5// Set output Directory path
 6options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
 7// Set Compression and ColorDepth
 8options.Compression = TiffCompression.RLE;
 9options.ColorDepth = TiffColorDepth.Format24bpp;
10// Perform the process
11PdfConverter.Convert(options);

How to Handle Conversion Results

The Convert method returns a ResultContainer object that provides details about the conversion results. You can get streams of the converted TIFF files as shown below:

 1// Create PdfToTiffOptions object to set instructions
 2var options = new PdfToTiffOptions();
 3// Add input File path
 4options.AddInput(new FileDataSource("path_to_input.pdf"));
 5// Perform the process
 6var results = PdfConverter.Convert(options);
 7// Get stream results
 8foreach (var result in results.ResultCollection)
 9{
10    var streamResultPage1 = result.ToStream();
11}

Key Features:

  • Convert PDF to TIFF: Effortlessly convert entire PDF documents or specific pages into TIFF images.
  • Custom Resolution: Adjust the resolution (e.g., 300 dpi) for superior quality outputs.
  • Multi-Page TIFF: Combine multiple PDF pages into a single multi-page TIFF file.
  • Page set: Select specific pages for conversion.
  • Quick Conversion: Fast and efficient process with minimal effort.

PDF to XLS

The Documentize PDF Converter for .NET is a versatile and powerful tool for converting PDF documents into Excel spreadsheets (XLSX/XLS/CSV/XLSM/ODS). By leveraging this plugin, developers can seamlessly transform static PDF data into dynamic and editable spreadsheets, simplifying data manipulation, analysis, and sharing.

How to Convert PDF to Excel

To convert a PDF document into an Excel file (XLSX), follow these steps:

  1. Configure the conversion settings using the PdfToXlsOptions class.
  2. Add input PDF files using the AddInput method.
  3. Specify the output file path using the AddOutput method.
  4. Execute the Convert method to initiate the conversion.
1// Create PdfToXlsOptions object to set instructions
2var options = new PdfToXlsOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_xlsx_file.xlsx"));
7// Perform the process
8PdfConverter.Convert(options);

Customizing the PDF to Excel Conversion

The PdfToXlsOptions class allows you to customize the conversion process. For example, to convert the PDF to an XLS file and enable advanced formatting options:

 1// Create PdfToXlsOptions object to set instructions
 2var options = new PdfToXlsOptions();
 3// Add input file path
 4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 5// Specify XLS format
 6options.Format = PdfToXlsOptions.ExcelFormat.XMLSpreadSheet2003;
 7options.InsertBlankColumnAtFirst = true;
 8options.MinimizeTheNumberOfWorksheets = true;
 9// Set output file path
10options.AddOutput(new FileDataSource("path_to_result_xlsx_file.xls"));
11// Perform the process
12PdfConverter.Convert(options);

Supported Output Formats

The PdfToXlsOptions.ExcelFormat enum provides a range of output formats:

  • XLSX: Office Open XML (.xlsx) File Format (default).
  • XLSM: Macro-enabled Excel format.
  • CSV: Comma-separated values.
  • ODS: Open Document Spreadsheet.
  • XMLSpreadSheet2003: Excel 2003 XML (.xls) File Format.

Key Features:

  • Flexible Conversion Options: Convert PDF files into XLSX, XLS, CSV, or other formats.
  • Content Preservation: Maintain the original structure, layout, and formatting.
  • Advanced Formatting: Insert blank columns or minimize the number of worksheets.

PDF Extractor

Extract Text

Extract text from PDFs accurately with Documentize's .NET tools—retrieve, process, and analyze content effortlessly.

Extract Images

Effortlessly extract images from PDF documents from within .NET applications

Export Form Data

Extract and export data from PDF forms (AcroForms) into other formats like CSV using C# .NET

Subsections of PDF Extractor

Extract Text

The Documentize PDF Extractor for .NET simplifies extracting text from PDF documents. Whether you need pure, raw, or plain text, this plugin allows you to extract text efficiently while preserving formatting or omitting it based on your needs.

How to Extract Text from PDF

To extract text from a PDF document, follow these steps:

  1. Create an instance of ExtractTextOptions to configure the extraction options.
  2. Add the input PDF file using the AddInput method.
  3. Run the ExtractText method to extract the text.
  4. Access the extracted text using the ResultContainer.ResultCollection.
1// Create ExtractTextOptions object to set instructions
2var options = new ExtractTextOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Perform the process
6var results = PdfExtractor.ExtractText(options);
7// Get the extracted text from the ResultContainer object
8var textExtracted = results.ResultCollection[0].ToString();

Text Extraction Modes

The ExtractTextOptions offers three extraction modes, providing flexibility based on your needs.

  1. Pure Mode: Preserves the original formatting, including spaces and alignment.
  2. Raw Mode: Extracts the text without formatting, useful for raw data processing.
  3. Flatten Mode: Represent PDF content with positioning text fragments by their coordinates.
1// Create ExtractTextOptions object to set TextFormattingMode
2var options = new ExtractTextOptions(TextFormattingMode.Pure);
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Perform the process
6var results = PdfExtractor.ExtractText(options);
7// Get the extracted text from the ResultContainer object
8var textExtracted = results.ResultCollection[0].ToString();

Key Features:

  • Pure Mode: Extract text while preserving its original formatting.
  • Raw Mode: Extract text without any formatting.
  • Flatten Mode: Extract text without special characters or formatting.

Extract Images

The Documentize PDF Extractor for .NET plugin enables you to effortlessly extract images from PDF documents. It scans your PDF files, identifies embedded images, and extracts them while maintaining their original quality and format. This tool enhances the accessibility of visual content and streamlines the process of retrieving images from PDFs.

How to Extract Images from a PDF

To extract images from a PDF file, follow these steps:

  1. Create an instance of the ExtractImagesOptions class.
  2. Add the input file path to the options using the AddInput method.
  3. Set the output Directory path for images using the AddOutput method.
  4. Process the image extraction using the plugin.
  5. Retrieve the extracted images from the result container.
 1// Create ExtractImagesOptions to set instructions
 2var options = new ExtractImagesOptions();
 3// Add input file path
 4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 5// Set output Directory path
 6options.AddOutput(new DirectoryDataSource("path_to_results_directory"));
 7// Perform the process
 8var results = PdfExtractor.ExtractImages(options);
 9// Get path to image result
10var imageExtracted = results.ResultCollection[0].ToFile();

Extracting Images from PDF File to Streams without folder

The PdfExtractor plugin supports saving to streams, which allows you to extract images from PDF files into streams without using temporary folders.

 1// Create ExtractImagesOptions to set instructions
 2var options = new ExtractImagesOptions();
 3// Add input file path
 4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 5// Not set output - it will write results to streams
 6// Perform the process
 7var results = PdfExtractor.ExtractImages(options);
 8// Get Stream
 9var ms = results.ResultCollection[0].ToStream();
10// Copy data to file for demo
11ms.Seek(0, SeekOrigin.Begin);
12using (var fs = File.Create("test_file.png"))
13{
14    ms.CopyTo(fs);
15}

Key Features:

  • Extract Embedded Images: Identify and extract images from PDF documents.
  • Preserve Image Quality: Ensures extracted images retain their original quality.
  • Flexible Output: Save extracted images in your preferred format or location.

Export Form Data

The Documentize PDF Extractor for .NET plugin provides a seamless way to extract and export data from PDF forms (AcroForms) into other formats like CSV. This dynamic tool simplifies the process of retrieving form field values, allowing for easy data management, transfer, and analysis.

How to Export Form Data from PDF

To export form data from a PDF to CSV, follow these steps:

  1. Create an instance of the ExtractImagesOptions class.
  2. Define export options using the FormExporterValuesToCsvOptions class.
  3. Add input PDF files and specify the output CSV file.
  4. Run the Process method to perform the export.
1// Create ExtractFormDataToDsvOptions object to set instructions
2var options = new ExtractFormDataToDsvOptions(',', true);
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_csv_file.csv"));
7// Perform the process
8PdfExtractor.ExtractFormData(options);

Key Features:

  • Export Form Data: Extract data from PDF forms (AcroForms) into CSV or other formats.
  • Data Filtering: Use predicates to filter specific form fields for export based on criteria like field type or page number.
  • Flexible Output: Save exported data for analysis or transfer to spreadsheets, databases, or other document formats.

PDF Manager

Merge PDF

Merge PDFs easily with Documentize's .NET tools—combine multiple files into one while preserving quality and structure.

Split PDF

Split PDFs effortlessly with Documentize's .NET tools—extract pages, create new files, and manage documents with precision

Optimize PDF

Optimize your PDFs effortlessly with Documentize's .NET tools—reduce file size, enhance performance, and maintain quality

Add Table

Generate professional PDF tables with Documentize's .NET tools—customize layouts, styles, and data with ease.

Add TOC

Enhance the organization and navigation of PDF documents by dynamically generating a Table of Contents (TOC)

Use ChatGPT

Enhance your PDFs with AI using Documentize's ChatGPT integration—generate, edit, and analyze content intelligently.

Subsections of PDF Manager

Merge PDF

The Documentize PDF Manager for .NET is a versatile tool designed to merge multiple PDF documents into a single file. It simplifies the consolidation of PDF files, ensuring your documents are merged efficiently and maintaining consistency across content. The plugin handles internal resources such as fonts and images to optimize the merged document.

How to Merge PDF

To merge multiple PDF documents into a single file, follow these steps:

  1. Create an instance of MergeOptions to configure the merging process.
  2. Add input PDF files using the AddInput method.
  3. Add output PDF file using AddOutput method.
  4. Execute the merge using the Merge method of PdfManager class.
1// Create MergeOptions object to set instructions
2var options = new MergeOptions();
3// Add input file paths
4options.AddInput(new FileDataSource("path_to_your_pdf_file_1.pdf"));
5options.AddInput(new FileDataSource("path_to_your_pdf_file_2.pdf"));
6// Set output file path
7options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
8// Perform the process
9PdfManager.Merge(options);

Key Features:

  • Merge Multiple PDFs: Easily combine multiple PDF files into one.
  • Resource Optimization: Removes duplicate fonts and images during merging.
  • Batch Processing: Merge large batches of PDF documents in one go.

Split PDF

The Documentize PDF Manager for .NET is a powerful tool that simplifies the process of splitting large PDF documents into smaller, more manageable files. Whether you need to extract individual pages or divide a document into specific sections, this plugin allows you to achieve it efficiently and with minimal effort.

How to Split PDF

To split a PDF document into individual pages, follow these steps:

  1. Create an instance of SplitOptions to configure the splitting options.
  2. Add the input PDF file using the AddInput method.
  3. Add output files for each split page using the AddOutput method.
  4. Run the Split method in the PdfManager class to split the document.
1// Create SplitOptions object to set instructions
2var options = new SplitOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file paths
6options.AddOutput(new FileDataSource("path_to_result_pdf_file_1.pdf"));
7options.AddOutput(new FileDataSource("path_to_result_pdf_file_2.pdf"));
8// Perform the process
9PdfManager.Split(options);

Key Features:

  • Split PDF by Page: Break down a PDF document into individual pages.
  • Custom Split Options: Configure the splitting process based on your requirements.
  • Organized Output: Easily manage the output files for each split page or section.

Optimize PDF

The Documentize PDF Manager for .NET is a comprehensive plugin that enhances PDF documents through advanced optimization techniques. It is designed to help reduce file sizes, rotate pages, crop content, and resize documents. These operations improve the quality and manageability of PDF files, making them easier to store, share, and view.

Optimize PDF

The following steps demonstrate how to optimize a PDF document by reducing its file size while maintaining quality.

  1. Create an OptimizeOptions object to configure optimization settings.
  2. Add input PDF file(s) and set an output location for the optimized file.
  3. Run the Optimize method of PdfManager to execute the optimization.
1// Create OptimizeOptions object to set instructions
2var options = new OptimizeOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfManager.Optimize(options);

Rotate PDF

Use the RotateOptions class to adjust the orientation of pages in a PDF file.

  1. Create a RotateOptions object and configure the rotation angle.
  2. Add the input PDF file and specify the output file location.
  3. Set the rotation angle (e.g., 90 degrees) using the SetRotation method.
  4. Run the Rotate method of PdfManager.
 1// Create RotateOptions object to set instructions
 2var options = new RotateOptions();
 3// Set new Rotation
 4options.Rotation = Rotation.On90;
 5// Add input file path
 6options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 7// Set output file path
 8options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
 9// Perform the process
10PdfManager.Rotate(options);

Resize PDF

To resize a PDF document, the ResizeOptions class is used to specify the new page size for the document.

  1. Create a ResizeOptions object to define the page size.
  2. Add the input file and set the desired output location.
  3. Use the SetPageSize method to specify the new size (e.g., A4).
  4. Run the Resize method of PdfManager.
 1// Create ResizeOptions object to set instructions
 2var options = new ResizeOptions();
 3// Set new PageSize
 4options.PageSize = PageSize.A3;
 5// Add input file path
 6options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 7// Set output file path
 8options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
 9// Perform the process
10PdfManager.Resize(options);

Compress PDF

Compress PDF document when feasible by eliminating unused page resources, merging identical assets, and discarding redundant objects.

  1. Create an CompressOptions object to configure optimization settings.
  2. Add the input file and specify the output file location.
  3. Use the SetCropBox method to define the crop area.
  4. Run the Compress method of PdfManager.
1// Create CompressOptions object to set instructions
2var options = new CompressOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfManager.Compress(options);

Key Features:

  • Optimization: Reduce PDF file size without losing quality.
  • Rotation: Adjust the orientation of PDF pages.
  • Resizing: Resize pages to specific dimensions (e.g., A4, Letter).
  • Compressing: Remove unused page resources and objects from the document.

Add Table

The Documentize PDF Manager for .NET is a versatile plugin designed to streamline the integration of tables into PDF documents. Whether you’re organizing data, designing forms, or improving document readability, this plugin simplifies the process while maintaining precision and efficiency. Its intuitive API supports both single document and batch processing workflows, making it an essential tool for developers working with structured data.

Creating a PDF with Tables

Follow these steps to create structured tables in a PDF using the TableOptions class:

  1. Configure the TableOptions object to define table structure, content, and input/output files.
  2. Add tables, rows, and cells to your PDF.
  3. Finalize the table generation process using the AddTable method.

Here’s an example:

 1// Configure table options
 2var options = new TableOptions();
 3options.InsertPageBefore(1)
 4   .AddTable()
 5        .AddRow()
 6            .AddCell().AddParagraph("Name")
 7            .AddCell().AddParagraph("Age")
 8        .AddRow()
 9            .AddCell().AddParagraph("Bob")
10            .AddCell().AddParagraph("12")
11        .AddRow()
12            .AddCell().AddParagraph("Sam")
13            .AddCell().AddParagraph("20")
14        .AddRow()
15            .AddCell().AddParagraph("Sandy")
16            .AddCell().AddParagraph("26")
17        .AddRow()
18            .AddCell().AddParagraph("Tom")
19            .AddCell().AddParagraph("12")
20        .AddRow()
21            .AddCell().AddParagraph("Jim")
22            .AddCell().AddParagraph("27");
23// Add input file path
24options.AddInput(new FileDataSource("path_to_input.pdf"));
25// Set output file path
26options.AddOutput(new FileDataSource("path_to_output.pdf"));
27// Perform the process
28PdfManager.AddTable(options);

Set page of the table

Follow these steps to create table in a PDF after 2 page: Here’s an example:

 1var options = new TableOptions();
 2options.InsertPageBefore(2) // Add table before page 2
 3   .AddTable()
 4        .AddRow()
 5            .AddCell().AddParagraph("Name")
 6            .AddCell().AddParagraph("Age")
 7// Add input file path
 8options.AddInput(new FileDataSource("path_to_input.pdf"));
 9// Set output file path
10options.AddOutput(new FileDataSource("path_to_output.pdf"));
11// Perform the process
12PdfManager.AddTable(options);

Key Features:

  • Dynamic Table Creation: Effortlessly generate structured tables in PDF documents.
  • Page Placement: Insert tables at specific locations within a PDF with precision.
  • Customizable Layout: Adjust table structure, cell alignment, and styling.

Add TOC

The Documentize PDF Manager for .NET is a powerful plugin designed to enhance the organization and navigation of PDF documents by dynamically generating a Table of Contents (TOC). This plugin simplifies the process of adding TOCs to your PDFs, making documents easier to navigate and manage.

How to Generate a TOC for a PDF

To create a Table of Contents in a PDF file, follow these steps:

  1. Create an instance of TocOptions to configure TOC generation settings.
  2. Set a Title using the Title property.
  3. Design Headings of TOC using the Headings.Add method.
  4. Add the input PDF file using the AddInput method.
  5. Specify the output PDF file with the TOC using the AddOutput method.
  6. Call the AddTableOfContents method to generate the TOC.
 1// Create TocOptions object to set instructions
 2var options = new TocOptions();
 3// Set the Title
 4options.Title = "My Table of Contents";
 5// Design Headings
 6options.Headings.Add(new TocHeading("Introduction", 2));
 7options.Headings.Add(new TocHeading("Chapter I", 3));
 8options.Headings.Add(new TocHeading("Chapter II", 4));
 9options.Headings.Add(new TocHeading("Chapter III", 5));
10// Add input file path
11options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
12// Set output file path
13options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
14// Perform the process
15PdfManager.AddTableOfContents(options);

Generate bookmarks in a TOC for a PDF

You can use ‘GenerateBookmarks’ property for bookmarks generation.

 1// Create TocOptions object to set instructions
 2var options = new TocOptions();
 3// Set the Title
 4options.Title = "My Table of Contents";
 5// Generate links in bookmarks
 6options.GenerateBookmarks = true;
 7// Design Headings
 8options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
 9options.Headings.Add(new TocHeading("Chapter I", 3, true, 1));
10options.Headings.Add(new TocHeading("Chapter II", 4, true, 1));
11options.Headings.Add(new TocHeading("Example A", 4, true, 2));
12options.Headings.Add(new TocHeading("Example B", 4, true, 2));
13options.Headings.Add(new TocHeading("Example C", 4, true, 2));
14options.Headings.Add(new TocHeading("Example D", 4, true, 2));
15options.Headings.Add(new TocHeading("Chapter III", 5, true, 1));
16// Add input file path
17options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
18// Set output file path
19options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
20// Perform the process
21PdfManager.AddTableOfContents(options);

How to get Result as Stream

 1// Create TocOptions object to set instructions
 2var options = new TocOptions();
 3// Set the Title
 4options.Title = "My Table of Contents";
 5// Design Headings
 6options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
 7// Add input file path
 8options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 9// Set output stream 
10var outputStream = new MemoryStream();
11options.AddOutput(new StreamDataSource(outputStream));
12options.CloseOutputStreams = false;
13// Perform the process
14PdfManager.AddTableOfContents(options);

Customizing the TOC Heading

You can customize the Table of Contents Heading by modifying the TocHeading class. For example, you can use ‘GenerateNumbering’ or done it manually. Property ‘PageNumber’ used for links on pages. Also you can use Level property.

 1var heading = new TocHeading();
 2heading.Text = "Intro";
 3heading.PageNumber = 5;
 4heading.GenerateNumbering = true;
 5heading.Level = 2;
 6
 7var tocOptions = new TocOptions();
 8options.Headings.Add(heading);
 9// Add input and output files
10tocOptions.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
11tocOptions.AddOutput(new FileDataSource(@"C:\Samples\output_with_toc.pdf"));
12
13// Generate the TOC with customized options
14PdfManager.AddTableOfContents(tocOptions);

Key Features:

  • Dynamic TOC Generation: Create a TOC for any PDF file with automatically generated entries based on headings or bookmarks.
  • Customization: Control the appearance and structure of the TOC, including styles, formatting, and levels of depth.
  • Efficient Workflow: Minimize time spent manually creating TOCs, especially for large or complex documents.

Use ChatGPT

The Documentize PDF Manager for .NET plugin is a powerful tool designed to integrate the ChatGPT API with PDF applications. This plugin allows developers to generate chat responses based on input messages and save the output in PDF format, making it suitable for creating conversational interfaces or analysis reports directly within PDF documents.

Generate Chat Responses

To generate chat responses and save them to a PDF file using the ChatGPT plugin, follow these steps:

  1. Create an instance of the ChatGptRequestOptions class to configure the request options.
  2. Add input and output PDF files.
  3. Set the API key and specify parameters such as maximum token count and the query for the ChatGPT model.
  4. Run the CreatePdfByChatGptRequestAsync method to generate the chat completion.
 1var options = new ChatGptRequestOptions();
 2// Set output file path
 3options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf")); 
 4options.ApiKey = "Your API key."; // You need to provide the key to access the API.
 5options.MaxTokens = 1000; // The maximum number of tokens to generate in the chat completion.
 6
 7// Add the request messages.
 8options.Messages.Add(new Message
 9{
10    Content = "You are a helpful assistant.",
11    Role = Role.System
12});
13options.Messages.Add(new Message
14{
15    Content = "What is the biggest pizza diameter ever made?",
16    Role = Role.User
17});
18
19// Process the request.
20var result = await PdfManager.CreatePdfByChatGptRequestAsync(options);
21
22var fileResultPath = result.ResultCollection[0].Data;
23var chatCompletionObject = result.ResultCollection[1].Data as ChatCompletion; // The ChatGPT API chat completion object.

Adding System and User Messages

To create a more interactive conversation, you can add both system and user messages. These messages help shape the conversation context.

  1. Add a system message that sets the context for ChatGPT.
  2. Add a user message that represents the user’s input for the conversation.
 1var options = new ChatGptRequestOptions();
 2// Set output file path
 3options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
 4
 5// Add the PDF text source.
 6// In case of multiple sources, the text from each document will be added to the request message collection
 7// as a separate message with the role "user".
 8options.AddInput(new FileDataSource("TextSource.pdf"));
 9
10options.ApiKey = "Your API key."; // You need to provide the key to access the API.
11options.MaxTokens = 1000; // The maximum number of tokens to generate in the chat completion.
12
13// Add the request message.
14// In this case, the system message with Content = "You are a helpful assistant." is added by default.
15// The role of the query message is "user" by default.
16options.Query = "How many letters in the provided text?";
17
18// Process the request.
19var result = await PdfManager.CreatePdfByChatGptRequestAsync(options);
20
21var fileResultPath = result.ResultCollection[0].Data;
22var chatCompletionObject = result.ResultCollection[1].Data as ChatCompletion; // The ChatGPT API chat completion object.

Key Features:

  • Chat Completions: Generate responses using the ChatGPT API based on custom input.
  • System & User Messages: Provide both system context and user input to create dynamic conversations.
  • PDF Output: Save generated chat completions in a structured PDF file for further use.
  • Asynchronous Processing: Ensure responsive applications by processing chat completions asynchronously.

PDF Security

Encrypt

Encrypt your PDF files with Documentize's .NET tools to protect sensitive information.

Decrypt

Decrypt your PDF files with Documentize's .NET tools to open documents.

Sign

Digitally sign PDF files with Documentize's .NET tools—ensure security, authenticity, and compliance with ease.

Subsections of PDF Security

Encrypt

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.

How to Encrypt a PDF

To encrypt a PDF document, follow these steps:

  1. Create an instance of EncryptOptions with the desired user and owner passwords.
  2. Add the input PDF file using the AddInput method.
  3. Add the output PDF file using AddOutput method.
  4. Execute the encryption using the Encrypt method of PdfSecurity class.
1// Create EncryptOptions object to set instructions
2var options = new EncryptOptions("123456", "qwerty");
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Encrypt(options);

Key Features:

  • 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.

Decrypt

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.

How to Decrypt a PDF

To decrypt a PDF document, follow these steps:

  1. Create an instance of DecryptionOptions with the necessary password.
  2. Add the input PDF file using the AddInput method.
  3. Add the output PDF file using AddOutput method.
  4. Execute the encryption using the Decrypt method of PdfSecurity class.
1// Create DecryptOptions object to set instructions
2var options = new DecryptOptions("123456");
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Decrypt(options);

Key Features:

  • 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.

Sign

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

How to Sign PDF Documents

To sign a PDF document using a PFX file, follow these steps:

  1. Instantiate the SignOptions class with the PFX file path and password.
  2. Add the input PDF and the output file to the options.
  3. Run the Sign method to apply the signature.
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 FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Sign(options);

How to Use Stream for PFX File

You can also sign a PDF using a PFX certificate provided as a stream instead of a file path. This allows more flexible handling of certificate storage.

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

How to Apply Invisible Signatures

To add an invisible signature (one that secures the document without displaying the signature on the document), simply set the Visible property to false.

  1. Create an instance of SignOptions.
  2. Set Visible to false.
  3. Add input and output files.
  4. Call Sign to apply the invisible signature.
1var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
2options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
3options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
4// Configure invisible signature
5signOptions.Visible = false;
6// Perform the process
7PdfSecurity.Sign(options);

How to use extra Options for signature of PDF Documents

You can use extra options during adding signature to a PFX file like Reason, Contact, Location, PageNumber.

  1. Instantiate the SignOptions class with the PFX file path and password.
  2. Add the input PDF and the output file to the options.
  3. Set values for your options.
  4. Run the Sign method to apply the signature.
 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 FileDataSource("path_to_your_pdf_file.pdf"));
 5// Set output file path
 6options.AddOutput(new FileDataSource("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);

How to Add a Timestamp to PDF

To add a secure timestamp to a PDF document, follow these steps:

  1. Create an instance of AddTimestampOptions to configure the timestamping process.
  2. Add the input PDF file using the AddInput method.
  3. Set the output file path using AddOutput.
  4. Execute the timestamping using the Sign method.
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 FileDataSource("path_to_your_pdf_file.pdf"));
6// Set output file path
7options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
8// Perform the process
9PdfSecurity.Sign(options);

How to Use Custom Authentication with Timestamp Server

You can provide basic authentication credentials when connecting to the timestamp server. This allows you to authenticate with servers that require a username and password.

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

Key Features:

  • Digitally Sign PDF Documents: Secure your documents with visible or invisible digital signatures.
  • PFX Support: Sign PDF files using a PFX certificate.
  • Customizable Options: Configure signature settings like reason, location, and contact details.
  • Visible and Invisible Signatures: Choose whether the signature is visible on the document.
  • Customizable Timestamp Servers: Use custom timestamp server URLs and authentication credentials.

PDF Form

PDF Form Flattener

Convert interactive PDF forms into non-editable documents, making them secure from unauthorized modifications

Subsections of PDF Form

PDF Form Flattener

The Documentize PDF Form Flattener for .NET plugin is designed to convert interactive PDF forms into non-editable documents, making them secure from unauthorized modifications. This tool transforms form fields into static content, enhancing the security of your PDF documents. It is particularly useful when you need to secure contracts, agreements, or any document where form fields must remain unchanged.

How to Flatten Form Fields in a PDF

To flatten form fields in a PDF document, follow these steps:

  1. Create an instance of the FormFlattenerOptions class.
  2. Add the input and output files to the options.
  3. Call the Process method to perform the flattening operation.
1// Create FormFlattenerOptions object to set instructions
2var options = new FormFlattenerOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
7// Perform the process
8FormFlattener.Process(options);

How to Get all Fields in a PDF

You can get information how many fields contains a document.

1// Get Fields Names
2var fieldNames = FormFlattener.GetFieldNames("path_to_your_pdf_file.pdf");

How to Flatten everything except the first Field in a PDF

You can selectively flatten only specific form fields based on criteria such as the field’s position or name.

 1// Get Fields Names
 2var fieldNames = FormFlattener.GetFieldNames("path_to_your_pdf_file.pdf");
 3// Create FormFlattenerOptions object to set instructions
 4var options = new FormFlattenerOptions();
 5options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
 6options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
 7// Skip 1 field.
 8options.SkipFields.Add(fieldNames[0]);
 9// Perform the process
10FormFlattener.Process(options);

Key Features:

  • Flatten All Form Fields: Converts interactive form fields into non-editable static content.
  • Flatten Selected Fields: Optionally flatten specific fields in a PDF while keeping others editable.
  • Flatten Get Fields Names: Get fields names in a PDF.
 English