PDF .NET Library Documentation - PDF Technologies, Inc.
This function converts a PDF document to PDF/A.

Namespace:  PDFTech
Assembly:  PDFTechLib (in PDFTechLib.dll) Version: 1.0.0.0 (1.7.9.0)

Syntax

C#
public bool ConvertPDFA(
	string outputFile
)
Visual Basic (Declaration)
Public Function ConvertPDFA ( _
	outputFile As String _
) As Boolean
Visual C++
public:
bool ConvertPDFA(
	String^ outputFile
)

Parameters

outputFile
Type: System..::.String

Return Value

Returns TRUE if the created document is PDF/A compliant returns FALSE otherwise.

Examples

The example below shows how a PDF document is converted to a PDF/A document.
CopyC#
PDFAConverter converter = new PDFAConverter("sample.pdf");
bool success = converter.ConvertPDFA("sample-A.pdf");
if (converter.Error == "")
{
    if (success)
    {
        foreach (PDFAError error in converter.PDFAErrorList)
        {
            Console.WriteLine(error.Code + "\t" + error.Error + "\t" + error.Count.ToString() + " matches");
        }
        Console.WriteLine();
        Console.WriteLine("sample.pdf successfully converted to PDF/A.");
    }
    else
    {
        foreach (PDFAError error in converter.PDFAErrorList)
        {
            if (error.IsConvertable == false)
                Console.WriteLine(error.Code + "\t" + error.Error + "\t" + error.Count.ToString() + " matches");
        }
        Console.WriteLine();
        Console.WriteLine("sample.pdf can not convertable to PDF/A. Created a non-compliant file.");
    }
}
else
{
    Console.WriteLine(converter.Error);
    return;
}

See Also