The simplest way to convert Text to PDF in C#, VB.Net and ASP.Net?

The simplest way to convert Text to PDF in C#, VB.Net and ASP.Net?

PDF Metamorphosis .Net

.Net assembly which gives API to convert RTF, Text, HTML, DOCX to PDF in .Net and C#.
The simplest way to convert Text to PDF in C#, VB.Net and ASP.Net?

PDF Metamorphosis .Net

The simplest way to convert Text to PDF in C#, VB.Net and ASP.Net?
The simplest way to convert Text to PDF in C#, VB.Net and ASP.Net?

Introduction

If you are looking for a .NET library to convert text data to PDF, you are in the right place. PDF Metamorphosis .Net helps you convert text to any PDF document.

To illustrate how to easily convert text to PDF, let's look at simple code in C#:


            SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();

// Let's set A4 page size.
            p.PageSettings.Size.A4();

            string textPath = @"d:\Eugene Onegin.txt";
            string pdfPath = @"d:\Eugene Onegin.pdf";

            int result = p.TextToPdfConvertFile(textPath, pdfPath);
            p.TextToPdfConvertFile(textPath, pdfPath);
          

The library gives you a full set of API to convert Text to PDF.


Download

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

Limitations

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


Input Text documents

The component can also convert Text documents to PDF. There is nothing special here, only a thing: unicode characters are supported too.

Output PDF documents

PDF Metamorphosis .Net can render PDF documents using own PDF class. You may select the version for output PDF: 1.3 -1.7, PDF/A. If you are looking for .NET class (C#) to convert PDF to other formats, see our PDF Focus .Net.


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

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


            SautinSoft.PdfMetamorphosis p = new SautinSoft.PdfMetamorphosis();

            // Let's set: A4, Landscape orientation, left and right margins: 1.5 Inch, top and bottom: 1 Inch
                p.PageSettings.Size.A4();
                p.PageSettings.Orientation = SautinSoft.PdfMetamorphosis.PageSetting.Orientations.Landscape;
                p.PageSettings.MarginLeft.Inch(1.5F)
                p.PageSettings.MarginRight.Inch(1.5f);
                p.PageSettings.MarginTop.Inch(1.0f);
                p.PageSettings.MarginBottom.Inch(1.0f);

            string textPath = @"d:\Oblomov.txt";
            string pdfPath = @"d:\Oblomov.pdf";

            int result = p.TextToPdfConvertFile(textPath, pdfPath);
      
2. Convert Text file to PDF file in VB.Net:
            Dim p As New SautinSoft.PdfMetamorphosis()

            ' Let's set: A4, Landscape orientation, left and right margins: 1.5 Inch, top and bottom: 1 Inch
                p.PageSettings.Size.A4()
                p.PageSettings.Orientation = SautinSoft.PdfMetamorphosis.PageSetting.Orientations.Landscape
                p.PageSettings.MarginLeft.Inch(1.5F)
                p.PageSettings.MarginRight.Inch(1.5F)
                p.PageSettings.MarginTop.Inch(1.0F)
                p.PageSettings.MarginBottom.Inch(1.0F)

            Dim textPath As String = "c:\A Hero of Our Time.txt"
            Dim pdfPath As String = Path.ChangeExtension(textPath, ".pdf")

            If p.TextToPdfConvertFile(textPath, pdfPath) = 0 Then
                System.Diagnostics.Process.Start(pdfPath)
            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 Metamorphosis .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.0, 4.5, 4.6.1 and higher.

.NET Standard 2.0

.NET Core 2.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
  • etc.

If you need a new code example or have a question: email us at support@sautinsoft.com or ask at Online Chat (right-bottom corner of this page) or use the Form below: