Subsections of Installation
System Requirements
Documentize SDKs are designed to integrate with .NET applications and support various operating systems and development environments. Below are the key system requirements:
Supported Operating Systems
Windows
- Windows 7 (x64, x86)
- Windows 8, 8.1 (x64, x86)
- Windows 10 (x64, x86)
- Windows 11 (x64, x86)
- Windows Server 2003 to Windows Server 2022 (x64, x86)
- Cloud: Microsoft Azure
macOS
- macOS 10.12 (Sierra) and later
Linux
- Compatible with multiple Linux distributions:
- Ubuntu (16.04, 18.04, 20.04, 22.04)
- CentOS (7, 8)
- Debian (9, 10)
- OpenSUSE (Leap 15+, SLES 12+)
Android
- Supports Android 8.0 (Oreo) and later.
Development Environments
- Microsoft Visual Studio:
- Visual Studio 2010 and later (including 2019 and 2022)
- Supports any development environment targeting .NET platforms.
Supported .NET Frameworks
- .NET Framework 4.0 and higher
- .NET Standard 2.0 (.NET Core 3.1+)
- .NET 6.0, .NET 7.0, .NET 8.0
Additional Notes
- Adobe Acrobat is not required to run Documentize SDKs, but is recommended for viewing PDFs.
Declaration
Documentize.com SDKs require a Full Trust permission set when used within .NET applications. This permission level is essential for the SDKs to perform certain system-level operations, such as accessing registry settings, system files, and parsing fonts.
Why Full Trust is Required
The Documentize SDKs utilize core .NET system classes, which often need elevated permissions for the following reasons:
- Registry Access: Some operations may require reading or writing to the system registry.
- System Files: Access to system files beyond the applicationâs virtual directory may be necessary for certain tasks, such as handling fonts or performing file operations.
Limitations of Medium Trust Environment
In hosting environments that enforce Medium Trust security, several important permissions are restricted or unavailable. This could prevent the SDKs from functioning correctly in such environments. The following restrictions apply under Medium Trust:
- OleDbPermission: Cannot use the ADO.NET managed OLE DB data provider to access databases.
- EventLogPermission: Access to the Windows Event Log is prohibited.
- ReflectionPermission: Prevents the use of reflection, which may affect certain dynamic operations.
- RegistryPermission: Access to the system registry is denied.
- WebPermission: Communication is restricted to predefined addresses or ranges as configured in the
<trust>
element. - FileIOPermission: Access to files is limited to those within the application’s virtual directory.
Non-Windows Environment
Documentize SDKs support .NET Standard 2.0, which allows them to be used in .NET Core applications running on Linux or other non-Windows environments. To ensure optimal performance and correct text rendering, follow the steps below:
Recommended Setup for Linux
1. Install libgdiplus Package
This package provides necessary GDI+ functionality, which is critical for rendering and processing PDFs. You can install it by running the following command in your terminal:
sudo apt-get install libgdiplus
2. Install Microsoft Compatible Fonts
For correct text rendering, install Microsoft TrueType fonts using the command:
sudo apt-get install ttf-mscorefonts-installer
These fonts should be placed in the /usr/share/fonts/truetype/msttcorefonts
directory. If your system stores fonts in a different directory, update the path in your code before performing any operations with Documentize SDKs:
Documentize.Text.FontRepository.Sources.Add(new FolderFontSource("<path to ms fonts>"));
Tip
By ensuring these installations are complete and configuring the font path correctly, you can maximize the performance of Documentize SDKs on Linux or other non-Windows systems.
License and Evaluation
Evaluate Documentize for .NET
When you start working with Documentize products, you can use them immediately with a free evaluation license. This license allows developers and businesses to explore, test, and integrate Documentize features into their applications before making a purchase.
What Is an Evaluation License?
The evaluation license is a built-in, time-unlimited trial mode included in every Documentize product. It gives you access to most of the core features so you can fully evaluate the productâs capabilities in real-world scenarios. Whether youâre generating, editing, or converting documents, you can test performance and integration with your stack.
Key Features of the Evaluation License
- â
No installation needed â Just download and start using Documentize products.
- đ§Ș Explore core functionality â Test essential features like document conversion, manipulation, and export.
- đ» Developer-friendly â Ideal for proof-of-concept (POC), integration testing, or technical evaluations.
- đ Easy to upgrade â Switch to a full license at any time without changing your implementation.
If you want to upgrade to a full license, you need add a next code:
License.Set("path_to_your_license_file.lic");
Limitations of the Evaluation Mode
While evaluation licenses offer broad access, there are a few limitations designed to protect the licensed product:
- All pages in the generated PDF documents are watermarked.
- In the evaluation version, you can only process the first four pages of a document.
- Evaluation licenses are not intended for production or commercial deployment.
For full access without restrictions, youâll need to purchase a valid Documentize license and apply it within your project.
How to Start Using the Evaluation License
No special setup is required. Simply download your desired Documentize SDK, and begin working with it. If no license file is applied, the product automatically runs in evaluation mode.
To test behavior with a valid license, you can also request a temporary full-featured license for in-depth evaluations.
When to Use the Evaluation License
You should use an evaluation license if:
- Youâre exploring Documentize capabilities for the first time.
- You want to confirm compatibility with your application or platform.
- You need to build a prototype or proof-of-concept before buying.
- Youâre comparing document automation solutions.
Get Started with Documentize Today
Evaluate Documentize products risk-free and see how they can enhance your document workflows. When you’re ready to move to production, upgrading to a full license is fast and seamless.
đ Need Help? Visit our Documentation or Contact Us for assistance.
Developer's Guide
Convert HTML to PDF and PDF to HTML with Documentize's .NET toolsâpreserve layout and formatting for consistent, professional results.
Secure your PDFs with Documentize's .NET tools: encrypt, decrypt, and set permissions effortlessly to protect sensitive information.
Optimize your PDFs effortlessly with Documentize's .NET toolsâreduce file size, enhance performance, and maintain quality
Merge PDFs easily with Documentize's .NET toolsâcombine multiple files into one while preserving quality and structure.
Generate professional PDF tables with Documentize's .NET toolsâcustomize layouts, styles, and data with ease.
.NET plugin designed to enhance the organization and navigation of PDF documents by dynamically generating a Table of Contents (TOC)
Digitally sign PDFs with Documentize's .NET toolsâensure security, authenticity, and compliance with ease.
Split PDFs effortlessly with Documentize's .NET toolsâextract pages, create new files, and manage documents with precision
Enhance your PDFs with AI using Documentize's ChatGPT integrationâgenerate, edit, and analyze content intelligently.
Effortlessly extract images from PDF documents from within .NET applications
Extract text from PDFs accurately with Documentize's .NET toolsâretrieve, process, and analyze content effortlessly.
Add timestamps to PDFs with Documentize's .NET toolsâautomatically insert date and time for enhanced document tracking.
Convert PDFs to PDF/A format with Documentize's .NET toolsâensure long-term archiving and compliance with ease.
Convert PDFs to Excel with Documentize's .NET toolsâextract tables and data quickly for seamless analysis and processing.
Convert PDFs to Word documents with Documentize's .NET toolsâpreserve formatting and structure for easy editing.
Convert PDFs to JPEG images with Documentize's .NET toolsâextract high-quality images from your documents effortlessly.
Convert PDFs to PNG images with Documentize's .NET toolsâextract high-quality images for web and graphic use.
Convert PDFs to TIFF images with Documentize's .NET toolsâextract high-resolution images for professional document management.
Convert interactive PDF forms into non-editable documents, making them secure from unauthorized modifications
Subsections of Developer's Guide
HTML Converter
The Documentize HTML Converter for .NET provides robust capabilities for converting documents between PDF and HTML formats, ideal for web applications, archiving, and report generation. With multiple options for handling resources and layouts, the converter adapts to various project requirements.
PDF to HTML Conversion
Convert PDF files to HTML to make documents accessible for web-based viewing or integration into applications where HTML format is preferred.
HTML to PDF Conversion
Transform HTML content into high-quality PDFs, perfect for generating printable reports, archiving web content, or creating shareable document formats.
Converting PDF to HTML
To convert a PDF to HTML:
- Configure Options: Use
PdfToHtmlOptions
to customize output, choosing either embedded or external resources. - Define Input and Output Paths: Set the paths for your input PDF and output HTML.
- Execute the Conversion: Call the
Process
method of HtmlConverter
to convert the file.
Example: Convert PDF to HTML with Embedded Resources
1// Step 1: Configure options for PDF to HTML conversion
2var options = new PdfToHtmlOptions(PdfToHtmlOptions.SaveDataType.FileWithEmbeddedResources);
3
4// Step 2: Set file paths
5options.AddInput(new FileDataSource("input.pdf"));
6options.AddOutput(new FileDataSource("output.html"));
7
8// Step 3: Run the conversion
9HtmlConverter.Process(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.
Converting HTML to PDF
To convert an HTML document to a PDF, follow these steps:
- Configure Options: Use
HtmlToPdfOptions
to define layout and media settings. - Specify Paths: Set input HTML and output PDF file paths.
- Execute the Conversion: Run the
Process
method of HtmlConverter
to convert the file.
Example: Convert HTML to PDF
1// Step 1: Configure options for HTML to PDF conversion
2var options = new HtmlToPdfOptions();
3
4// Step 2: Set file paths
5options.AddInput(new FileDataSource("input.html"));
6options.AddOutput(new FileDataSource("output.pdf"));
7
8// Step 3: Run the conversion
9HtmlConverter.Process(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 Security
The Documentize PDF Security for .NET is a powerful tool designed to enhance the security of your PDF documents by providing encryption and decryption 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:
- Create an instance of
EncryptionOptions
with the desired user and owner passwords. - Add the input PDF file using the
AddInput
method. - Add the output PDF file using
AddOutput
method. - Execute the encryption using the
Process
method of Security
class.
1// Create EncryptionOptions object to set instructions
2var options = new EncryptionOptions("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
8Security.Process(options);
How to Decrypt a PDF
To decrypt a PDF document, follow these steps:
- Create an instance of
DecryptionOptions
with the necessary password. - Add the input PDF file using the
AddInput
method. - Add the output PDF file using
AddOutput
method. - Execute the encryption using the
Process
method of Security
class.
1// Create DecryptionOptions object to set instructions
2var options = new DecryptionOptions("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
8Security.Process(options);
Key Features:
- Encrypt PDF Documents: Secure your PDF files by adding user and owner passwords.
- 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.
PDF Optimizer
The Documentize PDF Optimizer 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.
- Create an OptimizeOptions object to configure optimization settings.
- Add input PDF file(s) and set an output location for the optimized file.
- Run the
Process
method of Optimizer
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
8Optimizer.Process(options);
Rotate PDF
Use the RotateOptions class to adjust the orientation of pages in a PDF file.
- Create a RotateOptions object and configure the rotation angle.
- Add the input PDF file and specify the output file location.
- Set the rotation angle (e.g., 90 degrees) using the SetRotation method.
- Run the
Process
method of Optimizer
.
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
10Optimizer.Process(options);
Resize PDF
To resize a PDF document, the ResizeOptions class is used to specify the new page size for the document.
- Create a ResizeOptions object to define the page size.
- Add the input file and set the desired output location.
- Use the SetPageSize method to specify the new size (e.g., A4).
- Run the
Process
method of Optimizer
.
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
10Optimizer.Process(options);
Compress PDF
Compress PDF document when feasible by eliminating unused page resources, merging identical assets, and discarding redundant objects.
- Create an CompressOptions object to configure optimization settings.
- Add the input file and specify the output file location.
- Use the SetCropBox method to define the crop area.
- Run the
Process
method of Optimizer
.
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
8Optimizer.Process(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.
PDF Merger
The Documentize PDF Merger 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:
- Create an instance of
MergeOptions
to configure the merging process. - Add input PDF files using the
AddInput
method. - Add output PDF file using
AddOutput
method. - Execute the merge using the
Process
method of Merger
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
9Merger.Process(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.
PDF Table Generator
The Documentize Table Generator 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 TableGenerator
class:
- Instantiate the
TableGenerator
class. - Configure the
TableOptions
object to define table structure, content, and input/output files. - Add tables, rows, and cells to your PDF.
- Finalize the table generation process using the
Process
method.
Hereâs an example:
1var generator = new TableGenerator();
2var options = new TableOptions();
3
4// Specify input and output PDF files
5options.AddInput(new FileDataSource("input.pdf"));
6options.AddOutput(new FileDataSource("output.pdf"));
7
8// Define a table with rows and cells
9options
10 .InsertPageAfter(1) // Add table after the first page
11 .AddTable()
12 .AddRow()
13 .AddCell().AddParagraph(new TextFragment("Cell 1"))
14 .AddCell().AddParagraph(new TextFragment("Cell 2"))
15 .AddCell().AddParagraph(new TextFragment("Cell 3"));
16
17// Generate the table in the document
18generator.Process(options);
Adding Rich Content to Tables
Tables in PDF documents can include a variety of content types to enhance their functionality and appearance. Below is an example of adding HTML content to table cells:
1options
2 .AddTable()
3 .AddRow()
4 .AddCell().AddParagraph(new HtmlFragment("<h1>Header 1</h1>"))
5 .AddCell().AddParagraph(new HtmlFragment("<h2>Header 2</h2>"))
6 .AddCell().AddParagraph(new HtmlFragment("<h3>Header 3</h3>"));
Supported Content Types in Tables
The PDF Table Generator supports various content types, enabling developers to customize tables for a wide range of use cases:
- HtmlFragment: Add HTML-based content, such as headers, lists, and formatted text.
- TeXFragment: Include LaTeX-based content for mathematical equations and scientific notation.
- TextFragment: Insert plain or formatted text.
- Image: Embed images directly into table cells.
Customizing Table Layout and Structure
The plugin provides flexibility for adjusting table structure, including row height, column width, and cell alignment. These customization options allow you to design tables that match your documentâs layout and styling needs.
Processing the Table Generation
After adding all content and customizing the table structure, finalize the process by calling the Process
method. This method generates the tables and updates the PDF document. Hereâs how to handle the results:
1var resultContainer = generator.Process(options);
2
3// Output the number of generated results
4Console.WriteLine("Number of results: " + resultContainer.ResultCollection.Count);
Use Cases for the PDF Table Generator
- Data Reporting: Present analytics, financial reports, or survey results in a clear and organized format.
- Form Design: Create interactive forms with structured table layouts.
- Document Enhancement: Improve the readability and usability of user manuals, guides, or instructional materials.
- Batch Processing: Automate table generation for multiple PDF documents.
Key Features:
- Dynamic Table Creation: Effortlessly generate structured tables in PDF documents.
- Rich Content Support: Populate tables with text, HTML, images, and LaTeX content.
- Page Placement: Insert tables at specific locations within a PDF with precision.
- Customizable Layout: Adjust table structure, cell alignment, and styling.
- Batch Processing: Process multiple documents simultaneously for maximum efficiency.
PDF TOC Generator
The Documentize PDF TOC Generator 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:
- Create an instance of the
TocGenerator
class. - Create an instance of
TocOptions
to configure TOC generation settings. - Add the input PDF file using the
AddInput
method. - Specify the output PDF file with the TOC using the
AddOutput
method. - Call the
Process
method to generate the TOC.
1var tocGenerator = new TocGenerator();
2var tocOptions = new TocOptions();
3
4// Add input and output files
5tocOptions.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
6tocOptions.AddOutput(new FileDataSource(@"C:\Samples\output_with_toc.pdf"));
7
8// Generate the TOC
9tocGenerator.Process(tocOptions);
Customizing the TOC
You can customize the Table of Contents by modifying the TocOptions
class. For example, you can control the level of depth for the TOC entries, set specific formatting options, and more:
1var tocOptions = new TocOptions
2{
3 Depth = 3, // Set TOC depth level to 3
4 FontSize = 12, // Set font size for TOC entries
5 Title = "Table of Contents" // Customize the TOC title
6};
7
8// Add input and output files
9tocOptions.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
10tocOptions.AddOutput(new FileDataSource(@"C:\Samples\output_with_toc.pdf"));
11
12// Generate the TOC with customized options
13tocGenerator.Process(tocOptions);
How to Handle Results
After processing, the Process
method returns a ResultContainer
object that holds details about the TOC generation. You can retrieve and print the output details:
1var resultContainer = tocGenerator.Process(tocOptions);
2
3// Access the result collection and print the output file path
4var result = resultContainer.ResultCollection[0];
5Console.WriteLine(result);
Batch Processing for Multiple PDFs
The PDF TOC Generator plugin supports batch processing, enabling you to add TOCs to multiple PDF documents simultaneously.
1var tocGenerator = new TocGenerator();
2var tocOptions = new TocOptions();
3
4// Add multiple input PDFs
5tocOptions.AddInput(new FileDataSource(@"C:\Samples\file1.pdf"));
6tocOptions.AddInput(new FileDataSource(@"C:\Samples\file2.pdf"));
7
8// Add the output PDFs with TOC
9tocOptions.AddOutput(new FileDataSource(@"C:\Samples\output1_with_toc.pdf"));
10tocOptions.AddOutput(new FileDataSource(@"C:\Samples\output2_with_toc.pdf"));
11
12// Process the batch TOC generation
13tocGenerator.Process(tocOptions);
Key Features:
- Dynamic TOC Generation: Create a TOC for any PDF file with automatically generated entries based on headings or bookmarks.
- Batch Processing: Generate TOCs for multiple PDF documents at once.
- 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.
PDF Signature
The Documentize PDF Signature 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:
- Instantiate the
SignOptions
class with the PFX file path and password. - Add the input PDF and the output file to the options.
- Run the
Process
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
8Signature.Process(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.
- Instantiate
SignOptions
with a stream containing the PFX and the password. - Add the input and output files.
- Run the
Process
method to apply the signature.
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
6Signature.Process(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
.
- Create an instance of
SignOptions
. - Set
Visible
to false
. - Add input and output files.
- Call
Process
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
7Signature.Process(options);
You can use extra options during adding signature to a PFX file like Reason, Contact, Location, PageNumber.
- Instantiate the
SignOptions
class with the PFX file path and password. - Add the input PDF and the output file to the options.
- Set values for your options.
- Run the
Process
method to apply the 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// Optional parameters
5options.Reason = "my Reason";
6options.Contact = "my Contact";
7options.Location = "my Location";
8options.PageNumber = 3;
9// Perform the process
10Signature.Process(options);
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.
PDF Splitter
The Documentize PDF Splitter 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:
- Create an instance of
SplitOptions
to configure the splitting options. - Add the input PDF file using the
AddInput
method. - Add output files for each split page using the
AddOutput
method. - Run the
Process
method in the Splitter
class to split the document.
1var splitOptions = new SplitOptions();
2
3// Add the input PDF file
4splitOptions.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
5
6// Specify output files for each page
7splitOptions.AddOutput(new FileDataSource(@"C:\Samples\output_page_1.pdf"));
8splitOptions.AddOutput(new FileDataSource(@"C:\Samples\output_page_2.pdf"));
9splitOptions.AddOutput(new FileDataSource(@"C:\Samples\output_page_3.pdf"));
10
11// Process the split operation
12Splitter.Process(splitOptions);
Key Features:
- Split PDF by Page: Break down a PDF document into individual pages.
- Batch Processing: Split large batches of PDFs in one go.
- Custom Split Options: Configure the splitting process based on your requirements.
- Organized Output: Easily manage the output files for each split page or section.
PDF ChatGPT
The Documentize ChatGPT 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:
- Create an instance of the
PdfChatGptRequestOptions
class to configure the request options. - Add input and output PDF files.
- Set the API key and specify parameters such as maximum token count and the query for the ChatGPT model.
- Run the
ProcessAsync
method to generate the chat completion.
1var options = new PdfChatGptRequestOptions();
2options.ApiKey = "sk-******"; // Set your API key
3options.MaxTokens = 1000; // Set the maximum number of tokens
4options.Query = "Analyze this text for key themes.";
5
6// Add the input PDF file
7options.AddInput(new FileDataSource("input.pdf"));
8
9// Specify where to save the output PDF with chat responses
10options.AddOutput(new FileDataSource("output.pdf"));
11
12// Create an instance of the PdfChatGpt plugin
13var plugin = new PdfChatGpt();
14
15// Run the process asynchronously
16var result = await plugin.ProcessAsync(options);
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.
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.
- Add a system message that sets the context for ChatGPT.
- Add a user message that represents the userâs input for the conversation.
1var options = new PdfChatGptRequestOptions();
2options.ApiKey = "sk-******"; // Set your API key
3
4// Add system message for context
5options.AddSystemMessage("You are an AI trained to summarize text.");
6
7// Add user message to query the ChatGPT model
8options.AddUserMessage("Please summarize the attached document.");
9
10// Add input and output PDFs
11options.AddInput(new FileDataSource("input.pdf"));
12options.AddOutput(new FileDataSource("output.pdf"));
13
14// Process the request asynchronously
15var plugin = new PdfChatGpt();
16var result = await plugin.ProcessAsync(options);
The Documentize PDF Image 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.
To extract images from a PDF file, follow these steps:
- Create an instance of the
ImageExtractorOptions
class. - Add the input file path to the options using the
AddInput
method. - Set the output Directory path for images using the
AddOutput
method. - Process the image extraction using the plugin.
- Retrieve the extracted images from the result container.
1// Create ImageExtractorOptions to set instructions
2var options = new ImageExtractorOptions();
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 = ImageExtractor.Process(options);
9// Get path to image result
10var imageExtracted = results.ResultCollection[0].ToFile();
The ImageExtractor plugin supports saving to streams, which allows you to extract images from PDF files into streams without using temporary folders.
1// Create ImageExtractorOptions to set instructions
2var options = new ImageExtractorOptions();
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 = ImageExtractor.Process(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.
The Documentize PDF Text 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.
To extract text from a PDF document, follow these steps:
- Create an instance of
TextExtractorOptions
to configure the extraction options. - Add the input PDF file using the
AddInput
method. - Run the
Process
method to extract the text. - Access the extracted text using the
ResultContainer.ResultCollection
.
1// Create TextExtractorOptions object to set instructions
2var options = new TextExtractorOptions();
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Perform the process
6var results = TextExtractor.Process(options);
7// Get the extracted text from the ResultContainer object
8var textExtracted = results.ResultCollection[0].ToString();
The TextExtractor plugin offers three extraction modes, providing flexibility based on your needs.
- Pure Mode: Preserves the original formatting, including spaces and alignment.
- Raw Mode: Extracts the text without formatting, useful for raw data processing.
- Flatten Mode: Represent PDF content with positioning text fragments by their coordinates.
1// Create TextExtractorOptions object to set TextFormattingMode
2var options = new TextExtractorOptions(TextFormattingMode.Pure);
3// Add input file path
4options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
5// Perform the process
6var results = TextExtractor.Process(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.
PDF Timestamp Adder
The Documentize PDF Timestamp Adder for .NET is a powerful tool designed to add secure timestamps to your PDF documents. It enhances the integrity and authenticity of your documents by providing a trusted time reference, ensuring compliance with digital signature standards.
How to Add a Timestamp to PDF
To add a secure timestamp to a PDF document, follow these steps:
- Create an instance of the
Timestamp
class. - Create an instance of
AddTimestampOptions
to configure the timestamping process. - Add the input PDF file using the
AddInput
method. - Set the output file path using
AddOutput
. - Execute the timestamping using the
Process
method.
1// Instantiate the Timestamp plugin
2var plugin = new Timestamp();
3
4// Configure the timestamping options
5var opt = new AddTimestampOptions("path_to_pfx", "password_for_pfx", "timestamp_server_url");
6
7// Add input PDF file
8opt.AddInput(new FileDataSource("path_to_pdf"));
9
10// Specify the output PDF file
11opt.AddOutput(new FileDataSource("path_to_result_pdf"));
12
13// Perform the timestamping process
14plugin.Process(opt);
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.
- Create an instance of the
Timestamp
class. - Create an instance of
AddTimestampOptions
, including the serverBasicAuthCredentials
. - Add the input file and output file paths.
- Call the
Process
method.
1// Instantiate the Timestamp plugin
2var plugin = new Timestamp();
3
4// Configure the timestamping options with authentication
5var opt = new AddTimestampOptions("path_to_pfx", "password_for_pfx", "timestamp_server_url", "username:password");
6
7// Add input PDF file
8opt.AddInput(new FileDataSource("path_to_pdf"));
9
10// Specify the output PDF file
11opt.AddOutput(new FileDataSource("path_to_result_pdf"));
12
13// Perform the timestamping process
14plugin.Process(opt);
Handling PFX Files and Passwords
The AddTimestampOptions
class allows you to use a PFX file for digital signing along with the password.
- PFX Stream or File Path: You can provide a stream or file path to the PFX file.
- Password Protection: Ensure you securely manage the password for the PFX file.
Key Features:
- Add Secure Timestamps: Effortlessly add secure timestamps to your PDF documents.
- Customizable Timestamp Servers: Use custom timestamp server URLs and authentication credentials.
- Automation: Integrate timestamping into your .NET applications for automated workflows.
- Compliance: Ensure your documents meet industry standards for digital signatures and timestamps.
PDF/A Converter
The Documentize PDF/A 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:
- Create an instance of the
PdfAConverter
class. - Create an instance of
PdfAConvertOptions
to configure the conversion. - Specify the desired PDF/A version (e.g., PDF/A-3B).
- Add the input PDF file using the
AddInput
method. - Add the output file for the resulting PDF/A using the
AddOutput
method. - Call the
Process
method to execute the conversion.
1var pdfAConverter = new PdfAConverter();
2var pdfAOptions = new PdfAConvertOptions
3{
4 PdfAVersion = PdfAStandardVersion.PDF_A_3B
5};
6
7// Add the input PDF file
8pdfAOptions.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
9
10// Specify the output PDF/A file
11pdfAOptions.AddOutput(new FileDataSource(@"C:\Samples\output_pdfa.pdf"));
12
13// Process the conversion
14pdfAConverter.Process(pdfAOptions);
Validating PDF/A Compliance
You can validate existing PDF files for PDF/A compliance using the PdfAValidateOptions
class.
1var pdfAConverter = new PdfAConverter();
2var validationOptions = new PdfAValidateOptions
3{
4 PdfAVersion = PdfAStandardVersion.PDF_A_1A
5};
6
7// Add the PDF file to be validated
8validationOptions.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
9
10// Run the validation process
11var resultContainer = pdfAConverter.Process(validationOptions);
12
13// Check the validation result
14var validationResult = (PdfAValidationResult)resultContainer.ResultCollection[0].Data;
15Console.WriteLine("PDF/A Validation Passed: " + validationResult.IsValid);
Batch Processing for PDF/A Conversion
This plugin supports batch processing, allowing you to convert or validate multiple PDF files for PDF/A compliance at once.
1var pdfAConverter = new PdfAConverter();
2var pdfAOptions = new PdfAConvertOptions
3{
4 PdfAVersion = PdfAStandardVersion.PDF_A_3B
5};
6
7// Add multiple input PDFs
8pdfAOptions.AddInput(new FileDataSource(@"C:\Samples\file1.pdf"));
9pdfAOptions.AddInput(new FileDataSource(@"C:\Samples\file2.pdf"));
10
11// Specify output files for the converted PDF/As
12pdfAOptions.AddOutput(new FileDataSource(@"C:\Samples\file1_pdfa.pdf"));
13pdfAOptions.AddOutput(new FileDataSource(@"C:\Samples\file2_pdfa.pdf"));
14
15// Process the batch conversion
16pdfAConverter.Process(pdfAOptions);
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.
- Batch Processing: Process multiple files at once for conversion or validation.
- Efficient Workflow: Minimize time and effort with fast and reliable conversion processes.
PDF to XLS Converter
The Documentize PDF to XLS 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:
- Configure the conversion settings using the
PdfToXlsOptions
class. - Add input PDF files using the
AddInput
method. - Specify the output file path using the
AddOutput
method. - Execute the
Process
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_file.xlsx"));
7// Perform the process
8XlsConverter.Process(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
12XlsConverter.Process(options);
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 to DOC Converter
The Documentize PDF to DOC 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:
- Create an instance of the
DocConverter
class. - Create an instance of
DocConversionOptions
to configure the conversion process. - Add the input PDF file using the
AddInput
method. - Add the output file path for the resulting DOC/DOCX file using the
AddOutput
method. - Run the
Process
method to execute the conversion.
1var docConverter = new DocConverter();
2var options = new DocConversionOptions()
3{
4 SaveFormat = SaveFormat.DocX, // Output format as DOCX
5 ConversionMode = ConversionMode.EnhancedFlow // Optimize layout and formatting
6};
7
8// Add the input PDF file
9options.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
10
11// Add the output Word document path
12options.AddOutput(new FileDataSource(@"C:\Samples\output.docx"));
13
14// Process the conversion
15docConverter.Process(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.
1var docConverter = new DocConverter();
2var options = new DocConversionOptions()
3{
4 SaveFormat = SaveFormat.Doc, // Output format as DOC
5 ConversionMode = ConversionMode.Precise // Maintain original PDF layout as closely as possible
6};
7
8// Add the input PDF file
9options.AddInput(new FileDataSource(@"C:\Samples\input.pdf"));
10
11// Add the output Word document path
12options.AddOutput(new FileDataSource(@"C:\Samples\output.doc"));
13
14// Process the conversion
15docConverter.Process(options);
Batch Processing PDF to DOC/DOCX Conversion
The PDF to DOC Converter supports batch processing, allowing you to convert multiple PDF files at once. Here’s an example of batch conversion:
1var docConverter = new DocConverter();
2var options = new DocConversionOptions()
3{
4 SaveFormat = SaveFormat.DocX
5};
6
7// Add multiple input PDF files
8options.AddInput(new FileDataSource(@"C:\Samples\file1.pdf"));
9options.AddInput(new FileDataSource(@"C:\Samples\file2.pdf"));
10
11// Add output file paths for the resulting DOCX files
12options.AddOutput(new FileDataSource(@"C:\Samples\output_file1.docx"));
13options.AddOutput(new FileDataSource(@"C:\Samples\output_file2.docx"));
14
15// Process the batch conversion
16docConverter.Process(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.
- Batch Processing: Convert multiple PDF files at once.
- Custom Conversion Options: Fine-tune the conversion process with different modes, like Enhanced Flow, for better layout.
PDF to JPEG Converter
The Documentize PDF to JPEG 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:
- Create an instance of
PdfToJpegOptions
to configure the conversion process. - Add the input PDF File using the
AddInput
method. - Set the output Directory path for the JPEG images using the
AddOutput
method. - Run the
Process
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
8JpegConverter.Process(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 = new List<int> { 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
14JpegConverter.Process(options);
The Process 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 = JpegConverter.Process(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 PNG Converter
The Documentize PDF to PNG 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:
- Create an instance of
PdfToPngOptions
to configure the conversion process. - Add the input PDF File using the
AddInput
method. - Set the output Directory path for the PNG images using the
AddOutput
method. - Run the
Process
method to convert the PDF pages into PNG images.
1// Create PdfToPngOptions object to set instructions
2var options = new PdfToPngOptions();
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
8PngConverter.Process(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 = new List<int> { 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
12PngConverter.Process(options);
Handling Conversion Results
The Process 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 = PngConverter.Process(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 Converter
The Documentize PDF to TIFF 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:
- Create an instance of
PdfToTiffOptions
to configure the conversion process. - Add the input PDF file using the
AddInput
method. - Specify the output file path for the TIFF images using the
AddOutput
method. - Run the
Process
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
8TiffConverter.Process(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
12TiffConverter.Process(options);
Multi-Page TIFF Creation
The PDF to TIFF Converter 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
10TiffConverter.Process(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
11TiffConverter.Process(options);
How to Handle Conversion Results
The Process 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 = TiffConverter.Process(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.
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.
To flatten form fields in a PDF document, follow these steps:
- Create an instance of the
FormFlattenerOptions
class. - Add the input and output files to the options.
- 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.
FAQs
This FAQ provides comprehensive information regarding the features and functionalities of Documentize .NET Plugins, covering aspects like PDF conversion, form handling, and table of contents (TOC) generation.
General Questions
1. What is Documentize for .NET?
Documentize for .NET is a powerful library for managing and processing PDF documents programmatically. It includes plugins for converting PDFs into various formats, editing PDF forms, adding digital signatures, generating TOCs, and ensuring PDF/A compliance for long-term archival.
2. How do I install Documentize plugins for .NET?
You can install the Documentize plugins by downloading assembly files from the official website or fetching packages directly from NuGet. Detailed installation instructions are available within each pluginâs documentation.
PDF Conversion Plugins
3. How can I convert a PDF document to a Word (DOC/DOCX) file?
To convert a PDF document into Word format using the PDF to DOC Converter:
- Instantiate the
PdfDoc
class. - Create a
PdfToDocOptions
object to configure conversion options. - Add input PDF and output DOC/DOCX file paths.
- Call the
Process
method to execute the conversion.
4. How do I convert PDF pages into JPEG images?
Using the PDF to JPEG Converter:
- Create an instance of the
Jpeg
class. - Set conversion options (e.g., resolution, page range) via
JpegOptions
. - Add input/output file paths.
- Call the
Jpeg.Process
method to run the conversion.
5. How do I convert a PDF to PNG?
To convert a PDF into PNG format:
- Create an instance of the
Png
class and a PngOptions
object. - Add the input PDF and specify the output folder.
- Set options such as resolution (e.g., 300 DPI).
- Call the
Process
method to generate PNG images.
6. How do I convert a PDF to Excel (XLS/XLSX)?
For converting PDF to Excel:
- Instantiate the
PdfXls
class. - Use
PdfToXlsOptions
to configure input/output paths and conversion options. - Call the
Process
method to start the conversion.
7. How do I convert a PDF to HTML?
To convert PDF documents into HTML:
- Create an instance of the
PdfHtml
class. - Configure conversion options with
PdfToHtmlOptions
or HtmlToPdfOptions
. - Add input/output paths and call the
Process
method.
The PDF Form Editor provides capabilities to:
- Add fields (
FormEditorAddOptions
). - Update fields (
FormEditorSetOptions
). - Remove fields (
FormRemoveSelectedFieldsOptions
).
After configuring the form fields, run the Process
method.
To flatten form fields:
- Instantiate the
FormFlattener
class. - Use
FormFlattenAllFieldsOptions
to flatten all fields or FormFlattenSelectedFieldsOptions
to target specific fields. - Add input/output files and call the
Process
method.
To export form data, use the PDF Form Exporter. Create a FormExporterValuesToCsvOptions
object, specify form field conditions, and run the Process
method to export the data into CSV format.
PDF/A and TOC Management
For converting PDFs into PDF/A:
- Use the
PdfAConverter
class. - Configure the PDF/A version (e.g., PDF/A-3B) in
PdfAConvertOptions
. - Add input/output paths and call the
Process
method.
12. How do I generate a Table of Contents (TOC) in a PDF?
To create a TOC:
- Create an instance of the
TocGenerator
class. - Use
TocOptions
to define TOC parameters. - Add input/output files and run the
Process
method.
Signature Handling
13. How can I digitally sign a PDF document?
To add a digital signature:
- Instantiate the
Signature
class. - Use
SignOptions
to configure the PFX file, password, and signature details (e.g., reason, contact info). - Add input/output files and run the
Process
method.
Additional Features
14. Can I split PDF files using Documentize?
Yes, using the PDF Splitter:
- Instantiate the
Splitter
class. - Configure split options using
SplitOptions
. - Add input/output paths and call the
Process
method.
15. How do I merge multiple PDF files into one?
To merge PDFs:
- Instantiate the
Merger
class. - Add input PDFs and specify an output file via
MergeOptions
. - Run the
Process
method to merge the files.
16. Is Documentize limited to working with PDFs only?
While Documentize primarily focuses on PDF manipulation, it also supports conversions to and from formats such as DOC, XLS, HTML, JPEG, and PNG.
Licensing and Compatibility
17. What are the system requirements for using Documentize plugins?
Documentize supports:
- Operating Systems: Windows 7-11, Windows Server 2003-2022, macOS (10.12+), and Linux.
- Frameworks: .NET Framework 4.0 to 8.0.
- IDE: Compatible with various versions of Visual Studio.
18. How do I set license keys for Documentize?
To activate a plugin, reference Documentize in your project and set the license keys before calling any methods. Refer to the specific pluginâs documentation for detailed instructions.
19. Where can I find more examples and documentation for Documentize plugins?
Complete API documentation and examples can be found on the Documentize website or through the NuGet packages within your development environment.