| ConverterConvert Method |
Convert a document to PDF/A.
Note that it is highly recommended to use
ConversionEvent to detect critical conversion events.
Namespace: PdfTools.PdfA.ConversionAssembly: PdfTools (in PdfTools.dll) Version: 1.7.0+cfcc11b476b3e1eb4320f0f37269191f64e36bd8
Syntax public Document Convert(
AnalysisResult analysis,
Document document,
Stream outStream,
ConversionOptions options = null,
OutputOptions outOptions = null
)
Parameters
- analysis AnalysisResult
-
The result of the document's analysis using Analyze(Document, AnalysisOptions).
- document Document
-
The document to convert
- outStream Stream
-
The stream where the converted document is written
- options ConversionOptions (Optional)
-
The conversion options
- outOptions OutputOptions (Optional)
-
The output options object
Return Value
Document
The result of the conversion
Exceptions Exception | Condition |
---|
LicenseException | The license check has failed. |
ArgumentException | The outOptions argument is invalid. |
ArgumentException | The output stream could not be opened for writing. |
InvalidOperationException | The document has already been closed. |
ArgumentException | The analysis has already been closed, e.g. due to a previous conversion. |
ArgumentException | The PDF/A version of the analysis and the conversion options do not match. |
ArgumentException | The analysis is not the analysis result of document. |
IOException | Error reading from or writing to the outStream. |
ConformanceException | The conformance required by options cannot be achieved.
-
PDF/A level U: All text of the input document must be extractable.
-
PDF/A level A: In addition to the requirements of level U, the input document must be tagged.
|
ConformanceException | The PDF/A version of the conformances of analysis and options differ.
The same PDF/A version must be used for the analysis and conversion. |
ArgumentException | The outOptions specifies document encryption, which is not allowed in PDF/A documents. |
GenericException | The document cannot be converted to PDF/A. |
CorruptException | The analysis has been stopped. |
ProcessingException | Failed to add the invoice file.
Possible reasons include an invalid XML format, or that the invoice type conflicts with the content of the XML file. |
UnsupportedFeatureException | The document is not a PDF, but an XFA document.
See Xfa for more information on how to detect and handle XFA documents. |
NotFoundException | A required font is missing from the installed font directories. |
ArgumentNullException | if analysis is . |
ArgumentNullException | if document is . |
ArgumentNullException | if outStream is . |
See Also