Skip to content

Instantly share code, notes, and snippets.

@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
Created December 27, 2024 14:53
Convert PDF to HTML with Documentize for .NET plugin
using Documentize;
// Initialize the HtmlConverter
var htmlConverter = new HtmlConverter();
// Configure options for PDF to HTML conversion
var options = new PdfToHtmlOptions(PdfToHtmlOptions.SaveDataType.FileWithEmbeddedResources)
{
// Additional settings can be added here if needed
};
@documentize
documentize / pdf-to-png-conversion.cs
Created December 27, 2024 14:31
PDF to PNG conversion with Documentize for .NET plugin
using Documentize;
// Initialize the PngConverter
var pngConverter = new PngConverter();
// Configure PNG conversion options
var options = new PngOptions
{
OutputResolution = 300, // Set image resolution
PageList = new List<int> { 1, 2, 3 } // Convert specific pages
@documentize
documentize / create-nested-pdf-table.cs
Created December 27, 2024 14:26
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"));
@documentize
documentize / pdf-to-word.cs
Last active December 27, 2024 14:47
The example demonstrates how to convert PDF document to Docx format using Documentize SDK for .NET.
// create DocConverter
var plugin = new DocConverter();
// create PdfToDocOptions object to set instructions
var opt = new PdfToDocOptions();
// add input file path
opt.AddInput(new FileDataSource(inputPath));
// set output file path
opt.AddOutput(new FileDataSource(outputPath));
// perform the process
plugin.Process(opt);
// create ImageExtractor object to extract images
using (var plugin = new ImageExtractor())
{
// create ImageExtractorOptions
var opt = new ImageExtractorOptions();
// add input file path to data sources
opt.AddInput(new FileDataSource(inputPath));
// perform extraction process
@documentize
documentize / pdf-to-excel.cs
Created September 27, 2024 13:30
The example demonstrates how to convert PDF to XLSX document using Documentize for .NET SDK.
// create PdfXLS converter
var converter = new PdfXLS();
// create PdfToXLSOptions
var opt = new PdfToXLSOptions();
// add input file path
opt.AddInput(new FileDataSource(inputPath));
// set output file path
opt.AddOutput(new FileDataSource(outputPath));
converter.Process(opt);
@documentize
documentize / add-timestamp-pdf.cs
Created September 27, 2024 13:28
The example demonstrates how to add Timestamp to document using Documentize for .NET SDK.
// create Timestamp
var plugin = new Timestamp();
// create AddTimestampOptions object to set instructions
var opt = new AddTimestampOptions("path_to_pfx", "password_for_pfx", "timestamp_server_url");
// add input file path
opt.AddInput(new FileDataSource("path_to_pdf"));
// set output file path
opt.AddOutput(new FileDataSource("path_to_result_pdf"));
// perform the process
plugin.Process(opt);