Click or drag to resize

PdfSaveOptionsCompliance Property

Specifies the PDF standards compliance level for output documents. Default is PDF_15.

Namespace: SautinSoft.Document
Assembly: SautinSoft.Document (in SautinSoft.Document.dll) Version: 2024.3.11
Syntax
public PdfCompliance Compliance { get; set; }

Property Value

PdfCompliance
Example

See Developer Guide: Load an existing document and save it as a PDF/A compliant version

Load an existing document (*.docx, *.rtf, *.pdf, *.html, *.txt, *.pdf) and save it as a PDF/A compliant version using C#
using System.IO;
using SautinSoft.Document;

namespace Sample
{
    class Sample
    {

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

            LoadAndSaveAsPDFA();
        }

        /// <summary>
        /// Load an existing document (*.docx, *.rtf, *.pdf, *.html, *.txt, *.pdf) and save it as a PDF/A compliant version. 
        /// </summary>
        /// <remarks>
        /// Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/create-and-save-document-in-pdf-a-format-net-csharp-vb.php
        /// </remarks>
        public static void LoadAndSaveAsPDFA()
        {
            // Path to a loadable document.
            string loadPath = @"..\..\..\example.docx";

            DocumentCore dc = DocumentCore.Load(loadPath);

            PdfSaveOptions options = new PdfSaveOptions()
            {
                // PdfComliance supports: PDF/A, PDF/1.5, etc.
                Compliance = PdfCompliance.PDF_A1a
            };

            string savePath = Path.ChangeExtension(loadPath, ".pdf");
            dc.Save(savePath, options);

            // Open the result for demonstration purposes.
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(savePath) { UseShellExecute = true });
        }
    }
}
Load an existing document (*.docx, *.rtf, *.pdf, *.html, *.txt, *.pdf) and save it as a PDF/A compliant version using VB.Net
Imports System
Imports System.IO
Imports SautinSoft.Document

Module Sample
    Sub Main()
        LoadAndSaveAsPDFA()
    End Sub
    ''' Get your free 30-day key here:   
    ''' https://sautinsoft.com/start-for-free/
    ''' <summary>
    ''' Load an existing document (*.docx, *.rtf, *.pdf, *.html, *.txt, *.pdf) and save it as a PDF/A compliant version. 
    ''' </summary>
    ''' <remarks>
    ''' Details: https://www.sautinsoft.com/products/document/help/net/developer-guide/create-and-save-document-in-pdf-a-format-net-csharp-vb.php
    ''' </remarks>
    Sub LoadAndSaveAsPDFA()
        ' Path to a loadable document.
        Dim loadPath As String = "..\..\..\example.docx"

        Dim dc As DocumentCore = DocumentCore.Load(loadPath)

        Dim options As New PdfSaveOptions() With {.Compliance = PdfCompliance.PDF_A1a}

        Dim savePath As String = Path.ChangeExtension(loadPath, ".pdf")
        dc.Save(savePath, options)

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