PdfConverter PDF/A Compliance Guide
PdfConverter PDF/A Compliance Guide
This guide shows how to generate PDF/A-compliant output when converting Visio diagram files to PDF using PdfConverter in Aspose.Diagram for .NET. PDF/A is required for long-term archiving and regulatory compliance.
Prerequisites
- Aspose.Diagram for .NET (version 26.4.0 or later)
- Valid Aspose license applied before calling
Process()
Step 1: Configure PDF/A Compliance
Use LowCodePdfSaveOptions with PdfOptions (type PdfSaveOptions) to set the compliance level:
using Aspose.Diagram.LowCode;
using Aspose.Diagram.Saving;
var loadOptions = new LowCodeLoadOptions();
loadOptions.InputFile = "source.vsdx";
var saveOptions = new LowCodePdfSaveOptions();
saveOptions.OutputFile = "output-pdfa.pdf";
var pdfOptions = new PdfSaveOptions();
pdfOptions.Compliance = PdfCompliance.PdfA1b;
saveOptions.PdfOptions = pdfOptions;
PdfConverter.Process(loadOptions, saveOptions);Step 2: Supported Compliance Levels
The PdfCompliance enum in Aspose.Diagram.Saving provides the following levels:
| Value | Description |
|---|---|
PdfCompliance.None | Standard PDF (default) |
PdfCompliance.PdfA1b | PDF/A-1b — basic conformance for long-term archiving |
Use PdfCompliance.PdfA1b for archival or regulatory requirements.
Step 3: Batch PDF/A Export
Convert multiple Visio files to PDF/A in a loop:
using System.IO;
using Aspose.Diagram.LowCode;
using Aspose.Diagram.Saving;
string inputDir = "diagrams/input";
string outputDir = "diagrams/pdfa-output";
Directory.CreateDirectory(outputDir);
var pdfOptions = new PdfSaveOptions();
pdfOptions.Compliance = PdfCompliance.PdfA1b;
foreach (string file in Directory.GetFiles(inputDir, "*.vsdx"))
{
string output = Path.Combine(outputDir, Path.GetFileNameWithoutExtension(file) + ".pdf");
var loadOptions = new LowCodeLoadOptions();
loadOptions.InputFile = file;
var saveOptions = new LowCodePdfSaveOptions();
saveOptions.OutputFile = output;
saveOptions.PdfOptions = pdfOptions;
PdfConverter.Process(loadOptions, saveOptions);
Console.WriteLine($"Exported PDF/A: {Path.GetFileName(output)}");
}Troubleshooting
| Problem | Likely Cause | Fix |
|---|---|---|
| Output is not PDF/A-compliant | PdfOptions not set before calling Process() | Assign saveOptions.PdfOptions before the Process() call |
NullReferenceException on Compliance | Accessing unassigned PdfOptions | Assign saveOptions.PdfOptions = new PdfSaveOptions() before setting Compliance |
| Evaluation watermark in output | License not applied | Apply metered licensing via metered.SetMeteredKey() before any Process() call |