Spire.PDF 9.1.0

.NET 6.0 .NET Core 2.0 .NET Framework 4.0
dotnet add package Spire.PDF --version 9.1.0
NuGet\Install-Package Spire.PDF -Version 9.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Spire.PDF" Version="9.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Spire.PDF --version 9.1.0
#r "nuget: Spire.PDF, 9.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Spire.PDF as a Cake Addin
#addin nuget:?package=Spire.PDF&version=9.1.0

// Install Spire.PDF as a Cake Tool
#tool nuget:?package=Spire.PDF&version=9.1.0

.NET Library for Processing & Manipulating PDF Files


Foo

Product PageDocumentationExamplesForumTemporary LicenseCustomized Demo

Spire.PDF for .NET is a professional PDF API applied to creating, writing, editing, handling and reading PDF files without any external dependencies within .NET ( C#, VB.NET, ASP.NET, .NET Core, .NET 5.0, MonoAndroid and Xamarin.iOS ) application.

Using this .NET PDF library, you can implement rich capabilities to create PDF files from scratch or process existing PDF documents entirely through C#/VB.NET without installing Adobe Acrobat.

PDF Processing Features

Conversions

Support Environment

  • Fully written in C# and also support VB.NET.
  • Applied on .NET Framework 2.0, 3.5, 3.5 Client Profile, 4.0, 4.0 Client Profile,4.5 and .NET Standard 2.0, .NET Core, .NET 5.0, MonoAndroid and Xamarin.Ios.
  • Support Windows Forms and ASP.NET Applications.
  • Support 32-bit OS
  • Support 64-bit OS
  • Support PDF Version 1.2, 1.3, 1.4, 1.5, 1.6 and 1.7.
  • PDF API reference in HTML.
  • Be Independent and do not need Adobe Acrobat or other third party PDF libraries.

Convert PDF to DOC in C#

            //Create a PDF document and load sample PDF.
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile("test.pdf");

            //Use SaveToFile method and set conversion target parameter as FileFormat.DOC.
            doc.SaveToFile("PDFtoDoc.doc", FileFormat.DOC);

Convert PDF to images in C#

            //Create a PDF document and load sample PDF.
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile("sample.pdf");

            Image bmp = doc.SaveAsImage(0);
            Image emf = doc.SaveAsImage(0, Spire.Pdf.Graphics.PdfImageType.Metafile);
            Image zoomImg = new Bitmap((int)(emf.Size.Width * 2), (int)(emf.Size.Height * 2));
            using (Graphics g = Graphics.FromImage(zoomImg))
            {
                g.ScaleTransform(2.0f, 2.0f);
                g.DrawImage(emf, new Rectangle(new Point(0, 0), emf.Size), new Rectangle(new Point(0, 0), emf.Size), GraphicsUnit.Pixel);
            }
            //Save as BMP
            bmp.Save("convertToBmp.bmp", ImageFormat.Bmp);
            System.Diagnostics.Process.Start("convertToBmp.bmp");

            //Save as EMF
            emf.Save("convertToEmf.png", ImageFormat.Png);
            System.Diagnostics.Process.Start("convertToEmf.png");

            //SAVE as ZoomImg
            zoomImg.Save("convertToZoom.png", ImageFormat.Png);
            System.Diagnostics.Process.Start("convertToZoom.png");

Convert HTML to PDF in C#

            //Create a pdf document.
            PdfDocument doc = new PdfDocument();

            PdfPageSettings setting = new PdfPageSettings();

            setting.Size = new SizeF(1000,1000);
            setting.Margins = new Spire.Pdf.Graphics.PdfMargins(20);

            PdfHtmlLayoutFormat htmlLayoutFormat = new PdfHtmlLayoutFormat();
            htmlLayoutFormat.IsWaiting = true;
            
            String url = "https://www.wikipedia.org/";
         
            Thread thread = new Thread(() =>
            { doc.LoadFromHTML(url, false, false, false, setting,htmlLayoutFormat); });
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            thread.Join();

            //Save pdf file.
            doc.SaveToFile("output-wiki.pdf");

Product PageDocumentationExamplesForumTemporary LicenseCustomized Demo

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Framework net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
Xamarin.iOS xamarinios
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Spire.PDF:

Package Downloads
James.Testing.Pdf

A library of helpers for the purpose of testing pdf documents/content. It is named after the author who wrote the book of James in the Bible. (James 1:2-3)

Xe.Framework.All

Package Description

DynamicUtility

Package Description

Xe.Framework.PdfTools

Package Description

CG.Infrastructure.Printing

Infra Printing library with shared services

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.1.0 3,849 1/5/2023
8.12.7 1,118 12/29/2022
8.12.5 2,392 12/14/2022
8.11.10 2,946 11/30/2022
8.11.2 4,568 11/16/2022
8.11.0 4,847 11/3/2022
8.10.5 5,434 10/19/2022
8.9.16 4,263 9/30/2022
8.9.2 4,572 9/14/2022
8.8.6 9,202 8/17/2022
8.7.9 9,790 7/27/2022
8.7.2 11,689 7/5/2022
8.6.1 12,535 6/8/2022
8.5.0 14,933 5/6/2022
8.4.15 9,388 4/21/2022
8.3.9 17,181 3/23/2022
8.2.2 21,960 2/22/2022
8.1.4 17,986 1/19/2022
8.1.0 15,552 1/6/2022
7.12.1 23,344 12/8/2021
7.11.1 23,986 11/9/2021
7.10.4 19,488 10/19/2021
7.10.0 4,169 10/9/2021
7.9.6 16,366 9/22/2021
7.9.2 8,881 9/2/2021
7.8.8 7,486 8/20/2021
7.8.2 12,027 8/4/2021
7.7.10 10,357 7/22/2021
7.6.15 11,192 6/29/2021
7.6.1 8,181 6/10/2021
7.5.0 8,034 5/7/2021
7.4.13 12,805 4/27/2021
7.4.5 17,617 4/14/2021
7.3.3 10,469 3/19/2021
7.3.1 3,358 3/12/2021
7.2.9 10,067 2/20/2021
7.2.5 6,426 2/7/2021
7.2.0 4,294 2/2/2021
7.1.10 8,098 1/15/2021
7.1.0 6,100 1/7/2021
6.12.20 4,207 12/25/2020
6.12.10 4,078 12/10/2020
6.12.3 3,136 12/7/2020
6.11.6 11,931 11/13/2020
6.11.0 3,666 11/4/2020
6.10.9 4,128 10/27/2020
6.10.4 4,951 10/20/2020
6.10.0 4,345 10/10/2020
6.9.16 5,677 9/28/2020
6.9.0 26,357 9/3/2020
6.8.5 16,095 8/17/2020
6.8.1 6,263 8/6/2020
6.7.12 7,471 7/29/2020
6.7.8 8,815 7/20/2020
6.7.6 3,981 7/8/2020
6.7.2 11,015 7/6/2020
6.5.15 16,428 5/28/2020
6.5.9 3,836 5/18/2020
6.5.6 22,091 5/13/2020
6.4.11 52,215 4/20/2020
6.4.4 4,814 4/10/2020
6.3.16 8,308 3/30/2020
6.3.10 15,722 3/23/2020
6.3.0 14,592 3/4/2020
6.2.6 8,399 2/19/2020
6.2.1 10,652 2/11/2020
6.1.8 24,478 1/21/2020
6.1.4 7,840 1/9/2020
5.12.15 14,093 12/16/2019
5.12.3 2,757 12/5/2019
5.11.18 3,692 11/29/2019
5.11.2 11,302 11/7/2019
5.11.0 3,993 11/1/2019
5.10.8 7,351 10/22/2019
5.10.2 6,281 10/11/2019
5.9.16 6,084 9/30/2019
5.9.6 4,151 9/18/2019
5.8.16 16,605 8/30/2019
5.8.7 13,621 8/13/2019
5.8.2 5,784 8/6/2019
5.7.20 2,205 7/31/2019
5.7.0 21,515 7/2/2019
5.6.31 1,704 7/1/2019
5.6.2 13,902 6/6/2019
5.5.21 7,362 5/24/2019
5.4.21 47,750 5/1/2019
5.4.20 1,804 4/29/2019
5.4.9 9,054 4/15/2019
5.4.1 7,402 4/4/2019
5.3.8 148,093 3/19/2019
5.3.2 4,128 3/11/2019
5.2.15 3,369 2/28/2019
5.2.3 4,295 2/14/2019
5.1.33 3,991 1/31/2019
5.1.16 4,057 1/19/2019
5.1.4 3,408 1/11/2019
5.1.0 7,057 1/2/2019
4.12.8 17,096 12/18/2018
4.12.2 6,163 12/7/2018
4.11.12 6,174 11/28/2018
4.11.8 23,909 11/16/2018
4.11.5 5,356 11/9/2018
4.11.3 14,856 11/8/2018