Spire.PDF
8.5.0
Install-Package Spire.PDF -Version 8.5.0
dotnet add package Spire.PDF --version 8.5.0
<PackageReference Include="Spire.PDF" Version="8.5.0" />
paket add Spire.PDF --version 8.5.0
#r "nuget: Spire.PDF, 8.5.0"
// Install Spire.PDF as a Cake Addin
#addin nuget:?package=Spire.PDF&version=8.5.0
// Install Spire.PDF as a Cake Tool
#tool nuget:?package=Spire.PDF&version=8.5.0
.NET Library for Processing & Manipulating PDF Files
Product Page 丨 Documentation 丨 Examples 丨 Forum 丨 Temporary License 丨 Customized 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
- Generate/write/read/edit PDF documents.
- Supports 14 core, Type 1, True Type, Type 3, CJK & Unicode fonts.
- Extract images, text, pages and attachments from a PDF document with great speed and accuracy.
- Merge/split PDF documents and overlay documents.
- Convert HTML, XPS, Text and images to PDF and convert PDF to Excel,Word,images with efficient performance.
- Encrypt/Decrypt PDF, modify PDF passwords and create PDF digital signatures.
- Add and modify text/image bookmarks.
- Add text in Footer/Header.
- Export database table and pictures to PDF.
- Add Hyperlinks, work with actions/Javascript Action/Action Chain/Action Annotation.
- Add/remove/edit/fill fields.
Conversions
- Convert Webpage HTML, HTML ASPX to PDF
- Convert Image(Jpeg, Jpg, Png, Bmp, Tiff, Gif, EMF, Ico) to PDF
- Convert Text to PDF
- Convert PDF to HTML
- Convert XPS to PDF
- Convert PDF to SVG
- Convert PDF to XPS
- Convert PDF to Image
- Convert PDF to Word
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 Page 丨 Documentation 丨 Examples 丨 Forum 丨 Temporary License 丨 Customized 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 |
.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 |
MonoAndroid | monoandroid |
Xamarin.iOS | xamarinios |
-
.NETCoreApp 2.0
- System.Drawing.Common (>= 4.5.0)
- System.Text.Encoding.CodePages (>= 4.5.0)
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
MonoAndroid 0.0
- SkiaSharp (>= 1.68.0)
- System.Buffers (>= 4.5.0)
- System.Memory (>= 4.5.3)
- System.Runtime.CompilerServices.Unsafe (>= 4.6.0)
- System.Text.Encoding.CodePages (>= 4.6.0)
-
net6.0
- System.Drawing.Common (>= 6.0.0)
- System.Text.Encoding.CodePages (>= 6.0.0)
-
Xamarin.iOS 0.0
- SkiaSharp (>= 1.68.0)
- System.Buffers (>= 4.5.0)
- System.Memory (>= 4.5.3)
- System.Runtime.CompilerServices.Unsafe (>= 4.6.0)
- System.Text.Encoding.CodePages (>= 4.6.0)
NuGet packages (3)
Showing the top 3 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 |
|
Xe.Framework.PdfTools
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
8.5.0 | 4,227 | 5/6/2022 |
8.4.15 | 3,643 | 4/21/2022 |
8.3.9 | 7,766 | 3/23/2022 |
8.2.2 | 9,922 | 2/22/2022 |
8.1.4 | 9,227 | 1/19/2022 |
8.1.0 | 6,123 | 1/6/2022 |
7.12.1 | 9,573 | 12/8/2021 |
7.11.1 | 10,761 | 11/9/2021 |
7.10.4 | 12,105 | 10/19/2021 |
7.10.0 | 2,070 | 10/9/2021 |
7.9.6 | 7,983 | 9/22/2021 |
7.9.2 | 6,286 | 9/2/2021 |
7.8.8 | 6,144 | 8/20/2021 |
7.8.2 | 9,158 | 8/4/2021 |
7.7.10 | 6,688 | 7/22/2021 |
7.6.15 | 8,387 | 6/29/2021 |
7.6.1 | 5,757 | 6/10/2021 |
7.5.0 | 5,293 | 5/7/2021 |
7.4.13 | 10,387 | 4/27/2021 |
7.4.5 | 9,276 | 4/14/2021 |
7.3.3 | 8,719 | 3/19/2021 |
7.3.1 | 2,503 | 3/12/2021 |
7.2.9 | 7,180 | 2/20/2021 |
7.2.5 | 4,990 | 2/7/2021 |
7.2.0 | 3,503 | 2/2/2021 |
7.1.10 | 6,326 | 1/15/2021 |
7.1.0 | 5,207 | 1/7/2021 |
6.12.20 | 3,128 | 12/25/2020 |
6.12.10 | 3,222 | 12/10/2020 |
6.12.3 | 2,550 | 12/7/2020 |
6.11.6 | 9,886 | 11/13/2020 |
6.11.0 | 2,658 | 11/4/2020 |
6.10.9 | 2,693 | 10/27/2020 |
6.10.4 | 4,097 | 10/20/2020 |
6.10.0 | 3,406 | 10/10/2020 |
6.9.16 | 4,381 | 9/28/2020 |
6.9.0 | 18,728 | 9/3/2020 |
6.8.5 | 13,260 | 8/17/2020 |
6.8.1 | 5,397 | 8/6/2020 |
6.7.12 | 5,646 | 7/29/2020 |
6.7.8 | 6,819 | 7/20/2020 |
6.7.6 | 2,917 | 7/8/2020 |
6.7.2 | 8,704 | 7/6/2020 |
6.5.15 | 12,200 | 5/28/2020 |
6.5.9 | 3,007 | 5/18/2020 |
6.5.6 | 16,358 | 5/13/2020 |
6.4.11 | 37,478 | 4/20/2020 |
6.4.4 | 2,808 | 4/10/2020 |
6.3.16 | 6,477 | 3/30/2020 |
6.3.10 | 11,766 | 3/23/2020 |
6.3.0 | 11,830 | 3/4/2020 |
6.2.6 | 7,165 | 2/19/2020 |
6.2.1 | 6,310 | 2/11/2020 |
6.1.8 | 19,101 | 1/21/2020 |
6.1.4 | 6,655 | 1/9/2020 |
5.12.15 | 10,574 | 12/16/2019 |
5.12.3 | 2,354 | 12/5/2019 |
5.11.18 | 3,322 | 11/29/2019 |
5.11.2 | 8,068 | 11/7/2019 |
5.11.0 | 2,197 | 11/1/2019 |
5.10.8 | 5,488 | 10/22/2019 |
5.10.2 | 4,231 | 10/11/2019 |
5.9.16 | 4,695 | 9/30/2019 |
5.9.6 | 3,536 | 9/18/2019 |
5.8.16 | 12,872 | 8/30/2019 |
5.8.7 | 9,800 | 8/13/2019 |
5.8.2 | 4,618 | 8/6/2019 |
5.7.20 | 1,739 | 7/31/2019 |
5.7.0 | 17,221 | 7/2/2019 |
5.6.31 | 954 | 7/1/2019 |
5.6.2 | 12,300 | 6/6/2019 |
5.5.21 | 5,065 | 5/24/2019 |
5.4.21 | 44,961 | 5/1/2019 |
5.4.20 | 989 | 4/29/2019 |
5.4.9 | 5,846 | 4/15/2019 |
5.4.1 | 5,975 | 4/4/2019 |
5.3.8 | 48,632 | 3/19/2019 |
5.3.2 | 3,876 | 3/11/2019 |
5.2.15 | 2,162 | 2/28/2019 |
5.2.3 | 3,087 | 2/14/2019 |
5.1.33 | 2,598 | 1/31/2019 |
5.1.16 | 3,697 | 1/19/2019 |
5.1.4 | 1,977 | 1/11/2019 |
5.1.0 | 6,273 | 1/2/2019 |
4.12.8 | 12,178 | 12/18/2018 |
4.12.2 | 3,514 | 12/7/2018 |
4.11.12 | 5,563 | 11/28/2018 |
4.11.8 | 18,011 | 11/16/2018 |
4.11.5 | 4,628 | 11/9/2018 |
4.11.3 | 11,084 | 11/8/2018 |