Click or drag to resize

PdfCompliance Enumeration

Specifies the PDF standards compliance level.

Namespace: SautinSoft.Document
Assembly: SautinSoft.Document (in SautinSoft.Document.dll) Version: 2025.2.13
Syntax
public enum PdfCompliance
Members
Member nameValueDescription
PDF_100 The output file will comply with the PDF 1.0 standard.
PDF_111 The output file will comply with the PDF 1.1 standard.
PDF_122 The output file will comply with the PDF 1.2 standard.
PDF_133 The output file will comply with the PDF 1.3 standard.
PDF_144 The output file will comply with the PDF 1.4 standard.
PDF_155 The output file will comply with the PDF 1.5 standard.
PDF_166 The output file will comply with the PDF 1.6 standard.
PDF_177 The output file will comply with the PDF 1.7 standard.
PDF_208 The output file will comply with the ISO 32000-2:2017 specification released in 2017.
PDF_A1a9 The output file will comply with the PDF/A-1a (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A1b10 The output file will comply with the PDF/A-1b (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A2a11 The output file will comply with the PDF/A-2a (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A2b12 The output file will comply with the PDF/A-2b (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A2u13 The output file will comply with the PDF/A-2u (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A3a14 The output file will comply with the PDF/A-3a (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A3b15 The output file will comply with the PDF/A-3b (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A3u16 The output file will comply with the PDF/A-3u (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A4e17 The output file will comply with the PDF/A-4e (see http://en.wikipedia.org/wiki/PDF/A) standard.
PDF_A4f18 The output file will comply with the PDF/A-4f (see http://en.wikipedia.org/wiki/PDF/A) standard.
Example

See Developer Guide: Creates a new document and saves it as PDF file

Creates a new document and saves it as PDF file using C#
using System.IO;
using SautinSoft.Document;

namespace Example
{
    class Program
    {

        static void Main(string[] args)
        {
            // Get your free trial key here:   
            // https://sautinsoft.com/start-for-free/

            SaveToPdfFile();
            SaveToPdfStream();
        }

        /// <summary>
        /// Creates a new document and saves it as PDF file.
        /// </summary>
        /// <remarks>
        /// Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/save-document-as-pdf-net-csharp-vb.php
        /// </remarks>
        static void SaveToPdfFile()
        {
            // Assume we already have a document 'dc'.
            DocumentCore dc = new DocumentCore();
            dc.Content.End.Insert("Hey Guys and Girls!\nFrom file.", new CharacterFormat() { FontColor = Color.Green, Size = 20});

            string filePath = @"Result-file.pdf";

            dc.Save(filePath, new PdfSaveOptions()
            {
                Compliance = PdfCompliance.PDF_A1a,
                PreserveFormFields = true
            });

            // Important for Linux: Install MS Fonts
            // sudo apt install ttf-mscorefonts-installer -y

            // Open the result for demonstration purposes.
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(filePath) { UseShellExecute = true });
        }

        /// <summary>
        /// Creates a new document and saves it as PDF/A using MemoryStream.
        /// </summary>
        /// <remarks>
        /// Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/save-document-as-pdf-net-csharp-vb.php
        /// </remarks>
        static void SaveToPdfStream()
        {
            // There variables are necessary only for demonstration purposes.
            byte[] fileData = null;
            string filePath = @"Result-stream.pdf";

            // Assume we already have a document 'dc'.
            DocumentCore dc = new DocumentCore();
            dc.Content.End.Insert("Hey Guys and Girls!\nFrom MemoryStream.", new CharacterFormat() { FontColor = Color.Orange, Size = 20 });

            // Let's save our document to a MemoryStream.
            using (MemoryStream ms = new MemoryStream())
            {
                dc.Save(ms, new PdfSaveOptions()
                {
                    PageIndex = 0,
                    PageCount = 1,
                    Compliance = PdfCompliance.PDF_A1a
                });
                fileData = ms.ToArray();
            }
            File.WriteAllBytes(filePath, fileData);

            // Open the result for demonstration purposes.
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(filePath) { UseShellExecute = true });

        }
    }
}
Creates a new document and saves it as PDF file using VB.Net
Imports System
Imports System.IO
Imports SautinSoft.Document

Module Sample
    Sub Main()
        SaveToPdfFile()
        SaveToPdfStream()
    End Sub
    ''' Get your free trial key here:   
    ''' https://sautinsoft.com/start-for-free/
    ''' <summary>
    ''' Creates a new document and saves it as PDF file.
    ''' </summary>
    ''' <remarks>
    ''' Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/save-document-as-pdf-net-csharp-vb.php
    ''' </remarks>
    Sub SaveToPdfFile()
        ' Assume we already have a document 'dc'.
        Dim dc As New DocumentCore()
        dc.Content.End.Insert("Hey Guys and Girls!" & vbLf & "From file.", New CharacterFormat() With {
            .FontColor = Color.Green,
            .Size = 20
        })

        Dim filePath As String = "Result-file.pdf"

        dc.Save(filePath, New PdfSaveOptions() With {
                .Compliance = PdfCompliance.PDF_A1a,
                .PreserveFormFields = True
            })

        ' Open the result for demonstration purposes.
        System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(filePath) With {.UseShellExecute = True})
    End Sub

    ''' <summary>
    ''' Creates a new document and saves it as PDF/A using MemoryStream.
    ''' </summary>
    ''' <remarks>
    ''' Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/save-document-as-pdf-net-csharp-vb.php
    ''' </remarks>
    Sub SaveToPdfStream()
        ' There variables are necessary only for demonstration purposes.
        Dim fileData() As Byte = Nothing
        Dim filePath As String = "Result-stream.pdf"

        ' Assume we already have a document 'dc'.
        Dim dc As New DocumentCore()
        dc.Content.End.Insert("Hey Guys and Girls!" & vbLf & "From MemoryStream.", New CharacterFormat() With {
            .FontColor = Color.Orange,
            .Size = 20
        })

        ' Let's save our document to a MemoryStream.
        Using ms As New MemoryStream()
            dc.Save(ms, New PdfSaveOptions() With {
                .PageIndex = 0,
                .PageCount = 1,
                .Compliance = PdfCompliance.PDF_A1a
            })
            fileData = ms.ToArray()
        End Using
        File.WriteAllBytes(filePath, fileData)

        ' Open the result for demonstration purposes.
        System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(filePath) With {.UseShellExecute = True})

    End Sub
End Module
See Also