Convert
Leave feedback
On this page
Converts the loaded DOCX document to PDF and writes the result to the specified stream.
public void Convert(Stream outputStream, Action<PdfConvertOptions> convertOptionsAction = null)
parameter | description |
---|---|
outputStream | The stream where the converted PDF will be written. |
convertOptionsAction | Optional delegate to configure PDF-specific conversion options. Use PdfConvertOptions to set options such as output DPI or PDF password protection. |
For more details and examples, see the LowCode developer guide: https://docs.groupdocs.net/conversion/developer-guide/
// 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”; }); }
- namespace GroupDocs.Conversion.LowCode
Converts the loaded DOCX document to PDF and saves it to the specified file path.
public void Convert(string filePath, Action<PdfConvertOptions> convertOptionsAction = null)
parameter | description |
---|---|
filePath | The output file path where the converted PDF will be saved. |
convertOptionsAction | Optional delegate to configure PDF-specific conversion options. Use PdfConvertOptions to set options such as output DPI or PDF password protection. |
For more details and examples, see the LowCode developer guide: https://docs.groupdocs.net/conversion/developer-guide/
// 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”; }); }
- namespace GroupDocs.Conversion.LowCode
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.