In This Topic
Programming / Document Conversion / Converting an existing PDF document to a new PDF/A document

Converting an existing PDF document to a new PDF/A document

In This Topic

To archive your electronic documents with long-term preservation you will need to convert your source PDF document to a PDF/A document intended for archiving.

Our native PDF to PDF/A converter parses the source document and compares the document structure to the expected conformance level. The document can be modified to conform to the specification by adding, editing, or removing required document structure elements, embedding fonts if possible and using other techniques. If such a conversion by direct modification is not possible, the PDF to PDF/A conversion engine falls back to secondary conversion options, which are Vectorization and Rasterization. Both these options perform rendering of the document content into a completely new document. Vectorization produces vector based graphic elements where applicable, for example, fonts and paths, and combines them with image resources while Rasterization renders the document content using the raster (pixel-based) approach.
The important note here is that both Vectorization and Rasterization approaches result in loss of fonts and text information because the text converts into shapes and raster images. Text information can be later recovered using OCR features.

Here is the basic workflow you need to follow. You can choose the PDF conformance level you require and the approach you favor.

Copy Code
'We assume that GdPicture has been correctly installed and unlocked.
Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    'Loading a PDF document to convert.
    Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
    If status = GdPictureStatus.OK Then
        'Providing the conversion to PDF/A-1b conformed document.
        status = gdpicturePDF.ConvertToPDFA("converted.pdf", PdfConversionConformance.PDF_A_1b, True, True)
        If status = GdPictureStatus.OK Then
            MessageBox.Show("The PDF file has been converted successfully.", "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Information)
            'Checking the conformance of the converted document.
            Using convertedPDF As GdPicturePDF = New GdPicturePDF()
                status = convertedPDF.LoadFromFile("converted.pdf", False)
                If status = GdPictureStatus.OK Then
                    Dim conf As PdfConformance = convertedPDF.GetPDFAConformance()
                    MessageBox.Show("The conformance of newly created PDF is: " + conf.ToString(), "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Information)
                End If
                convertedPDF.CloseDocument()
                'You can validate the resulting document using available PDF/A validators.
            End Using
        Else
            MessageBox.Show("The file can't be converted. Status: " + status.ToString(), "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End If
        gdpicturePDF.CloseDocument()
    Else
        MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End If
End Using
Copy Code
//We assume that GdPicture has been correctly installed and unlocked.
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
    //Loading a PDF document to convert.
    GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
    if (status == GdPictureStatus.OK)
    {
        //Providing the conversion to PDF/A-1b conformed document.
        status = gdpicturePDF.ConvertToPDFA("converted.pdf", PdfConversionConformance.PDF_A_1b, true, true);
        if (status == GdPictureStatus.OK)
        {
            MessageBox.Show("The PDF file has been converted successfully.", "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //Checking the conformance of the converted document.
            using (GdPicturePDF convertedPDF = new GdPicturePDF())
            {
                status = convertedPDF.LoadFromFile("converted.pdf", false);
                if (status == GdPictureStatus.OK)
                {
                    PdfConformance conf = convertedPDF.GetPDFAConformance();
                    MessageBox.Show("The conformance of newly created PDF is: " + conf.ToString(), "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                convertedPDF.CloseDocument();
                //You can validate the resulting document using available PDF/A validators.
            }
        }
        else
            MessageBox.Show("The file can't be converted. Status: " + status.ToString(), "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Error);
        gdpicturePDF.CloseDocument();
    }
    else
        MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), "Conversion to PDF/A Example", MessageBoxButtons.OK, MessageBoxIcon.Error);
}