Table of Contents

Method ConvertToFile

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

ConvertToFile(string, string, PdfAConversionOptions, CancellationToken)

Converts the PDF at inputPath to PDF/A and writes the result to outputPath.

public static PdfAConversionReport ConvertToFile(string inputPath, string outputPath, PdfAConversionOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputPath string

File-system path to the source PDF.

outputPath string

Destination path for the converted document.

options PdfAConversionOptions

Optional conversion options; defaults are used when null.

cancellationToken CancellationToken

Cancellation token.

Returns

PdfAConversionReport

A report describing detected features, applied fixes, and the outcome.

Exceptions

ArgumentException

Thrown when a path is null or whitespace.

FileNotFoundException

Thrown when inputPath does not exist.

PdfDocumentException

Thrown when the source cannot be parsed, when the password is wrong, or when conversion is impossible under Fail.

ConvertToFile(byte[], string, PdfAConversionOptions, CancellationToken)

Converts in-memory PDF bytes to PDF/A and writes the result to outputPath.

public static PdfAConversionReport ConvertToFile(byte[] pdfData, string outputPath, PdfAConversionOptions options = null, CancellationToken cancellationToken = default)

Parameters

pdfData byte[]
outputPath string
options PdfAConversionOptions
cancellationToken CancellationToken

Returns

PdfAConversionReport

ConvertToFile(Stream, string, PdfAConversionOptions, CancellationToken)

Converts the PDF read from inputStream to PDF/A and writes the result to outputPath.

public static PdfAConversionReport ConvertToFile(Stream inputStream, string outputPath, PdfAConversionOptions options = null, CancellationToken cancellationToken = default)

Parameters

inputStream Stream
outputPath string
options PdfAConversionOptions
cancellationToken CancellationToken

Returns

PdfAConversionReport

ConvertToFile(Attachment, string, PdfAConversionOptions, CancellationToken)

Converts the PDF carried by attachment to PDF/A and writes the result to outputPath.

public static PdfAConversionReport ConvertToFile(Attachment attachment, string outputPath, PdfAConversionOptions options = null, CancellationToken cancellationToken = default)

Parameters

attachment Attachment
outputPath string
options PdfAConversionOptions
cancellationToken CancellationToken

Returns

PdfAConversionReport
Share