v25.10
- Class PdfExtractor: contains all functions of plugins: TextExtractor, ImageExtractor, FormExporter.
- Class TextExtractor: will be deleted soon, use PdfExtractor.
- Class ImageExtractor: will be deleted soon, use PdfExtractor.
- Class FormExporter: will be deleted soon, use PdfExtractor.
- Class TextExtractorOptions: renamed to Class ExtractTextOptions.
- Class ImageExtractorOptions: renamed to Class ExtractImagesOptions.
- Class FormExportToDsvOptions: renamed to Class ExtractFormDataToDsvOptions.
Example Usage:
The example demonstrates how to extract text content of PDF document.
// Create ExtractTextOptions object to set instructions
var options = new ExtractTextOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Perform the process
var results = PdfExtractor.ExtractText(options);
// Get the extracted text from the ResultContainer object
var textExtracted = results.ResultCollection[0].ToString();
Example Usage:
The example demonstrates how to extract text content of PDF document with TextFormattingMode.
// Create ExtractTextOptions object to set TextFormattingMode
var options = new ExtractTextOptions(TextFormattingMode.Pure);
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Perform the process
var results = PdfExtractor.ExtractText(options);
// Get the extracted text from the ResultContainer object
var textExtracted = results.ResultCollection[0].ToString();
Example Usage:
The example demonstrates how to extract images from PDF document.
// Create ExtractImagesOptions to set instructions
var options = new ExtractImagesOptions();
// 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 = PdfExtractor.ExtractImages(options);
// Get path to image result
var imageExtracted = results.ResultCollection[0].ToFile();
Example Usage:
The example demonstrates how to Export Form values to CSV file.
// Create ExtractFormDataToDsvOptions object to set instructions
var options = new ExtractFormDataToDsvOptions(',', 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
PdfExtractor.ExtractFormData(options);
New plugin PDF Manager
- Class PdfManager: contains all functions of plugins: Merger, Optimizer, Splitter, TableGenerator,TocGenerator.
- Class Merger: will be deleted soon.
- Class Optimizer: will be deleted soon, use PdfManager.
- Class Splitter: will be deleted soon, use PdfManager.
- Class TableGenerator: will be deleted soon, use PdfManager.
- Class TocGenerator: will be deleted soon, use PdfManager.
Example Usage:
The example demonstrates how to Merge two PDF documents.
// Create MergeOptions object to set instructions
var options = new MergeOptions();
// Add input file paths
options.AddInput(new FileDataSource("path_to_your_pdf_file_1.pdf"));
options.AddInput(new FileDataSource("path_to_your_pdf_file_2.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Merge(options);
Example Usage:
The example demonstrates how to Split PDF document.
// Create SplitOptions object to set instructions
var options = new SplitOptions();
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file paths
options.AddOutput(new FileDataSource("path_to_result_pdf_file_1.pdf"));
options.AddOutput(new FileDataSource("path_to_result_pdf_file_2.pdf"));
// Perform the process
PdfManager.Split(options);
Example Usage:
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 FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Optimize(options);
Example Usage:
The example demonstrates how to Rotate PDF document.
// Create RotateOptions object to set instructions
var options = new RotateOptions();
// Set new Rotation
options.Rotation = Rotation.On90;
// 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"));
// Perform the process
PdfManager.Rotate(options);
Example Usage:
The example demonstrates how to Resize PDF document.
// Create ResizeOptions object to set instructions
var options = new ResizeOptions();
// Set new PageSize
options.PageSize = PageSize.A3;
// 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"));
// Perform the process
PdfManager.Resize(options);
Example Usage:
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 FileDataSource("path_to_your_pdf_file.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf"));
// Perform the process
PdfManager.Compress(options);
Example Usage:
The example demonstrates how to Add Table to PDF file.
// Configure table options
var options = new TableOptions();
options.InsertPageBefore(1)
.AddTable()
.AddRow()
.AddCell().AddParagraph("Name")
.AddCell().AddParagraph("Age")
.AddRow()
.AddCell().AddParagraph("Bob")
.AddCell().AddParagraph("12")
.AddRow()
.AddCell().AddParagraph("Sam")
.AddCell().AddParagraph("20")
.AddRow()
.AddCell().AddParagraph("Sandy")
.AddCell().AddParagraph("26")
.AddRow()
.AddCell().AddParagraph("Tom")
.AddCell().AddParagraph("12")
.AddRow()
.AddCell().AddParagraph("Jim")
.AddCell().AddParagraph("27");
// Add input file path
options.AddInput(new FileDataSource("path_to_input.pdf"));
// Set output file path
options.AddOutput(new FileDataSource("path_to_output.pdf"));
// Perform the process
PdfManager.AddTable(options);
Example Usage:
The example demonstrates how to add Table of Contents to PDF file.
// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2));
options.Headings.Add(new TocHeading("Chapter I", 3));
options.Headings.Add(new TocHeading("Chapter II", 4));
options.Headings.Add(new TocHeading("Chapter III", 5));
// 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"));
// Perform the process
PdfManager.AddTableOfContents(options);
Example Usage:
The example demonstrates how to add Table of Contents to PDF file with generating bookmarks.
// 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));
options.Headings.Add(new TocHeading("Example A", 4, true, 2));
options.Headings.Add(new TocHeading("Example B", 4, true, 2));
options.Headings.Add(new TocHeading("Example C", 4, true, 2));
options.Headings.Add(new TocHeading("Example D", 4, true, 2));
options.Headings.Add(new TocHeading("Chapter III", 5, true, 1));
// 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"));
// Perform the process
PdfManager.AddTableOfContents(options);
Example Usage:
The example demonstrates how to add Table of Contents to PDF file and save as stream.
// Create TocOptions object to set instructions
var options = new TocOptions();
// Set the Title
options.Title = "My Table of Contents";
// Design Headings
options.Headings.Add(new TocHeading("Introduction", 2, false, 1));
// Add input file path
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf"));
// Set output stream
var outputStream = new MemoryStream();
options.AddOutput(new StreamDataSource(outputStream));
options.CloseOutputStreams = false;
// Perform the process
PdfManager.AddTableOfContents(options);
Improved usability of TableGenerator
- Class TableGenerator: is static and does not require the use of a constructor.
- Class TableGenerator: marked as Obsolete. Use PdfManager instead.
Improved usability of PdfChatGpt
- Class PdfChatGpt: is static and does not require the use of a constructor.
- Class PdfChatGptRequestOptions: added property CancellationToken (Moved from PdfChatGpt).
Example Usage:
The example demonstrates how to use PdfChatGpt plugin by adding messages to the request.
var options = new PdfChatGptRequestOptions();
options.AddOutput(new FileDataSource("PdfChatGPT_output.pdf")); // Add the output file path.
options.ApiKey = "Your API key."; // You need to provide the key to access the API.
options.MaxTokens = 1000; // The maximum number of tokens to generate in the chat completion.
// for cancel
// var cancelTokenSource = new CancellationTokenSource();
// var cToken = cancelTokenSource.Token;
// options.CancellationToken = cToken;
// Add the request messages.
options.Messages.Add(new Message
{
Content = "You are a helpful assistant.",
Role = Role.System
});
options.Messages.Add(new Message
{
Content = "What is the biggest pizza diameter ever made?",
Role = Role.User
});
// Process the request.
var result = await PdfChatGpt.ProcessAsync(options);
Fixed Bugs
- Fixed html to pdf conversion meta data
- Fixed PDF to PDF/A_3b - Text formatting issues and pictures get scaled
- Fixed PDF to PDFA: resultant PDFA reports error on printing
- Fixed PDF to HTML: resultant image contains background
- Fixed HTML to PDF: Some Chinese characters appear as box
- Fixed HTML to PDF: Base64 custom font is not honored
- Fixed HTML to PDF: Form field css is not being applied
- Fixed HTML to PDF: chart is not properly rendering
- Fixed HTML to PDF: Special characters are not being rendered
v25.9
Improved usability of DocConverter and added extra mode
- Class DocConverter: is static and does not require the use of a constructor.
- Class PdfToDocOptions: added property “Mode” that allows you to customize the conversion process.
- Enum DocConversionMode: allows you to customize the pdf-doc conversion process. Values:
- TextBox: This mode is fast and good for maximally preserving original look of the PDF file, but editability of the resulting document could be limited. Every visually grouped block of text in the original PDF file is converted into a textbox in the resulting document.
- Flow: Full recognition mode, the engine performs grouping and multi-level analysis to restore the original document author’s intent and produce a maximally editable document.
Example Usage:
// The example demonstrates how to convert PDF document to Doc format.
// 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"));
// Perform the process
DocConverter.Process(options);
Example Usage:
// The example demonstrates how to convert PDF document to Doc format with setting Mode.
// 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);
Improved usability of PdfAConverter
Class PdfAConverter: is static and does not require the use of a constructor.
Example Usage:
// The example demonstrates how to convert the PDF document in a PDF/A format (PDF/A-3b in this case):
// Create the options class to set up the conversion process
var options = new PdfAConvertOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_3B
};
// Add the source file
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf")); // replace with your actual file path
// Add the path to save the converted file
options.AddOutput(new FileDataSource("path_to_the_converted_file.pdf"));
// Run the conversion
PdfAConverter.Process(options);
Example Usage:
// The example demonstrates how to validate the PDF document conformance to PDF/A format (PDF/A-1a in this case):
// Create the options class to set up the validation process
var options = new PdfAValidateOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_1A
};
// Add one or more files to be validated
options.AddInput(new FileDataSource("path_to_your_first_pdf_file.pdf")); // replace with your actual file path
options.AddInput(new FileDataSource("path_to_your_second_pdf_file.pdf"));
// add more files as needed
// Run the validation and get results
var resultContainer = PdfAConverter.Process(options);
// Check the resultContainer.ResultCollection property for validation results for each file:
for (var i = 0; i < resultContainer.ResultCollection.Count; i++)
{
var result = resultContainer.ResultCollection[i];
var validationResult = (PdfAValidationResult) result.Data;
var isValid = validationResult.IsValid; // Validation result for the i-th document
}
Improved usability of Timestamp
Class Timestamp: is static and does not require the use of a constructor.
Example Usage:
// The example demonstrates how to add Timestamp to the document.
// Create AddTimestampOptions object to set instructions
var options = new AddTimestampOptions("path_to_your_pfx_file.pfx", "password_for_your_pfx_file", "timestamp_server_url");
// 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"));
// Perform the process
Timestamp.Process(options);
Updated documentation
Updated examples, added extra examples:
- Information about license and Evaluation
- Product pages
- PDF Table Generator
- PDF TOC Generator
- PDF Timestamp Adder
- PDF/A Converter
- PDF Image Extractor
- PDF Text Extractor
- PDF to XLS Converter
- PDF to HTML Converter
Fixed Bugs
- Fixed issues with HTML to PDF
- Fixed issues with PDF to PDF/A-2B
- Improved PDF to JPEG: some text characters generated as square
- Fixed PDF to TIFF render
- Fixed PDF to JPEG unexpected exceptions
v25.8
Improved usability of JpegConverter
Class JpegConverter: is static and does not require the use of a constructor.
Example Usage:
// 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);
Improved usability of PngConverter
Class PngConverter: is static and does not require the use of a constructor.
Example Usage:
// 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);
Improved usability of XlsConverter
- Class XlsConverter: is static and does not require the use of a constructor.
- Class XlsConverter: fixed description.
Example Usage:
// The example demonstrates how to convert PDF to XLSX document.
// Create PdfToXlsOptions object to set instructions
var options = new PdfToXlsOptions();
// 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_xlsx_file.xlsx"));
// Perform the process
XlsConverter.Process(options);
Improved usability of Signature
- Class Signature: is static and does not require the use of a constructor.
- Class Signature: fixed description.
- Class Signature: interface IPlugin removed.
Example Usage:
// The example demonstrates how to sign PDF document.
// Create SignOptions object to set instructions
var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
// 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"));
// Perform the process
Signature.Process(options);
Modified constructors of PdfToHtmlOptions
Constructors and arguments optimized.
Text of evaluation mark changed.
Updated documentation
Updated examples, added extra examples:
- PDF to JPEG Converter
- PDF to PNG Converter
- PDF to TIFF Converter
- PDF Form Flattener
- HTML Converter
- PDF Security
- PDF Optimizer
- PDF Merger
- PDF Splitter
Fixed Bugs
- Fix issues with Annotations
- Fix issues after resizing
- Fix PDF to PDF/A - Font Names transformation
- Fix PDF to DOCX -Space is added in the header, and other issues
- Fix HTML to PDF - Transparent PNG Background
- Fix Compressed PDF- Improve work with Adobe Acrobat