Developer Tools
|
Office Productivity Applications
|
Platform-Agnostic APIs
|
Home | Online Demos | Downloads | Buy Now | Support | About Us | News | Working Together | Contact Us
Gnostice PDFOne .NET is a versatile PDF SDK for add PDF-related features to .NET applications. PDFOne .NET can create, edit, view, print, encrypt, decrypt, merge, split, reorganize, bookmark, annotate, watermark, and stamp PDF documents. PDFOne can also process PDF forms or AcroForms - create, edit, fill, and flatten form fields. The API hides the complexity of the PDF format and enables developers to quickly implement sophisticated PDF features. PDFOne is entirely self-contained and is written in 100% managed code. It does not depend on external software such as Adobe PDF SDK, GhostScript or FreeType.
PDFOne supports .NET Framework 2 and newer versions. You can use PDFOne .NET in Visual Studio versions 2005, 2008 and 2010. You can use it in ASP.NET and ASP.NET MVC Web applications too.
PDFOne .NET has four components.
// Create a new PDF document PDFDocument doc1 = new PDFDocument(); // Write some text doc1.WriteText("Hello, world!", 2, 1); // Render an image doc1.DrawImage("sample_image.bmp", 5, 1); // Draw an ellipse shape doc1.DrawEllipse(1, 0.5f, 3, 1, false, true); // Save the document to file doc1.Save("sample_doc.pdf"); // Close IO resources doc1.Close();
PDFDocument
can load existing PDF documents and process them. It can iterate through pages and page elements.
// Load an existing PDF document PDFDocument doc1 = new PDFDocument(); Console.Out.Write("Please wait..."); doc1.Load("sample_doc.pdf"); // Print total number of pages page Console.Out.WriteLine( "\rFound " + doc1.GetPageCount().ToString() + " page(s)!"); // Close IO resources doc1.Close(); Console.In.ReadLine();
PDFDocument
can convert PDF documents to several image formats.
PDFDocument
can extract text from documents.
With PDFOne, you can enhance your PDF documents with features such as form fields, digital signatures, watermarks, bookmarks, annotations (markups, notes, highlights,...) and stamps.
PDFDocument
can be used in medium-trust ASP.NET applications.
// Create a PDF printer object PDFPrinter PDFPrinter1 = new PDFPrinter(); // Load an existing document PDFPrinter1.LoadDocument("sample_doc.pdf"); // Select a printer PDFPrinter1.PrintOptions.PrinterName = (String) System.Drawing.Printing.PrinterSettings.InstalledPrinters[0]; // Specify print settings PDFPrinter1.AutoCenter = true; PDFPrinter1.AutoRotate = true; PDFPrinter1.PageScaleType = PrintScaleType.None; PDFPrinter1.PrintOptions.PrintRange = System.Drawing.Printing.PrintRange.Selection; // Select pages 2 and 4 for printing PDFPrinter1.SelectedPages = "2,4"; // Start printing PDFPrinter1.Print(); // Free IO resources PDFPrinter1.Dispose();
PDFViewer
instance to enable end-users to navigate to destinations in displayed pages.In the assemblies of these components, you will find other PDFOne classes that you will need to use to implement various PDF features. Let us check a few of them.
WriteText()
methods
of PDFDocument
or PDFPage
.
// Create a new PDF document PDFDocument doc1 = new PDFDocument(); // automatically creates page 1 // Create an "Impact" font instance PDFFont fntHelvetica = new PDFFont(StdType1Font.Helvetica, // name PDFFontStyle.Stroke_And_Fill, // style 72); // size // Set fill color to yellow doc1.Brush.Color = Color.Yellow; // Set stroke color to red doc1.Pen.Color = Color.Red; doc1.Pen.Width = 1; // Render text on current page using Helvetica font doc1.WriteText("Hello, World!", fntHelvetica, 1, 1); // Save document to file doc1.Save("sample_doc.pdf"); doc1.Close();
PDFDocument
instance. Similar to PDFDocument
, this class has page-specific properties
and methods that allow you to create new page elements and process existing page contents.
// Create a "Tahoma" font instance PDFFont fntTahoma = new PDFFont(new Font("Tahoma", 24)); // Create an "Impact" font instance PDFFont fntImpact = new PDFFont(new Font("Impact", 24)); // Create a page PDFPage pg1 = new PDFPage(System.Drawing.Printing.PaperKind.B6Envelope); // Write text on page 1 using Tahoma font pg1.WriteText("This is page 1 (Envelope size) ", fntTahoma, 1, 1); // Create another page PDFPage pg2 = new PDFPage(System.Drawing.Printing.PaperKind.A4); // Write text on page 2 using Tahoma font pg2.WriteText("This is page 2 (A4 size)", fntTahoma, 1, 1); // Create a new PDF document PDFDocument doc1 = new PDFDocument(); // automatically creates page 1 // Add the pages to the document doc1.AddPage(pg1); doc1.AddPage(pg2); /* * You can render text even after adding the * pages to the document */ // Set first page as the current page doc1.CurrentPageNo = 1; // Render new text on page 1 using Impact font doc1.WriteText("One, two, buckle my shoe", fntImpact, 3, 3); // Set second page as the current page doc1.CurrentPageNo = 2; // Render new text on page 2 using Impact font doc1.WriteText("Three, four, knock on door ", fntImpact, 3, 3); // Save the document to file doc1.Save("sample_doc.pdf"); // Close IO resources doc1.Close();
Gnostice.PDFOne.PDFFormField
: This abstract class represents a PDF form field. You create instances of its derived types to create various types of form fields.
// Create a new PDF document PDFDocument doc1 = new PDFDocument(); // automatically creates page 1 doc1.ApplyFormAppearances = true; PDFFormTextField tf = new PDFFormTextField(new RectangleF(1, 1, 2, 0.2f)); tf.FieldName = "fld_Name"; tf.BorderWidth = 1; tf.BorderColor = Color.Gray; tf.NameAsUnicode = false; tf.FieldValue = "John Doe"; PDFFormListBox lb = new PDFFormListBox(new RectangleF(1, 2, 2, 0.5f)); lb.FieldName = "fld_Country"; lb.NameAsUnicode = false; lb.BorderWidth = 1; lb.BorderColor = Color.Gray; lb.AddItem("India"); lb.AddItem("Germany"); lb.AddItem("Russia"); PDFFormPushButton pb = new PDFFormPushButton(new RectangleF(1, 3, 2, 0.4f)); pb.FieldName = "fld_Submit"; pb.NameAsUnicode = false; pb.NormalCaption = "Submit"; pb.BorderWidth = 1; pb.BorderColor = Color.Gray; pb.ActionType = PDFFormFieldActionType.Submit_Action; pb.SubmitActionType = PDFSubmitActionType.HTTP_Post; pb.SubmitUrl = "http://www.gnostice.com/newsletters" + "/demos/200804/forms_test.asp"; doc1.AddFormField(tf); doc1.AddFormField(lb); doc1.AddFormField(pb); // Save document to file doc1.Save("sample_doc.pdf"); doc1.Close();
By now, you would have had a good feel of the API. You are now ready to learn about all the things that can be accomplished with PDFOne. Please follow the links below for PDFOne features in greater detail.
---o0O0o---
Our .NET Developer Tools | |
---|---|
Gnostice Document Studio .NETMulti-format document-processing component suite for .NET developers. |
PDFOne .NETA .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications. |
Our Delphi/C++Builder developer tools | |
---|---|
Gnostice Document Studio DelphiMulti-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms. |
eDocEngine VCLA Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools. |
PDFtoolkit VCLA Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents. |
Our Java developer tools | |
---|---|
Gnostice Document Studio JavaMulti-format document-processing component suite for Java developers. |
PDFOne (for Java)A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications. |
Our Platform-Agnostic Cloud and On-Premises APIs | |
---|---|
StarDocsCloud-hosted and On-Premises REST-based document-processing and document-viewing APIs |
Privacy | Legal | Feedback | Newsletter | Blog | Resellers | © 2002-2025 Gnostice Information Technologies Private Limited. All rights reserved. |