Convert

PdfToPdfAConverter.Convert method (1 of 2)

Converts the loaded PDF document to PDF/A and writes the result to the specified stream.

public void Convert(Stream outputStream, Action<PdfConvertOptions> convertOptionsAction = null)
parameterdescription
outputStreamThe stream where the converted PDF/A will be written.
convertOptionsActionOptional delegate to configure PDF/A-specific conversion options. Use PdfConvertOptions to set options such as PDF/A conformance level or password protection.

Remarks

For more details and examples, see the LowCode developer guide: https://docs.groupdocs.net/conversion/developer-guide/

Examples

// Stream-based conversion with convert options using (var converter = new PdfToPdfAConverter(“sample.pdf”)) using (var outputStream = new FileStream(“converted.pdf”, FileMode.Create)) { converter.Convert(outputStream, options => { options.PdfOptions.PdfFormat = PdfFormats.PdfA_1A; }); }

See Also


PdfToPdfAConverter.Convert method (2 of 2)

Converts the loaded PDF document to PDF/A and saves it to the specified file path.

public void Convert(string filePath, Action<PdfConvertOptions> convertOptionsAction = null)
parameterdescription
filePathThe output file path where the converted PDF/A will be saved.
convertOptionsActionOptional delegate to configure PDF/A-specific conversion options. Use PdfConvertOptions to set options such as PDF/A conformance level or password protection.

Remarks

For more details and examples, see the LowCode developer guide: https://docs.groupdocs.net/conversion/developer-guide/

Examples

// Basic conversion using (var converter = new PdfToPdfAConverter(“sample.pdf”)) { converter.Convert(“converted.pdf”); } // With convert options using (var converter = new PdfToPdfAConverter(“sample.pdf”)) { converter.Convert(“converted.pdf”, options => { options.PdfOptions.PdfFormat = PdfFormats.PdfA_1A; }); }

See Also