Skip to content

Instantly share code, notes, and snippets.

@documentize
documentize / export_form_values_to_csv.cs
Created June 11, 2025 08:20
The example demonstrates how to Export Form values to CSV file
// Create FormExportToDsvOptions object to set instructions
var options = new FormExportToDsvOptions(',', true);
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_csv_file.csv"));
// Perform the process
FormExporter.Process(options);
// The example demonstrates how to Flatten fields in PDF file.
// Create FormFlattenerOptions object to set instructions
var options = new FormFlattenerOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Optional parameter for skip the field with name "Surname".
options.SkipFields.Add("Surname");
// Perform the process
// The example demonstrates how to add Table of Contents to PDF file.
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Generate links in bookmarks
options.GenerateBookmarks = true;
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
options.Headings.Add(new TocHeading("Chapter I", 3, true, 1));
options.Headings.Add(new TocHeading("Chapter II", 4, true, 1));
@documentize
documentize / pdf-to-doc-conversion.cs
Last active September 4, 2025 08:38
PDF to DOC conversion with Documentize for .NET plugin
// Create PdfToDocOptions object to set instructions
var options = new PdfToDocOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_file.doc"));
// Set Mode
options.Mode = DocConversionMode.Flow;
// Perform the process
DocConverter.Process(options);
@documentize
documentize / pdf-to-tiff-converter.cs
Last active June 3, 2025 11:18
Convert PDF documents to Multi-page TIFF files using Documentize for .NET SDK plugins.
// Create PdfToTiffOptions object to set instructions
var options = new PdfToTiffOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output Directory path
options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
// Perform the process
TiffConverter.Process(options);
@documentize
documentize / pdf-to-png-conversion.cs
Last active August 7, 2025 08:09
The example demonstrates how to convert PDF document into PNG format.
// Create PdfToPngOptions object to set instructions
var options = new PdfToPngOptions();
// Add input File path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Set output Directory path
options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
// Perform the process
PngConverter.Process(options);
@documentize
documentize / create-nested-pdf-table.cs
Last active February 7, 2025 08:22
PDF table generation using Documentize .NET plugin
using Documentize;
// Initialize the TableGenerator
var tableGenerator = new TableGenerator();
// Configure advanced table options
var options = new TableOptions()
.InsertPageAfter(2) // Insert the table after the second page
.AddTable()
.AddRow()
@documentize
documentize / pdf-to-jpeg.cs
Last active August 7, 2025 08:06
The example demonstrates how to convert PDF document into JPEG format.
// Create PdfToJpegOptions object to set instructions
var options = new PdfToJpegOptions();
// Add input File path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Set output Directory path
options.AddOutput(new DirectoryDataSource("path_to_output_directory"));
// Perform the process
JpegConverter.Process(options);
@documentize
documentize / html-to-pdf.cs
Last active July 8, 2025 11:22
The example demonstrates how to convert PDF document to HTML format & back using Documentize SDK for .NET.
// The example demonstrates how to convert HTML to PDF document.
// Create HtmlToPdfOptions
var options = new HtmlToPdfOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_input.html"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_output.pdf"));
//Perform the process
HtmlConverter.Process(options);
@documentize
documentize / extract-pdf-image.cs
Last active July 8, 2025 08:32
The example demonstrates how to extract images from PDF document.
// Create ImageExtractorOptions to set instructions
var options = new ImageExtractorOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output Directory path
options.AddOutput(new DirectoryDataSource("path_to_results_directory"));
// Perform the process
var results = ImageExtractor.Process(options);
// Get path to image result
var imageExtracted = results.ResultCollection[0].ToFile();