Skip to content

Instantly share code, notes, and snippets.

// 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 February 7, 2025 09:50
PDF to DOC conversion with Documentize for .NET plugin
using Documentize;
// Initialize the DocConverter
var plugin = new DocConverter();
// Create PdfToDocOptions object to set instructions
var options = new PdfToDocOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_input.doc"));
@documentize
documentize / pdf-to-tiff-converter.cs
Created December 30, 2024 12:12
Convert PDF documents to Multi-page TIFF files using Documentize for .NET SDK plugins.
// create TiffConverter
var plugin = new TiffConverter();
// create PdfToTiffOptions object to set instructions
var opt = new PdfToTiffOptions();
// add input file path
opt.AddInput(new FileDataSource(inputPath));
// set output file path
opt.AddOutput(new DirectoryDataSource(outputPath));
// perform the process
plugin.Process(opt);
@documentize
documentize / pdf-to-html-conversion.cs
Last active February 7, 2025 08:37
Convert PDF to HTML with Documentize for .NET plugin
// Initialize the HtmlConverter
var plugin = new HtmlConverter();
// Create PdfToHtmlOptions object to set output data type as file with embedded resources
var options = new PdfToHtmlOptions(PdfToHtmlOptions.SaveDataType.FileWithEmbeddedResources);
// Define input and output file paths
options.AddInput(new FileDataSource("path_to_input.pdf"));
options.AddOutput(new FileDataSource("path_to_output.html"));
//Perform the process
plugin.Process(options);
@documentize
documentize / pdf-to-png-conversion.cs
Last active February 7, 2025 09:21
PDF to PNG conversion with Documentize for .NET plugin
using Documentize;
// Initialize the PngConverter
var plugin = new PngConverter();
// Create PdfToPngOptions object to set instructions
var options = new PdfToPngOptions()
{
OutputResolution = 400, // Set image resolution
};
// Add input File path
@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
Created December 11, 2024 06:34
Easily convert PDF document pages into high-quality JPEG images using Documentize .NET Plugin.
// create JpegConverter
var plugin = new JpegConverter();
// create PdfToJpegOptions object to set instructions
var opt = new PdfToJpegOptions();
// add input file path
opt.AddInput(new FileDataSource(inputPath));
// set output file path
opt.AddOutput(new DirectoryDataSource(outputPath));
// perform the process
plugin.Process(opt);
@documentize
documentize / html-to-pdf.cs
Created October 27, 2024 10:48
The example demonstrates how to convert PDF document to HTML format & back using Documentize SDK for .NET.
// Step 1: Initialize the HTML Converter
var converter = new HtmlConverter();
// Step 2: Configure options for HTML to PDF conversion
var options = new HtmlToPdfOptions();
// Step 3: Set file paths
options.AddInput(new FileDataSource("input.html"));
options.AddOutput(new FileDataSource("output.pdf"));
// create ImageExtractor object to extract images
var plugin = new ImageExtractor();
// create ImageExtractorOptions
var options = new ImageExtractorOptions();
// add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// set output directory
options.AddOutput(new DirectoryDataSource("path_to_results_directory"));
// perform extraction process
var resultContainer = plugin.Process(options);