Convert PDF to Word, RTF in C#, VB.Net and ASP.Net Core MVC

PDF Focus .Net

.Net assembly which gives API to convert PDF to All: DOCX, RTF, HTML, XML, Text, Excel, Images in .Net and C#.
PDF to Word, RTF scheme

PDF Focus .Net

Convert PDF to Word, RTF in C#, VB.Net and ASP.Net Core MVC
PDF to Word, RTF scheme

Introduction

With the help of "PDF Focus .Net", any .NET application can easily transform PDF documents to MS Word (RTF format). For example, to convert a PDF to Word in C# you will only need to add a reference to the .dll and type a few lines of code:

           SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();

            f.OpenPdf(@"d:\Charles Dickens.pdf");

            if (f.PageCount > 0)
            {
                f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf;
                f.ToWord(@"d:\Charles Dickens.rtf");
            }
          

The library recreates a Word document from a PDF like as if it was be typed by a human. It produces a completely editable Word document in RTF format that contains paragraphs, columns, tables, images, page breaks, and so forth.


Download

To see this functionality firsthand, download the freshest «PDF Focus .Net» with code examples, 69.3 Mb.

Limitations

PDF Focus .Net The limitations of the free version are: The trial notice "Created by unlicensed version of PDF Focus .Net" and the random addition of the word "TRIAL".


Some examples to convert PDF to Word in C# and VB.Net

Want to adjust a result of PDF to RTF conversion? See our tips ...

1. Convert PDF file to Word file in C#:

           SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
            f.OpenPdf(@"d:\History.pdf");

            if (f.PageCount > 0)
            {
                f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf;
                int result = f.ToWord(@"d:\History.rtf");

                //Open Word document
                if (result==0)
                {
                    System.Diagnostics.Process.Start(@"d:\History.rtf");
                }
            }
      

2. Convert PDF to RTF in memory using C#:

           byte[] pdf = File.ReadAllBytes(@"c:\Book.pdf");

            SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
            f.OpenPdf(pdf);

            if (f.PageCount > 0)
            {
                f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf;
                byte [] word = f.ToWord();
                //now the variable 'word' contains RTF document
            }

      

3. Convert 2nd-3rd pages of PDF document Word in VB.Net:

        Dim f As New SautinSoft.PdfFocus()
        f.OpenPdf("http://somesite.com/forprint.pdf")

        If f.PageCount > 2 Then
            f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf
            'Convert only pages 2 - 3 to Word
            Dim result As Integer = f.ToWord("f:\foredit.rtf", 2, 3)

            'Show Word document
            If result = 0 Then
                System.Diagnostics.Process.Start("f:\foredit.rtf")
            End If
        End If

      

4. Export PDF to Word in ASP.Net-C#:


        SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
        f.OpenPdf(FileUpload1.FileBytes);
        byte [] rtf = null;

        if (f.PageCount > 0)
        {
            f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf;
            //Let's whole PDF document to Word (RTF)
            rtf = f.ToWord();
        }

        //show Word/rtf
        if (rtf != null)
        {
            Response.Buffer = true;
            Response.Clear();
            Response.ContentType = "application/msword";
            Response.AddHeader("Content-Disposition:", "attachment; filename=Result.rtf");
            Response.BinaryWrite(rtf);
            Response.Flush();
            Response.End();
        }
      

5. Convert PDF file to Word file in VB.Net:

        Dim f As New SautinSoft.PdfFocus()
        f.OpenPdf("c:\Simple Text.pdf")

        If f.PageCount > 0 Then
            f.WordOptions.Format = SautinSoft.PdfFocus.CWordOptions.eWordDocument.Rtf
            Dim result As Integer = f.ToWord("c:\Result.rtf")

            'Show Word document
            If result = 0 Then
                System.Diagnostics.Process.Start("c:\Result.rtf")
            End If
        End If

Requirements and Technical Information

Requires .NET Framework 4.0 or higher. Our product is compatible with all .NET languages and supports all Operating Systems where .NET Framework and .NET Core can be used. Note that PDF Focus .Net is entirely written in managed C#, which makes it absolutely standalone and an independent library.

.Net Framework 4.0 and higher and .Net Core 2.0 and higher

.NET Framework 4.5, 4.6.1 and higher.The old version for old .NET 2.0 can be found here

.NET Standard 2.0

.NET Core, .NET 5.0 and higher.


Multi-platform component, runs on:


Our component has proven itself on cloud platforms and services:

  • Microsoft Azure
  • Amazon Web Services (AWS)
  • Google Cloud Platform
  • SharePoint
  • Docker
  • Xamarin Forms
  • etc.