Word to PDF conversion in Xamarin and .NET Core | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (164).NET Core  (29).NET MAUI  (95)Angular  (87)ASP.NET  (50)ASP.NET Core  (80)ASP.NET MVC  (89)Azure  (38)Blazor  (167)DocIO  (23)Essential JS 2  (91)Essential Studio  (181)File Formats  (33)Flutter  (124)JavaScript  (200)Microsoft  (114)PDF  (68)React  (79)Succinctly series  (130)Syncfusion  (657)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (42)Webinar  (38)Windows Forms  (59)WinUI  (58)WPF  (141)Xamarin  (158)XlsIO  (26)Other CategoriesBarcode  (5)BI  (29)Bold BI  (5)Build conference  (6)Business intelligence  (54)Button  (4)C#  (121)Chart  (63)Cloud  (13)Company  (445)Dashboard  (8)Data Science  (3)Data Validation  (7)DataGrid  (58)Development  (456)Doc  (7)DockingManager  (1)eBook  (98)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (24)Extensions  (21)File Manager  (4)Gantt  (16)Gauge  (11)Git  (4)Grid  (28)HTML  (12)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (350)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (33)Performance  (11)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (10)Road Map  (11)Scheduler  (42)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (25)Solution Services  (3)Spreadsheet  (11)SQL  (9)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (104)UI  (254)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (23)Visual Studio Code  (17)Web  (431)What's new  (234)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

Word to PDF conversion in Xamarin and .NET Core

Syncfusion is excited to share that Word-to-PDF conversion is now available in Xamarin and .NET Core platforms.


Cross-platform development is the future of mobile, desktop, and web application development. It provides benefits like quick deployment, lower costs, wider reach, and quick turnaround time. The adoption of cross-platform application development is increasing among enterprises and small businesses as well. The Xamarin and .NET Core platforms are being used by large numbers of developers to develop applications that target multiple platforms.


Syncfusion already provided the ability to convert Word documents to PDF in Windows Forms, WPF, ASP.NET, and ASP.NET MVC applications, but it was not extended to Xamarin and .NET Core due to the lack of a graphical API.


From the 2018 Volume 1 release (version onwards, Syncfusion has extended the support for converting Word documents to PDF in Xamarin and .NET Core with the help of the SkiaSharp graphics library. 

An illustration of the Word-to-PDF conversion process in .NET Core and Xamarin.

Currently, the following features are available in Word-to-PDF conversion:

  • Text with formatting.
  • Table.
  • Images (PNG, JPEG, BMP and GIF).
  • Headers and footers.
  • Hyperlinks.
  • Fields like page number, date time, IF, and more.
  • Form fields and content control.
  • Textbox and Shapes.
  • Text wrapping for floating images, textbox, and shapes.
  • Footnote and endnote.
  • Line numbering.
  • Bookmark navigation.

Converting Word to PDF in Xamarin

Let’s learn how to convert a Word document to PDF in the Xamarin platform.


For Windows

  • Windows 10 (recommended)
  • Visual Studio 2015 or Visual Studio 2017 (recommended)
  • Windows 10 SDK

For macOS

  • OS X El Capitan (10.11) or newer
  • Visual Studio for Mac
  •  iOS 10 SDK and Xcode 8


1.   Create a Cross-Platform App (Xamarin.Forms) and name it WordtoPDFdemo.

2.   Select the Blank App template and the .NET Standard option under Code Sharing Strategy.

3.   Right-click the .NET Standard project, select Properties, and set the Target framework of the application as .NET Standard 1.4 or higher.

4.   Add the Syncfusion.Xamarin.DocIORenderer NuGet package as a reference to the .NET Standard project in your Xamarin application.


Note: Syncfusion Xamarin components are available on nuget.org.

5.   Add the input Word document to the asset folder in the .NET Standard project. Right-click the Word document, select Properties, and set its build action as Embedded resource.

6.      Add a button in the MainPage.xaml file.

<!--?xml version="1.0" encoding="utf-8" ?-->
<contentpage x_class="WordToPDF.MainPage">
    <stacklayout padding="10">
        <label x_name="Content_heading" text="Word to PDF in XForms" fontsize="Large" fontattributes="Bold" horizontaloptions="Center" verticaloptions="Center"></label>
        <label x_name="Content_1" text="This sample demonstrates how to convert a Word Document to PDF using DocIORenderer." fontsize="Medium" verticaloptions="Center"></label>
        <button x_name="btnGenerate" clicked="OnButtonClicked" text="Convert to PDF" horizontaloptions="Center" verticaloptions="Center" tabindex="151"></button>

7.  Add the following code in the onButtonClicked method in the MainPage.xaml.cs file. Use the ConvertToPDF method of the DocIORenderer class to convert the WordDocument instance to a PdfDocument instance and save the PDF document to the device.

Assembly assembly = typeof(App).GetTypeInfo().Assembly;
// Retrieves the document stream from embedded Word document
Stream inputStream = assembly.GetManifestResourceStream("WordToPDF.Assets.GettingStarted.docx");
string fileName = "GettingStarted.pdf";
// Creates new instance of WordDocument
WordDocument wordDocument = new WordDocument(inputStream, Syncfusion.DocIO.FormatType.Automatic);
// Creates new instance of DocIORenderer for Word to PDF conversion
DocIORenderer render = new DocIORenderer();
// Converts Word document into PDF document
PdfDocument pdfDocument = render.ConvertToPDF(wordDocument);
// Releases all resources used by the DocIORenderer and WordDocument instance
// Saves the converted PDF file
MemoryStream outputStream = new MemoryStream();
// Releases all resources used by the PdfDocument instance

// Saves the PDF document to the device through the dependency service with the help of platform-specific file system API
if (Device.OS == TargetPlatform.WinPhone || Device.OS == TargetPlatform.Windows)
    DependencyService.Get<isavewindowsphone>().Save(fileName, "application/pdf", outputStream);
    DependencyService.Get<isave>().Save(fileName, "application/pdf", outputStream);