This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create MergeOptions object to set instructions | |
| var options = new MergeOptions(); | |
| // Add input file paths | |
| options.AddInput(new FileData("path_to_your_pdf_file_1.pdf")); | |
| options.AddInput(new FileData("path_to_your_pdf_file_2.pdf")); | |
| // Set output file path | |
| options.AddOutput(new FileData("path_to_result_pdf_file.pdf")); | |
| // Perform the process | |
| PdfManager.Merge(options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create the options class to set up the conversion process | |
| var options = new PdfToPdfAOptions | |
| { | |
| PdfAVersion = PdfAStandardVersion.PDF_A_3B | |
| }; | |
| // Add the source file | |
| options.AddInput(new FileData("path_to_your_pdf_file.pdf")); // replace with your actual file path | |
| // Add the path to save the converted file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var options = new ChatGptRequestOptions(); | |
| // Set output file path | |
| options.AddOutput(new FileDataSource("path_to_result_pdf_file.pdf")); | |
| 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. | |
| // Add the request messages. | |
| options.Messages.Add(new Message | |
| { | |
| Content = "You are a helpful assistant.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create ExtractTextOptions object to set input file path | |
| var options = new ExtractTextOptions("path_to_your_pdf_file.pdf"); | |
| // Perform the process and get the extracted text | |
| var textExtracted = PdfExtractor.Extract(options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create EncryptOptions object to set instructions | |
| var options = new EncryptOptions("123456", "qwerty"); | |
| // 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 | |
| PdfSecurity.Encrypt(options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create DecryptOptions object to set instructions | |
| var options = new DecryptOptions("123456"); | |
| // 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 | |
| PdfSecurity.Decrypt(options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create SignOptions object to set instructions | |
| var options = new SignOptions("path_to_your_pdf_file.pdf", "path_to_result_pdf_file.pdf", "path_to_your_pfx_file.pfx", "password_of_your_pfx_file"); | |
| // Perform the process | |
| PdfSecurity.Sign(options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create SplitOptions object to set instructions | |
| var options = new SplitOptions(); | |
| // Add input file path | |
| options.AddInput(new FileData("path_to_your_pdf_file.pdf")); | |
| // Set output file paths | |
| options.AddOutput(new FileData("path_to_result_pdf_file_1.pdf")); | |
| options.AddOutput(new FileData("path_to_result_pdf_file_2.pdf")); | |
| // Perform the process | |
| PdfManager.Split(options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create PdfToXlsOptions object to set instructions | |
| var options = new PdfToXlsOptions(); | |
| // 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_xlsx_file.xlsx")); | |
| // Perform the process | |
| PdfConverter.Convert(options); |
OlderNewer