Method ConvertToFile
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
inputPathstringFile-system path to the source PDF.
outputPathstringDestination path for the converted document.
optionsPdfAConversionOptionsOptional conversion options; defaults are used when
null.cancellationTokenCancellationTokenCancellation 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
inputPathdoes 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
pdfDatabyte[]outputPathstringoptionsPdfAConversionOptionscancellationTokenCancellationToken
Returns
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
inputStreamStreamoutputPathstringoptionsPdfAConversionOptionscancellationTokenCancellationToken
Returns
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
attachmentAttachmentoutputPathstringoptionsPdfAConversionOptionscancellationTokenCancellationToken