Spire.PDF.for..NET.2.3.0.with.Serial
LINK ---> https://urluso.com/2txWKN
How to Use Spire.PDF for .NET 2.3.0 with Serial
Spire.PDF for .NET is a versatile PDF library that enables software developers to generate, edit, read and manipulate PDF files within their own .NET applications. As a standalone PDF component, Spire.PDF for .NET provides users an incredible wealth of features without installing Adobe Acrobat[^1^].
In this article, we will show you how to use Spire.PDF for .NET 2.3.0 with serial, which is a licensed version that removes the watermark and page limit from the trial version. You can download Spire.PDF for .NET 2.3.0 from the official website[^2^] or install it via NuGet[^1^].
After you download and install Spire.PDF for .NET 2.3.0, you need to apply the serial key that you purchased from the e-iceblue website[^3^]. You can do this by calling the Spire.License.LicenseProvider.SetLicenseKey(string licenseKey) method in your code before using any Spire.PDF features. For example:
using Spire.Pdf;
using System;
namespace SpirePDFDemo
{
class Program
{
static void Main(string[] args)
{
//Apply the serial key
Spire.License.LicenseProvider.SetLicenseKey(\"Your serial key here\");
//Create a PDF document
PdfDocument doc = new PdfDocument();
//Add a page
PdfPageBase page = doc.Pages.Add();
//Draw text on the page
page.Canvas.DrawString(\"Hello, Spire.PDF!\", new PdfFont(PdfFontFamily.Helvetica, 12), new PdfSolidBrush(Color.Black), 10, 10);
//Save the document
doc.SaveToFile(\"Sample.pdf\");
//Launch the document
System.Diagnostics.Process.Start(\"Sample.pdf\");
}
}
}
That's it! You can now use Spire.PDF for .NET 2.3.0 with serial to create and manipulate PDF files in your .NET applications. For more information and examples, please refer to the API documentation and sample center that come with the installation package.
In this section, we will introduce some common features of Spire.PDF for .NET 2.3.0 that you can use to enhance your PDF files.
How to Add an Image to a PDF File
Spire.PDF for .NET 2.3.0 supports adding various types of images to a PDF file, such as JPEG, PNG, BMP, TIFF, GIF, etc. You can use the PdfImage class to create an image object from a file or a stream, and then use the DrawImage method of the PdfPageBase.Canvas object to draw the image on a specific location and size on the page. For example:
using Spire.Pdf;
using Spire.Pdf.Graphics;
using System;
using System.Drawing;
namespace SpirePDFDemo
{
class Program
{
static void Main(string[] args)
{
//Apply the serial key
Spire.License.LicenseProvider.SetLicenseKey(\"Your serial key here\");
//Create a PDF document
PdfDocument doc = new PdfDocument();
//Add a page
PdfPageBase page = doc.Pages.Add();
//Load an image from a file
PdfImage image = PdfImage.FromFile(\"logo.png\");
//Draw the image on the page with a specified location and size
page.Canvas.DrawImage(image, new PointF(100, 100), new SizeF(200, 100));
//Save the document
doc.SaveToFile(\"Sample.pdf\");
//Launch the document
System.Diagnostics.Process.Start(\"Sample.pdf\");
}
}
}
You can also use the PdfBitmap class to create an image object from a System.Drawing.Bitmap object, and use the same method to draw it on the page.
How to Protect PDF Files with Passwords or Digital Signatures
Spire.PDF for .NET 2.3.0 enables you to protect your PDF files by passwords or digital signatures. You can use the PdfSecurity property of the PdfDocument object to set the user password, owner password, encryption level and permissions for your PDF files. For example:
using Spire.Pdf;
using Spire.Pdf.Security;
using System;
namespace SpirePDFDemo
{
class Program
{
static void Main(string[] args)
{
//Apply the serial key
Spire.License.LicenseProvider.SetLicenseKey(\"Your serial key here\");
//Create a PDF document
PdfDocument doc = new PdfDocument();
//Add a page
PdfPageBase page = doc.Pages.Add();
//Draw text on the page
page.Canvas.DrawString(\"This is a protected PDF file.\", new PdfFont(PdfFontFamily.Helvetica, 12), new PdfSolidBrush(Color.Black), 10, 10);
//Set the user password and owner password
doc.Security.UserPassword = \"user\";
doc.Security.OwnerPassword = \"owner\";
//Set the encryption level to AES 256 bits
doc.Security.KeySize = PdfEncryptionKeySize.Key256Bit;
//Set the permissions to allow printing and copying only
doc.Security.Permissions = PdfPermissionsFlags.Print PdfPermissionsFlags.Copy;
//Save the document
doc.SaveToFile(\"Sample.pdf\");
//Launch the document
System.Diagnostics.Process.Start(\"Sample.pdf\");
}
}
}
You can also use the PdfSignature class to create a digital signature object from a certificate file or a store, and then use the AddSignature method of the PdfDocument object to add the signature to your PDF files. For example:
using Spire.Pdf;
using Spire.Pdf.Graphics;
using Spire.Pdf.Security;
using System;
namespace SpirePDFDemo
{
class Program
{
static void Main(string[] args)
{
//Apply the serial key
Spire.License.LicenseProvider.SetLicenseKey(\"Your serial key here\");
//Create a PDF document
PdfDocument doc = new PdfDocument();
//Add a page
PdfPageBase page = doc.Pages.Add();
//Draw text on the page
page.Canvas.DrawString(\"This is a 061ffe29dd