### Install Tooltip.js via Package Managers Source: https://github.com/aspose-omr/aspose.omr-for-.net/blob/master/Demos/src/Aspose.OMR.Live.Demos.UI/Scripts/README.md Commands to install Tooltip.js using various package managers. ```bash npm install tooltip.js --save ``` ```bash yarn add tooltip.js ``` ```bash bower install tooltip.js=https://unpkg.com/tooltip.js --save ``` -------------------------------- ### Install Popper.js via Package Managers Source: https://github.com/aspose-omr/aspose.omr-for-.net/blob/master/Demos/src/Aspose.OMR.Live.Demos.UI/Scripts/README.md Commands to install Popper.js using various package managers. ```bash npm install popper.js --save ``` ```bash yarn add popper.js ``` ```bash PM> Install-Package popper.js ``` ```bash bower install popper.js --save ``` -------------------------------- ### Perform Basic OMR Recognition Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Recognize images against a loaded template and export the results to formats like CSV. This example iterates through a list of images and saves the output. ```csharp using Aspose.OMR.Api; using System; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; string[] userImages = new string[] { "Sheet1.jpg", "Sheet2.jpg" }; string imageFolderPath = @"C:\Scans\"; string outputPath = @"C:\Results\"; // Initialize engine and load template OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded."); // Process each scanned image for (int i = 0; i < userImages.Length; i++) { string imagePath = Path.Combine(imageFolderPath, userImages[i]); // Recognize the image and export to CSV string csvResult = templateProcessor.RecognizeImage(imagePath).GetCsv(); // Save result to file string outputFile = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(userImages[i]) + ".csv"); File.WriteAllText(outputFile, csvResult); Console.WriteLine("Result exported: " + outputFile); } // Expected CSV output format: // Element Name,Value // "MainQuestions1","A" // "MainQuestions2","C" // "MainQuestions3","B" ``` -------------------------------- ### Perform OMR on JPG Image & Get Results in CSV Source: https://github.com/aspose-omr/aspose.omr-for-.net/blob/master/README.md This snippet demonstrates how to load an OMR template, process multiple user images, and save the recognition results in CSV format. Ensure the template and image files are accessible. ```csharp string TemplateName = "Sheet.omr"; string[] UserImages = new string[] { "Sheet1.jpg", "Sheet2.jpg" }; // input and output preparation string testFolderPath = RunExamples.GetSourceDir(); string templatePath = Path.Combine(testFolderPath, TemplateName); string outputPath = RunExamples.GetResultDir(); // actual OMR API calls OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded."); for (int i = 0; i < UserImages.Length; i++) { string imagePath = Path.Combine(testFolderPath, UserImages[i]); string csvResult = templateProcessor.RecognizeImage(imagePath).GetCsv(); File.WriteAllText(Path.Combine(outputPath, UserImages[i] + ".csv"), csvResult); Console.WriteLine("Result exported. Path: " + Path.Combine(outputPath, UserImages[i] + ".csv")); } Console.WriteLine("PerformOMROnImages executed successfully.\n\r"); ``` -------------------------------- ### Override applyStyle Modifier Source: https://github.com/aspose-omr/aspose.omr-for-.net/blob/master/Demos/src/Aspose.OMR.Live.Demos.UI/Scripts/README.md Example of disabling the default applyStyle modifier to manually handle positioning in frameworks like React. ```javascript function applyReactStyle(data) { // export data in your framework and use its content to apply the style to your popper }; const reference = document.querySelector('.my-button'); const popper = document.querySelector('.my-popper'); new Popper(reference, popper, { modifiers: { applyStyle: { enabled: false }, applyReactStyle: { enabled: true, fn: applyReactStyle, order: 800, }, }, }); ``` -------------------------------- ### Initialize OmrEngine Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Initializes the OmrEngine, which is the main entry point for all OMR operations. Optionally, a license can be set for full functionality. ```APIDOC ## Initialize OmrEngine ### Description Initializes the OmrEngine, which is the main entry point for all OMR operations. Optionally, a license can be set for full functionality. ### Method N/A (Constructor) ### Endpoint N/A ### Parameters None ### Request Example ```csharp using Aspose.OMR.Api; // Initialize the OMR engine OmrEngine engine = new OmrEngine(); // Optionally set license for full functionality License lic = new License(); lic.SetLicense(@"C:\Licenses\Aspose.OMR.NET.lic"); Console.WriteLine("License is set."); // The engine is now ready for template generation or recognition operations ``` ### Response N/A ``` -------------------------------- ### Initialize the OMR Engine Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt The OmrEngine class is the primary entry point for all OMR operations. Optionally set a license file to enable full functionality. ```csharp using Aspose.OMR.Api; // Initialize the OMR engine OmrEngine engine = new OmrEngine(); // Optionally set license for full functionality License lic = new License(); lic.SetLicense(@"C:\Licenses\Aspose.OMR.NET.lic"); Console.WriteLine("License is set."); // The engine is now ready for template generation or recognition operations ``` -------------------------------- ### Complete OMR Workflow: Template Generation and Recognition Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Demonstrates the full OMR process: generating a template from markup, then using it to recognize filled forms from scanned images. ```csharp using Aspose.OMR.Api; using Aspose.OMR.Generation; using Aspose.OMR.Model; using System; using System.IO; class OMRWorkflow { public static void Run() { string workingDir = @"C:\OMRProject\"; string markupFile = Path.Combine(workingDir, "Markup", "Survey.txt"); string templateDir = Path.Combine(workingDir, "Templates"); string scansDir = Path.Combine(workingDir, "Scans"); string resultsDir = Path.Combine(workingDir, "Results"); // Ensure directories exist Directory.CreateDirectory(templateDir); Directory.CreateDirectory(resultsDir); OmrEngine engine = new OmrEngine(); // STEP 1: Generate template from markup Console.WriteLine("Generating template..."); GenerationResult genResult = engine.GenerateTemplate(markupFile); if (genResult.ErrorCode != 0) { Console.WriteLine("Template generation failed: " + genResult.ErrorMessage); return; } // Save as both image (for printing) and PDF genResult.Save(templateDir, "Survey"); genResult.SaveAsPdf(templateDir, "Survey"); Console.WriteLine("Template saved to: " + templateDir); // STEP 2: Load the generated template for recognition string templatePath = Path.Combine(templateDir, "Survey.omr"); TemplateProcessor processor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded for recognition."); // STEP 3: Process all scanned images string[] scannedFiles = Directory.GetFiles(scansDir, "*.jpg"); Console.WriteLine($"Found {scannedFiles.Length} scanned forms."); foreach (string scanPath in scannedFiles) { string fileName = Path.GetFileNameWithoutExtension(scanPath); Console.WriteLine($"Processing: {fileName}"); // Recognize image RecognitionResult result = processor.RecognizeImage(scanPath); // Export to both CSV and JSON string csvPath = Path.Combine(resultsDir, fileName + ".csv"); string jsonPath = Path.Combine(resultsDir, fileName + ".json"); File.WriteAllText(csvPath, result.GetCsv()); File.WriteAllText(jsonPath, result.GetJson()); Console.WriteLine($" -> Results saved to {csvPath}"); } Console.WriteLine("OMR workflow completed successfully."); } } ``` -------------------------------- ### Initialize Popper.js Source: https://github.com/aspose-omr/aspose.omr-for-.net/blob/master/Demos/src/Aspose.OMR.Live.Demos.UI/Scripts/README.md Basic instantiation of a Popper object by providing a reference element and a popper element. ```javascript var reference = document.querySelector('.my-button'); var popper = document.querySelector('.my-popper'); var anotherPopper = new Popper( reference, popper, { // popper options here } ); ``` -------------------------------- ### Use Popper.js Callbacks Source: https://github.com/aspose-omr/aspose.omr-for-.net/blob/master/Demos/src/Aspose.OMR.Live.Demos.UI/Scripts/README.md Implementation of onCreate and onUpdate callbacks to handle lifecycle events. ```javascript const reference = document.querySelector('.my-button'); const popper = document.querySelector('.my-popper'); new Popper(reference, popper, { onCreate: (data) => { // data is an object containing all the informations computed // by Popper.js and used to style the popper and its arrow // The complete description is available in Popper.js documentation }, onUpdate: (data) => { // same as `onCreate` but called on subsequent updates } }); ``` -------------------------------- ### GetTemplateProcessor - Load OMR Template Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Loads an existing .omr template file and returns a TemplateProcessor object for recognition. ```APIDOC ## GetTemplateProcessor - Load OMR Template ### Description Loads an existing .omr template file and returns a TemplateProcessor object that can be used to recognize filled forms. ### Method N/A (Method of OmrEngine) ### Endpoint N/A ### Parameters #### Path Parameters - **templatePath** (string) - Required - The path to the .omr template file. ### Request Example ```csharp using Aspose.OMR.Api; using System; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded successfully."); // templateProcessor is now ready to recognize images against this template ``` ### Response #### Success Response (TemplateProcessor) - **TemplateProcessor** - An object ready to perform recognition against the loaded template. ``` -------------------------------- ### Generate OMR Template from Markup Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Creates printable OMR sheets and recognition files from text-based markup. The Save method outputs both a PNG image and an OMR file. ```csharp using Aspose.OMR.Api; using Aspose.OMR.Generation; using System; using System.IO; string markupPath = @"C:\Markup\Sheet.txt"; string outputPath = @"C:\Templates\"; OmrEngine engine = new OmrEngine(); // Generate template from markup file GenerationResult result = engine.GenerateTemplate(markupPath); // Check for errors if (result.ErrorCode != 0) { Console.WriteLine("ERROR: " + result.ErrorCode + ": " + result.ErrorMessage); return; } // Save the generated template (creates .png image and .omr file) result.Save(outputPath, "Sheet"); Console.WriteLine("Template generated successfully."); // Output files: // - Sheet.png (printable OMR sheet) // - Sheet.omr (recognition template) ``` -------------------------------- ### Load an OMR Template Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Use the GetTemplateProcessor method to load a .omr template file, which is required for recognizing filled forms. ```csharp using Aspose.OMR.Api; using System; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded successfully."); // templateProcessor is now ready to recognize images against this template ``` -------------------------------- ### Define OMR Template Markup Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Syntax for defining questions, grids, images, and barcodes within a text-based OMR template file. ```text // Basic question with choice bubbles - use # to start questions // Choices are defined with () for bubble values #What is your favorite programming language? () C# () Java () Python () JavaScript // Named answer values - specify custom values in parentheses #Do you agree with the statement? (Yes) Yes, I agree! (No) No, I disagree // Rating scale question #Rate your satisfaction from 1 to 5: (1) (2) (3) (4) (5) // Text element with ?text= prefix ?text=Name__________________________________ Date____________ // Answer sheet for multiple-choice tests ?answer_sheet=MainQuestions elements_count=100 columns_count=5 // Grid element for numeric ID entry (each digit is a column of 0-9) ?grid=StudentID sections_count=8 // Image element with alignment ?image=logo.png align=center // Barcode/QR code element ?barcode=FormID value=FORM-2024-001 barcode_type=qr qr_version=1 x=1900 y=250 height=360 ``` -------------------------------- ### Process Forms with Barcode Recognition Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Demonstrates how to recognize OMR forms where barcode values are automatically extracted alongside bubble answers. ```csharp using Aspose.OMR.Api; using System; using System.IO; string templatePath = @"C:\Templates\FormWithBarcode.omr"; string imagePath = @"C:\Scans\FormWithBarcode.jpg"; string outputPath = @"C:\Results\"; OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded."); // Recognize image - barcodes are automatically detected string csvResult = templateProcessor.RecognizeImage(imagePath).GetCsv(); string outputFile = Path.Combine(outputPath, "FormWithBarcode.csv"); File.WriteAllText(outputFile, csvResult); Console.WriteLine("Result exported: " + outputFile); // CSV will include barcode values: // Element Name,Value // "AsposeWebsite","aspose.com" // "Question1","B" // "Question2","A" ``` -------------------------------- ### Export Recognition Results to CSV and JSON Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Converts recognition data into standard formats using GetCsv() or GetJson() methods on the RecognitionResult object. ```csharp using Aspose.OMR.Api; using Aspose.OMR.Model; using System; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; string imagePath = @"C:\Scans\Sheet1.jpg"; string outputPath = @"C:\Results\"; OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); // Perform recognition RecognitionResult result = templateProcessor.RecognizeImage(imagePath); // Export as CSV string csvResult = result.GetCsv(); File.WriteAllText(Path.Combine(outputPath, "results.csv"), csvResult); // CSV Output: // Element Name,Value // "Question1","B" // "Question2","A" // Export as JSON string jsonResult = result.GetJson(); File.WriteAllText(Path.Combine(outputPath, "results.json"), jsonResult); // JSON Output: // { // "Question1": "B", // "Question2": "A" // } Console.WriteLine("Results exported to CSV and JSON formats."); ``` -------------------------------- ### Recalculate Recognition Results in C# Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Adjusts recognition sensitivity using a custom threshold without re-scanning the source image. Requires an existing RecognitionResult object. ```csharp using Aspose.OMR.Api; using Aspose.OMR.Model; using System; using System.Diagnostics; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; string imagePath = @"C:\Scans\Sheet1.jpg"; string outputPath = @"C:\Results\"; int customThreshold = 40; OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded."); Console.WriteLine("Processing image: " + imagePath); // Initial recognition Stopwatch sw = Stopwatch.StartNew(); RecognitionResult result = templateProcessor.RecognizeImage(imagePath); sw.Stop(); Console.WriteLine("Recognition time: " + sw.Elapsed); // Export initial results string initialCsv = result.GetCsv(); File.WriteAllText(Path.Combine(outputPath, "Sheet1.csv"), initialCsv); Console.WriteLine("Initial result exported."); // Recalculate with different threshold (faster than re-recognition) sw.Restart(); templateProcessor.Recalculate(result, customThreshold); sw.Stop(); Console.WriteLine("Recalculation time: " + sw.Elapsed); // Export recalculated results string recalculatedCsv = result.GetCsv(); File.WriteAllText(Path.Combine(outputPath, "Sheet1_Recalculated.csv"), recalculatedCsv); Console.WriteLine("Recalculated result exported."); ``` -------------------------------- ### WPF Correction Control Integration Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Integrates a WPF control for manual OMR correction. Load a template, display an image, perform recognition, and export results. ```csharp using Aspose.OMR.Api; using Aspose.OMR.CorrectionUI; using System; using System.IO; using System.Windows; // In a WPF application (MainWindow.xaml.cs) public partial class MainWindow : Window { private CorrectionControl control; private string dataFolderPath; private string userImagePath; private void LoadTemplate_Click(object sender, RoutedEventArgs e) { dataFolderPath = @"C:\OMRData\"; string templatePath = Path.Combine(dataFolderPath, "Sheet.omr"); OmrEngine engine = new OmrEngine(); TemplateProcessor processor = engine.GetTemplateProcessor(templatePath); // Get the correction control for GUI display control = engine.GetCorrectionControl(processor); // Add to your WPF container (e.g., ContentControl) ContentHost.Content = control; control.Initialize(); } private void LoadImage_Click(object sender, RoutedEventArgs e) { if (control == null) return; userImagePath = @"C:\Scans\Sheet1.jpg"; control.LoadAndDisplayImage(userImagePath); } private void Recognize_Click(object sender, RoutedEventArgs e) { if (control == null) return; // Perform recognition - results are displayed in the control control.RecognizeImage(); } private void Export_Click(object sender, RoutedEventArgs e) { if (control == null) return; string outputPath = @"C:\Results\Sheet1.csv"; control.ExportResults(outputPath); MessageBox.Show("Results exported to: " + outputPath); } } ``` -------------------------------- ### RecognizeImage - Basic Recognition Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Processes a scanned image against a loaded template and returns recognition results in CSV format. ```APIDOC ## RecognizeImage - Perform Basic OMR Recognition ### Description Processes a scanned or photographed image against a loaded template and returns recognition results. Results can be exported to CSV, JSON, or XML formats. ### Method N/A (Method of TemplateProcessor) ### Endpoint N/A ### Parameters #### Path Parameters - **imagePath** (string) - Required - The path to the image file to be recognized. ### Request Example ```csharp using Aspose.OMR.Api; using System; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; string[] userImages = new string[] { "Sheet1.jpg", "Sheet2.jpg" }; string imageFolderPath = @"C:\Scans\"; string outputPath = @"C:\Results\"; // Initialize engine and load template OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded."); // Process each scanned image for (int i = 0; i < userImages.Length; i++) { string imagePath = Path.Combine(imageFolderPath, userImages[i]); // Recognize the image and export to CSV string csvResult = templateProcessor.RecognizeImage(imagePath).GetCsv(); // Save result to file string outputFile = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(userImages[i]) + ".csv"); File.WriteAllText(outputFile, csvResult); Console.WriteLine("Result exported: " + outputFile); } // Expected CSV output format: // Element Name,Value // "MainQuestions1","A" // "MainQuestions2","C" // "MainQuestions3","B" ``` ### Response #### Success Response (string) - **csvResult** (string) - The recognition results in CSV format. ``` -------------------------------- ### RecognizeImage with Threshold - Custom Recognition Sensitivity Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Recognizes an image with a custom threshold to control sensitivity for detecting filled bubbles. ```APIDOC ## RecognizeImage with Threshold - Custom Recognition Sensitivity ### Description The `RecognizeImage` method accepts an optional threshold parameter (0-100) that controls the sensitivity for detecting filled bubbles. Lower values are more sensitive to lightly marked answers, while higher values require more strongly filled bubbles. ### Method N/A (Method of TemplateProcessor) ### Endpoint N/A ### Parameters #### Path Parameters - **imagePath** (string) - Required - The path to the image file to be recognized. - **threshold** (int) - Optional - A value between 0 and 100 controlling recognition sensitivity. Lower values are more sensitive. ### Request Example ```csharp using Aspose.OMR.Api; using System; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; string[] userImages = new string[] { "Sheet1.jpg", "Sheet2.jpg" }; string imageFolderPath = @"C:\Scans\"; string outputPath = @"C:\Results\"; // Custom threshold value (0-100) // Lower values = more sensitive (detects lighter marks) // Higher values = less sensitive (requires stronger marks) int customThreshold = 40; OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded."); for (int i = 0; i < userImages.Length; i++) { string imagePath = Path.Combine(imageFolderPath, userImages[i]); // Recognize with custom threshold string csvResult = templateProcessor.RecognizeImage(imagePath, customThreshold).GetCsv(); string outputFile = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(userImages[i]) + "_Threshold.csv"); File.WriteAllText(outputFile, csvResult); Console.WriteLine("Result exported: " + outputFile); } ``` ### Response #### Success Response (string) - **csvResult** (string) - The recognition results in CSV format. ``` -------------------------------- ### Perform OMR Recognition with Custom Threshold Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Adjust recognition sensitivity using a threshold value between 0 and 100. Lower values detect lighter marks, while higher values require stronger marks. ```csharp using Aspose.OMR.Api; using System; using System.IO; string templatePath = @"C:\Templates\Sheet.omr"; string[] userImages = new string[] { "Sheet1.jpg", "Sheet2.jpg" }; string imageFolderPath = @"C:\Scans\"; string outputPath = @"C:\Results\"; // Custom threshold value (0-100) // Lower values = more sensitive (detects lighter marks) // Higher values = less sensitive (requires stronger marks) int customThreshold = 40; OmrEngine engine = new OmrEngine(); TemplateProcessor templateProcessor = engine.GetTemplateProcessor(templatePath); Console.WriteLine("Template loaded."); for (int i = 0; i < userImages.Length; i++) { string imagePath = Path.Combine(imageFolderPath, userImages[i]); // Recognize with custom threshold string csvResult = templateProcessor.RecognizeImage(imagePath, customThreshold).GetCsv(); string outputFile = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(userImages[i]) + "_Threshold.csv"); File.WriteAllText(outputFile, csvResult); Console.WriteLine("Result exported: " + outputFile); } ``` -------------------------------- ### Generate OMR Template with Custom Images Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Embeds external images like logos into OMR templates by passing an array of file paths to the GenerateTemplate method. ```csharp using Aspose.OMR.Api; using Aspose.OMR.Generation; using System; using System.IO; string markupPath = @"C:\Markup\FormWithLogo.txt"; string outputPath = @"C:\Templates\"; // Array of images referenced in the markup string[] images = new string[] { @"C:\Images\company_logo.png", @"C:\Images\header_image.jpg" }; OmrEngine engine = new OmrEngine(); // Generate template with embedded images GenerationResult result = engine.GenerateTemplate(markupPath, images); if (result.ErrorCode != 0) { Console.WriteLine("ERROR: " + result.ErrorCode + ": " + result.ErrorMessage); return; } result.Save(outputPath, "FormWithLogo"); Console.WriteLine("Template with images generated successfully."); ``` -------------------------------- ### Export OMR Templates as PDF Source: https://context7.com/aspose-omr/aspose.omr-for-.net/llms.txt Uses the SaveAsPdf method to convert generated OMR templates into PDF files for printing or distribution. ```csharp using Aspose.OMR.Api; using Aspose.OMR.Generation; using System; using System.IO; string[] markupFiles = new string[] { "Sheet.txt", "Survey.txt", "Test.txt" }; string markupPath = @"C:\Markup\"; string outputPath = @"C:\Templates\"; OmrEngine engine = new OmrEngine(); foreach (string markupFile in markupFiles) { string fullPath = Path.Combine(markupPath, markupFile); // Generate template GenerationResult result = engine.GenerateTemplate(fullPath); if (result.ErrorCode != 0) { Console.WriteLine("ERROR: " + result.ErrorCode + ": " + result.ErrorMessage); continue; } // Save as PDF instead of PNG string outputName = Path.GetFileNameWithoutExtension(markupFile); result.SaveAsPdf(outputPath, outputName); Console.WriteLine("PDF template created: " + outputName + ".pdf"); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.