Class DocIORenderer
Inheritance
System.Object
DocIORenderer
Implements
System.IDisposable
Namespace: Syncfusion.DocIORenderer
Assembly: Syncfusion.DocIORenderer.NET.dll
Syntax
public class DocIORenderer : Object, IDisposable
Constructors
DocIORenderer()
Initializes a new instance of the
Declaration
public DocIORenderer()
Remarks
This constructor is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
Examples
This example converts the specified Word Document in to PDF Document.
//Loads an existing Word document
WordDocument wordDocument = new WordDocument("Template.docx", FormatType.Docx);
//Instantiation of DocToPDFConverter for Word to PDF conversion
DocToPDFConverter converter = new DocToPDFConverter();
//Converts Word document into PDF document
PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
//Saves the PDF file
pdfDocument.Save("WordtoPDF.pdf");
//Releases all resources used by the object.
converter.Dispose();
//Closes the instance of document objects
pdfDocument.Close(true);
wordDocument.Close();
'Loads an existing Word document
Dim wordDocument As New WordDocument("Template.docx", FormatType.Docx)
'Instantiation of DocToPDFConverter for Word to PDF conversion
Dim converter As New DocToPDFConverter()
'Converts Word document into PDF document
Dim pdfDocument As PdfDocument = converter.ConvertToPDF(wordDocument)
'Saves the PDF file
pdfDocument.Save("WordtoPDF.pdf");
'Releases all resources used by the object.
converter.Dispose();
'Closes the instance of document objects
pdfDocument.Close(true);
wordDocument.Close();
Properties
IsCanceled
Gets a value indicating whether this conversion has been canceled.
Declaration
public bool IsCanceled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Settings
Gets or sets
Declaration
public DocIORendererSettings Settings { get; set; }
Property Value
Type |
---|
DocIORendererSettings |
Examples
This example converts the specified Word Document in to PDF Document with converter settings.
//Creates a new Word document
WordDocument wordDocument = new WordDocument();
//Add a section into the word document
IWSection section = wordDocument.AddSection();
//Add a paragraph into the section
IWParagraph paragraph = section.AddParagraph();
//Add a text into the paragraph
paragraph.AppendText("First Chapter1");
//Apply style for the text
paragraph.ApplyStyle(BuiltinStyle.Heading1);
paragraph.AppendText("First Chapter2");
paragraph.ApplyStyle(BuiltinStyle.Heading2);
paragraph.AppendText("First Chapter3");
paragraph.ApplyStyle(BuiltinStyle.Heading3);
//Instantiation of DocIORenderer for Word to PDF conversion
DocIORenderer render = new DocIORenderer();
//Sets ExportBookmarks for preserving Word document headings as PDF bookmarks
render.Settings.ExportBookmarks = Syncfusion.DocIO.ExportBookmarkType.Headings;
//Converts Word document into PDF document
PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
//Saves the PDF file
MemoryStream outputStream = new MemoryStream();
pdfDocument.Save(outputStream);
//Releases all resources used by the object.
render.Dispose();
//Closes the instance of document objects
pdfDocument.Close();
wordDocument.Close();
Methods
ConvertToPDF(WordDocument)
Declaration
public PdfDocument ConvertToPDF(WordDocument wordDocument)
Parameters
Type | Name | Description |
---|---|---|
WordDocument | wordDocument |
Returns
Type |
---|
PdfDocument |
ConvertToPDF(Stream)
Declaration
public PdfDocument ConvertToPDF(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream |
Returns
Type |
---|
PdfDocument |
Dispose()
Declaration
public void Dispose()
SaveChartAsImage(IOfficeChart, Stream)
Declaration
public void SaveChartAsImage(IOfficeChart officeChart, Stream outputImageStream)
Parameters
Type | Name | Description |
---|---|---|
IOfficeChart | officeChart | |
System.IO.Stream | outputImageStream |
Implements
System.IDisposable