Why we should use a PDF toolkit for .NET
What is PDF?
- PDF (short for Portable Document Format) is a reasonably standard text file format of Adobe Systems. Similar to the Word (.doc) format, PDF supports raw text (text) along with fonts, graphic images, sounds, and many other effects. However, displaying PDF documents does not depend on the working environment of the user (machine configuration, software, and operating system).
- As mentioned above, displaying PDF documents does not depend on the working environment of the user, so this is considered the most significant advantage of PDF. Unlike Word documents, a PDF document, in most cases, will be displayed the same in different work environments. Because of this advantage, PDF format has become famous for the publication of books, newspapers, or other documents via the Internet.
- To read the PDF file on your computer, you must have software that supports this format. Popular software today is Adobe Reader or Foxit Reader.
- Trusted by millions of users around the world, it is sure that PDF files have many advantages, and here are some of the most common benefits that you refer to.
- As a technology software, the first requirement is safety and security. We can say that the PDF file has high security and a variety of options for users to choose.
- The range of support on most devices from computers to mobile devices.
- The PDF file also features regular documents; the PDF format can also display completely the same in all different working environments.
- And notably, the file size is usually quite small.
- In the 1990s, when the development of information technology is not as significant as today, there were many inadequacies in the issue of image data transmission, content, documents with large file images that could not be transmitted. Also, computers and devices were not as modern as they are today. They could handle only a small part, so at that time, an invention was needed to solve these limitations. As a result, software developers have started using links to other resources on the computer. To reduce the amount of content, you need to transfer or save to your computer.
- And that is the reason for the advent of PDF.
- However, the popularity of the PDF format at the beginning was relatively slow. Early versions of PDF did not support external hyperlinks, reducing its usefulness on the web. The increased file size compared to plain text also means that the time it takes to download a PDF document will be longer, which is also a problem with slow modems of the time.
- Adobe soon offered the Acrobat Reader (now Adobe Reader) for free and continues to support the prototype PDF format. Eventually, PDF became the standard format for printable documents on the web.
- The PDF format has been changed many times and is currently under development.
- Because of these significant advantages, PDF has become an indispensable and always-sought format of hundreds of thousands of different text editors worldwide. An undeniable proof is that the number of references, ebooks, etc. on the Internet is growing at a dizzying pace, covering a wide variety of different fields. Training programs at hundreds of thousands of universities also tend to shift from documents and papers from original formats such as Word, Wordx, etc. to modern PDF form. The above helps PDF to prove its unique position.
- As a modern user, keeping up with the trend, you will undoubtedly want to instantly convert and use PDF as the primary format for all your documents. However, the problem will arise from here, when thousands of your old records are in hundreds of different forms, which makes converting to PDF for each format a real challenge. Not to mention having to perform complex PDF-related operations to serve your work in the future, what a disaster.
Introducing PDF Library - A Comprehensive PDF Toolkit for .NET
- OfficeComponent PDF for .NET is an extremely flexible, easy-to-use, and comprehensive set of APIs used with the .NET Framework, adding to your application the ability to create, download, modify, convert and link. Export PDF documents. Besides, it also supports you to complete dozens of tasks, specific jobs with PDF format alone. And you know what the best thing is? All of the above can be done quickly without using Adobe Acrobat or any other third party libraries.
- Adobe Acrobat is genuinely a feature-rich PDF API that supports working with multiple PDF standards. Combining with Word and Excel components, you will have the ability to convert Word and Excel files into PDF with just a few lines of code. Besides, the PDF library also provides easy table manipulation, graph & image functions, PDF compression, hyperlink function, custom font processing. Moreover, developers can use the form API to manage form fields embedded in PDF documents.
- Sounds interesting? Want to get started now? Got stuck here because you don't know where to start? Don't worry because we've prepared you with a number of examples to help you get started.
- We have various C# and VB.NET code snippets. You can easily find individual code snippets for each of the different features and jobs listed in the PDF Library, such as PDF Split, PDF Merger, PDF to Image, and so on. The customization of this code is very high because we have simplified it to the maximum, so you will not need to worry about the complexity of using PDF Library.
- Besides, we have included some example projects that mention how to use the PDF Library to provide the most comprehensive overview of practical use as well as some practical projects. You can also dig deeper into the content and features of each component by visiting our Blog page.
- The full source code and live demos for every function are always available in our PDF package. Please also feel free to check out PDF online demos.
- PDF Library brings you a diverse and advanced feature library, maximum support for all operations.
- Our slogan is: "Sync everything with PDF", which means bringing PDF anywhere, at any time. Therefore, PDF Library is designed to focus most on converting from PDF to different formats, helping to simplify work on all platforms.
API that allows you to create and modify PDF documents On the Go and the Fly
- Fast and accurate is our top priority. Here, we bring you a new and rich set of APIs, which allow you to access all PDF components in documents, including text, images, and so on.
- For example, the
PdfDocument class allows you to create a new document quickly. We take advantage of that class with the following code snippet:
// Create a new instance of PdfDocument class.
PdfDocument doc = new PdfDocument();
PdfPage page = doc.Pages.Add();
// Create a solid brush
PdfBrush brush = new PdfSolidBrush(Color.Black);
const float fontSize = 24.0f;
// Set the font
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
// Draw the text
page.Graphics.DrawString("Hello World!", font, brush, new PointF(30, 30));
// Save and close the document.
var outputPath = Path.Combine(OutputDir, this.GetType().Name + "_" + Guid.NewGuid().ToString() + ".pdf");
- Worrying cause you have to work with
Visual Basic? Don't worry,
PdfDocument also support this format.
' Create a new instance of the PdfDocument class.
Dim doc As New PdfDocument()
Dim page As PdfPage = doc.Pages.Add()
' Create a solid brush
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
Const fontSize As Single = 24.0F
' Set the font
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, fontSize)
' Draw the text
page.Graphics.DrawString("Hello World!", font, brush, New PointF(30, 30))
' Save and close the document.
Dim outputPath = Path.Combine(OutputDir, Me.GetType().Name & "_" & Guid.NewGuid().ToString() & ".pdf")
Convert from HTML to PDF format with the latest HTML5 and CSS3 support
- HTML is one of the most popular text markup languages in the world today when it is used to present web pages. The OfficeComponent PDF allows you add the capability to convert any HTML webpage to PDF documents by just using a few lines of code:
// Create a new converter.
var c = new HtmlToPdfConverter()
ViewportWidth = Width,
ViewportHeight = Height,
PageSize = PageSize,
PageMargin = Margin,
Portrait = Portrait,
Delay = ConversionDelay,
Timeout = Timeout,
SinglePage = SinglePage
// Convert URL
c.ConvertAsync(Url, outputPath, OnConversionComplete);
- If you wish to convert an HTML string to PDF, use the following line of code instead:
// Convert the specified HTML string.
c.ConvertStringAsync(HtmlString, HtmlStringBaseUrl, outputPath, OnConversionComplete)
The full source code of this example is available in our PDF package.
A live demo for converting HTML to PDF is also available on our site. If you also need PDF functionality, check out our PDF online demos.
Convert PDF to Text and Image
- PDF documents contain not only textual content but sometimes images and videos as well. What if you just wanted to extract all the pictures in a report regardless of the text? With OfficeComponent PDF, you can quickly implement robust PDF to text or image conversion features for your .NET apps.
Convert RTF and XPS to PDF
- Facing unpopular formats like RTF and XPS? Don't worry, our PDF tool is an excellent choice when you need to convert RTF and XPS documents into PDF. Everything can be done with just three line of code:
var ex = ((RTFTOPDFExample) _example);
ex.SourceRtfFilePath = inputBox.Text;
ex.ToMetaObject = rbtMeta.Checked;
Add, update, delete text & images from PDF documents
- You can either add, update, and delete text or images from any sources to your PDF documents. From now on, start unleashes your creativity for every paper.
Encrypt, Decrypt, add and remove passwords information
- Is security one of your best priorities? You can now encrypt, decrypt, and remove passwords information with OfficeComponent PDF.
Split PDF document into single-page documents. Create a booklet.
- OfficeComponent PDF lets you split PDF documents or create N-up's (number of pages over single page) and booklets.
No Server Deployment Fees
- It's royalty-free, and you don't have to pay either for distribution fees or per-server licensing fees, making OfficeComponent PDF very cost-effective.
Lightning Fast Performance
- Written by our .NET experts with more than 20 years of experience, Office Component PDF Library delivers high performance and low memory footprint.
Resources and Support
To access our online documentation, click here.