Convert

DocxToPdfConverter.Convert method (1 of 2)

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

public void Convert(Stream outputStream, Action<PdfConvertOptions> convertOptionsAction = null)
parameterdescription
outputStreamThe stream where the converted PDF will be written.
convertOptionsActionOptional delegate to configure PDF-specific conversion options. Use PdfConvertOptions to set options such as output DPI or PDF 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 DocxToPdfConverter(“sample.docx”)) using (var outputStream = new FileStream(“converted.pdf”, FileMode.Create)) { converter.Convert(outputStream, options => { options.Dpi = 300; options.Password = “pdf-password”; }); }

See Also


DocxToPdfConverter.Convert method (2 of 2)

Converts the loaded DOCX document to PDF 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 will be saved.
convertOptionsActionOptional delegate to configure PDF-specific conversion options. Use PdfConvertOptions to set options such as output DPI or PDF 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 DocxToPdfConverter(“sample.docx”)) { converter.Convert(“converted.pdf”); } // With convert options using (var converter = new DocxToPdfConverter(“sample.docx”)) { converter.Convert(“converted.pdf”, options => { options.Dpi = 300; options.Password = “pdf-password”; }); }

See Also