Skip to content

Instantly share code, notes, and snippets.

@documentize
documentize / pdf_manager_compress.cs
Created February 25, 2026 07:46
The example demonstrates how to Compress PDF document.
// Create CompressOptions object to set instructions
var options = new CompressOptions();
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Compress(options);
@documentize
documentize / pdf_manager_optimize.cs
Created February 25, 2026 07:30
The example demonstrates how to Optimize PDF document.
// Create OptimizeOptions object to set instructions
var options = new OptimizeOptions();
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Optimize(options);
@documentize
documentize / remove_fields.cs
Last active March 10, 2026 14:07
The example demonstrates how to Remove fields from PDF file.
// Create RemoveFieldsOptions object to set instructions
var options = new RemoveFieldsOptions();
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Remove(options);
@documentize
documentize / get_field_names.cs
Created February 11, 2026 09:07
The example demonstrates how to Get field Names from PDF file.
// Get Field Names
var fieldNames = PdfForm.GetNames(new GetFieldNamesOptions("path_to_your_pdf_file.pdf"));
@documentize
documentize / export_form_values_to_csv_by_pdf_form.cs
Last active March 10, 2026 14:07
The example demonstrates how to Export Form values to CSV file by PdfForm
// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions(',', true);
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_csv_file.csv"));
// Perform the process
PdfForm.Extract(options);
@documentize
documentize / extract-pdf-properties.cs
Last active February 16, 2026 07:42
The example demonstrates how to Extract Properties (Title, Author, Subject, Keywords, Number of Pages) from PDF file.
// Create ExtractPropertiesOptions object to set input file
var options = new ExtractPropertiesOptions("path_to_your_pdf_file.pdf");
// Perform the process and get Properties
var pdfProperties = PdfExtractor.Extract(options);
var filename = pdfProperties.FileName;
var title = pdfProperties.Title;
var author = pdfProperties.Author;
var subject = pdfProperties.Subject;
var keywords = pdfProperties.Keywords;
var created = pdfProperties.Created;
@documentize
documentize / export_form_values_to_csv.cs
Last active March 10, 2026 13:39
The example demonstrates how to Export Form values to CSV file by PdfExtractor
// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions(',', true);
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_csv_file.csv"));
// Perform the process
PdfExtractor.Extract(options);
@documentize
documentize / flatten_fields.cs
Last active March 10, 2026 14:06
The example demonstrates how to Flatten fields in PDF file.
// Create FlattenFieldsOptions object to set instructions
var options = new FlattenFieldsOptions();
// Add input file path
options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
// Perform the process
PdfForm.Flatten(options);
// Create TocOptions object to set instructions
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 March 10, 2026 13:15
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 FileData("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileData("path_to_result_file.doc"));
// Perform the process
PdfConverter.Convert(options);