Namespace pdftron.PDF
Classes
Action
Actions are typically what happens when a user clicks on a link or bookmark.
Instead of simply jumping to a destination in the document, an annotation or outline item can specify an action for the viewer application to perform, such as launching an application, playing a sound, or changing an annotation’s appearance state.
ActionParameter
Container for parameters used in handling various actions
AdvancedImagingConvertOptions
AdvancedImagingModule
static interface to PDFTron SDKs AdvancedImaging functionality
Annot
Annot is a base class for different types of annotations. For annotation specific properties, please refer to derived classes.
An annotation is an interactive object placed on a page, such as a text note, a link, or an embedded file. PDF includes a wide variety of standard annotation types. An annotation associates an object such as a widget, note, or movie with a location on a page of a PDF document, or provides a means of interacting with the user via the mouse and keyboard. For more details on PDF annotations please refer to section 12.5 in the PDF Reference Manual and the
Annot.BorderStyle
BorderStyle structure specifies the characteristics of the annotation's border. The border is specified as a rounded rectangle.
BarcodeModule
static interface to Apryse SDK's barcode extraction functionality
BarcodeOptions
BitmapInfo
Bookmark
A PDF document may optionally display a document outline on the screen, allowing the user to navigate interactively from one part of the document to another. The outline consists of a tree-structured hierarchy of Bookmarks (sometimes called outline items), which serve as a 'visual table of contents' to display the document’s structure to the user.
Each Bookmark has a title that appears on screen, and an Action that specifies what happens when a user clicks on the Bookmark. The typical action for a user-created Bookmark is to move to another location in the current document, although any action (see PDF.Action) can be specified.
Bookmark is a utility class used to simplify work with PDF bookmarks (or outlines; see section 8.2.2 'Document Outline' in PDF Reference Manual for more details).
CADConvertOptions
CADModule
static interface to PDFTron SDKs CAD functionality
CMSSignatureOptions
Optional data for CMS creation.
CharData
CharData is a data structure returned by CharIterator that is used to provide extra information about a character within a text run. The extra information includes positioning information, the character data and a number of bytes taken by the character.
CharIterator
CharIterator is an iterator type that can be used to traverse CharData in the current e_text element. For a sample use case, please take a look at ElementReaderAdv sample project.
ColorPt
ColorPt is an array of colorants (or tint values) representing a color point in an associated color space.
ColorSpace
This abstract class is used to serve as a color space tag to identify the specific color space of a Color object. It contains methods that transform colors in a specific color space to/from several color space such as DeviceRGB and DeviceCMYK.
For purposes of the methods in this class, colors are represented as arrays of color components represented as doubles in a normalized range defined by each ColorSpace. For many ColorSpaces (e.g. DeviceRGB), this range is 0.0 to 1.0. However, some ColorSpaces have components whose values have a different range. Methods are provided to inquire per component minimum and maximum normalized values.
ContentReplacer
ContentReplacer is a utility class for replacing content (text and images) in existing PDF (template) documents.
Users can replace content in a PDF page using the following operations:
- Replace an image that exists in a target rectangle with a replacement image.
- Replace text that exists in a target rectangle with replacement text.
- Replace all instances of a specially marked string with replacement string.
PDFDoc doc("../../TestFiles/BusinessCardTemplate.pdf");
doc.InitSecurityHandler();
ContentReplacer replacer;
Page pg = doc.GetPage(1);
Image img = Image.Create(doc, "../../TestFiles/peppers.jpg");
replacer.AddImage(page.GetMediaBox(), img.GetSDFObj());
replacer.AddString("NAME", "John Smith");
replacer.AddString("JOB_TITLE", "Software Developer");
replacer.Process(page);
ConversionOptions
Convert
Encapsulates the conversion of a single document from one format to another.
Convert.EPUBOutputOptions
A class containing options for PDF to EPUB conversion
Convert.ExcelOutputOptions
A class containing options common to ToExcel functions
Convert.HTMLOutputOptions
A class containing options for PDF to HTML conversion
Convert.OutputOptionsOCR
A class containing OCR options common to the ToHtml, ToWord, ToExcel, ToPowerPoint functions
Convert.PowerPointOutputOptions
A class containing options common to ToPowerPoint functions
Convert.Printer
Convert.Printer is a utility class to install the a printer for print-based conversion of documents for Convert.ToPdf.
Convert.SVGOutputOptions
Convert.StructuredOutputOptions
A class containing StructuredOutput options
Convert.TiffOutputOptions
A class containing options for PDF to Tiff conversion
Convert.WordOutputOptions
A class containing options common to ToWord functions
Convert.XODOutputOptions
Convert.XPSOutputCommonOptions
Convert.XPSOutputOptions
DataExtractionModule
static interface to Apryse SDKs data extraction functionality
DataExtractionOptions
Date
The Date class is a utility class used to simplify work with PDF date objects.
PDF defines a standard date format, which closely follows international standard ASN.1 (Abstract Syntax Notation One), A date is a string of the form (D:YYYYMMDDHHmmSSOHH'mm'); See PDF Reference Manual for details.
Date can be associated with a SDF/Cos date string using Date(Obj*) constructor or later using Date::Attach(Obj*) or Date::Update(Obj*) methods.
Date keeps a local date/time cache so it is necessary to call Date::Update() method if the changes to the Date should be saved in the attached Cos/SDF string.
Destination
A destination defines a particular view of a document, consisting of the following:
- The page of the document to be displayed
- The location of the document window on that page
- The magnification (zoom) factor to use when displaying the page
Destination is a utility class used to simplify work with PDF Destinations; Please refer to section 8.2.1 'Destinations' in PDF Reference Manual for details.
DiffOptions
DigitalSignatureField
A class representing a digital signature form field.
DigitalSignatureFieldIterator
DigitalSignatureFieldIterator is an iterator type that can be used to traverse a list of digital signature form fields in a PDF document.
DisallowedChange
Data pertaining to a change detected in a document during a digital signature modification permissions verification step, the change bein g both made after the signature was signed, and disallowed by t he signature's permissions settings.
DocumentConversion
Encapsulates the conversion of a single document from one format to another.
Element
Element is the abstract interface used to access graphical elements used to build the display list.
Just like many other classes in PDFNet (e.g. ColorSpace, Font, Annot, etc), Element class follows the composite design pattern. This means that all Elements are accessed through the same interface, but depending on the Element type (that can be obtained using GetType()), only methods related to that type can be called. For example, if GetType() returns e_image, it is illegal to call a method specific to another Element type (i.e. a call to a text specific GetTextData() will throw an Exception).
ElementBuilder
ElementBuilder is used to build new PDF.Elements (e.g. image, text, path, etc) from scratch. In conjunction with ElementWriter, ElementBuilder can be used to create new page content.
ElementReader
ElementReader can be used to parse and process content streams. ElementReader provides a convenient interface used to traverse the Element display list of a page. The display list representing graphical elements (such as text-runs, paths, images, shadings, forms, etc) is accessed using the intrinsic iterator. ElementReader automatically concatenates page contents spanning multiple streams and provides a mechanism to parse contents of sub-display lists (e.g. forms XObjects and Type3 fonts).
ElementWriter
ElementWriter can be used to assemble and write new content to a page, Form XObject, Type3 Glyph stream, pattern stream, or any other content stream.
EmbeddedTimestampVerificationResult
This class represents the result of verifying a secure embedded timestamp digital signature.
Field
An interactive form (sometimes referred to as an AcroForm) is a collection of fields for gathering information interactively from the user. A PDF document may contain any number of Fields appearing on any combination of pages, all of which make up a single, global interactive form spanning the entire document.
PDFNet fully supports reading, writing, and editing PDF forms and provides many utility methods so that work with forms is simple and efficient. Using PDFNet forms API arbitrary subsets of form fields can be imported or exported from the document, new forms can be created from scratch, and the appearance of existing forms can be modified.
for(FieldIterator itr = doc.getFieldIterator(); itr.hasNext();) {
Field current=(Field)(itr.next());
System.out.println("Field name: " + current.getName());
System.out.println("Field partial name: " + current.getPartialName());
}
To search field by name use GetFieldIterator method. For example:
// Search for a specific field
FieldIterator itr = doc.GetFieldIterator("employee.name.first");
if (itr.hasNext()) System.out.println("Field search for " + ((Field)(itr.next())).getName() + " was successful");
else System.out.println("Field search failed");
If a given field name was not found or if the end of the field list
was reached the iterator HasNext()
will return false.
If you have a valid iterator you can access the Field using Current()
method. For example:
Field field = itr.Current();
Using Flatten(...)
method it is possible to merge field
appearances with the page content. Form 'flattening' refers to the
operation that changes active form fields into a static area that is
part of the PDF document, just like the other text and images in
the document. A completely flattened PDF form does not have any
widget annotations or interactive fields.
FieldIterator
FieldIterator is an iterator type that can be used to traverse a list form fields in a PDF document. For more information, please PDFDoc.getFieldIterator().
FileSpec
FileSpec corresponds to the PDF file specification object.
A PDF file can refer to the contents of another file by using a file specification, which can take either of the following forms:
- A simple file specification gives just the name of the target file in a standard format, independent of the naming conventions of any particular file system.
- A full file specification includes information related to one or more specific file systems.
- A URL reference.
For more details on file specifications, please refer to Section 3.10, 'File Specifications' in the PDF Reference Manual.
Flattener
Flattener is a optional PDFNet add-on that can be used to simplify and optimize existing PDF's to render faster on devices with lower memory and speeds.
PDF documents can frequently contain very complex page description (e.g. thousands of paths, different shadings, color spaces, blend modes, large images etc.) that may not be suitable for interactive viewing on mobile devices. Flattener can be used to speed-up PDF rendering on mobile devices and on the Web by simplifying page content (e.g. flattening complex graphics into images) while maintaining vector text whenever possible.
By using the FlattenMode::e_simple option each page in the PDF will be reduced to a single background image, with the remaining text over top in vector format. Some text may still get flattened, in particular any text that is clipped, or underneath, other content that will be flattened.
On the other hand the FlattenMode::e_fast will not flatten simple content, such as simple straight lines, nor will it flatten Type3 fonts.
@note 'Flattener' is available as a separately licensable add-on to PDFNet core license or for use via Cloud API (http://www.pdftron.com/pdfnet/cloud).
@note See 'pdftron.PDF.Optimizer' for alternate approach to optimize PDFs with focus on file size reduction.
Font
A font that is used to draw text on a page. It corresponds to a Font Resource in a PDF file. More than one page may reference the same Font object. A Font has a number of attributes, including an array of widths, the character encoding, and the font’s resource name.
PDF document can contain several different types of fonts and Font class represents a single, flat interface around all PDF font types.
There are two main classes of fonts in PDF: simple and composite fonts.
Simple fonts are Type1, TrueType, and Type3 fonts. All simple fonts have the following properties:
- Glyphs in the font are selected by single-byte character codes obtained from a string that is shown by the text-showing operators. Logically, these codes index into a table of 256 glyphs; the mapping from codes to glyphs is called the font’s encoding. Each font program has a built-in encoding. Under some circumstances, the encoding can be altered by means described in Section 5.5.5 "Character Encoding" in PDF Reference Manual.
- Each glyph has a single set of metrics. Therefore simple fonts support only horizontal writing mode.
FontCharCodeIterator
FontCharCodeIterator is an iterator type that can be used to traverse a list of visible char codes in a font embedded in PDF. For more information, please take a look at Font.getCodeIterator().
Function
Although PDF is not a programming language it provides several types of function object that represent parameterized classes of functions, including mathematical formulas and sampled representations with arbitrary resolution. Functions are used in various ways in PDF, including device-dependent rasterization information for high-quality printing (halftone spot functions and transfer functions), color transform functions for certain color spaces, and specification of colors as a function of position for smooth shadings. Functions in PDF represent static, self-contained numerical transformations.
PDF::Function represents a single, flat interface around all PDF function types.
GSChangesIterator
GSChangesIterator is an iterator type that can be used to traverse a list of changes in the graphics state between subsequnet graphical elements on the page. For a sample use case, please take a look at ElementReaderAdv sample project.
GState
GState is a class that keeps track of a number of style attributes used to visually define graphical Elements. Each PDF.Element has an associated GState that can be used to query or set various graphics properties.
GeometryCollection
A Preprocessed PDF geometry collection
HTML2PDF
'pdftron.PDF.HTML2PDF' is an optional PDFNet Add-On utility class that can be used to convert HTML web pages into PDF documents by using an external module (html2pdf).
The html2pdf modules can be downloaded from http: www.pdftron.com/pdfnet/downloads.html.
Users can convert HTML pages to PDF using the following operations: - Simple one line static method to convert a single web page to PDF. - Convert HTML pages from URL or string, plus optional table of contents, in user defined order. - Optionally configure settings for proxy, images, java script, and more for each HTML page. - Optionally configure the PDF output, including page size, margins, orientation, and more. - Optionally add table of contents, including setting the depth and appearance.
using System;
using System.IO;
using pdftron;
using pdftron.Common;
using pdftron.SDF;
using pdftron.PDF;
using (PDFDoc doc = new PDFDoc())
{
if ( HTML2PDF.Convert(doc, "http://www.gutenberg.org/wiki/Main_Page") )
doc.Save(outputFile, SDFDoc.SaveOptions.e_linearized);
}
The following code demonstrates how to convert multiple web pages into one pdf, including any images and the background, but with lowered image quality to save space.
using System;
using System.IO;
using pdftron;
using pdftron.Common;
using pdftron.SDF;
using pdftron.PDF;
using (PDFDoc doc = new PDFDoc())
{
HTML2PDF converter = new HTML2PDF();
converter.SetImageQuality(25);
HTML2PDF.WebPageSettings settings = new HTML2PDF.WebPageSettings();
settings.SetPrintBackground(false);
converter.InsertFromURL("http://www.gutenberg.org/wiki/Main_Page", settings);
if ( HTML2PDF.Convert(doc, "http://en.wikipedia.org/wiki/Canada") )
doc.Save(outputFile, SDFDoc.SaveOptions.e_linearized);
}
HTML2PDF.Proxy
Proxy settings to be used when loading content from web pages.
HTML2PDF.TOCSettings
HTML2PDF.WebPageSettings
Settings that control how a web page is opened and converted to PDF.
Highlights
Highlights is used to store the necessary information and perform certain tasks in accordance with Adobe's Highlight standard, whose details can be found at:
http://partners.adobe.com/public/developer/en/pdf/HighlightFileFormat.pdf
In a nutshell, the Highlights class maintains a set of highlights. Each highlight contains three pieces of information:
page: the number of the page this Highlight is on; position: the start position (text offset) of this Highlight; length: the length of this Highlight.
Possible use case scenarios for Highlights include:
- Load a Highlight file (in XML format) and highlight the corresponding texts in the viewer (e.g., if the viewer is implemented using PDFViewCtrl, it can be achieved simply by calling PDFViewCtrl::SelectByHighlights() method);
- Save the Highlight information (e.g., constructed by the TextSearch class) to an XML file for external uses.
- The Highlights class does not maintain the corresponding PDF document for its highlights. It is the user's responsibility to match them up.
- The Highlights class ensures that each highlight it maintains is unique (no two highlights have the same page, position and length values).
- The current implementation of Highlights only supports the 'characters' encoding for 'units' as described in the format; the 'words' encoding is not supported at this point.
Image
Image class provides common methods for working with PDF images.
Image2RGB
Image2RGB is a filter that can decompress and normalize any PDF image stream (e.g. monochrome, CMYK, etc) into a raw RGB pixel stream.
Image2RGBA
Image2RGBA is a filter that can decompress and normalize any PDF image stream (e.g. monochrome, CMYK, etc) into a raw RGBA pixel stream.
MergeXFDFOptions
OCRModule
static interface to PDFTron SDKs OCR functionality
OCROptions
OfficeToPDFOptions
Optimizer
The Optimizer class provides functionality for optimizing/shrinking output PDF files.
'pdftron.PDF.Optimizer' is an optional PDFNet Add-On utility class that can be used to optimize PDF documents by reducing the file size, removing redundant information, and compressing data streams using the latest in image compression technology. PDF Optimizer can compress and shrink PDF file size with the following operations:
- Remove duplicated fonts, images, ICC profiles, and any other data stream.
- Optionally convert high-quality or print-ready PDF files to small, efficient and web-ready PDF.
- Optionally down-sample large images to a given resolution.
- Optionally compress or recompress PDF images using JBIG2 and JPEG2000 compression formats.
- Compress uncompressed streams and remove unused PDF objects.
@note 'Optimizer' is available as a separately licensable add-on to PDFNet core license or for use via Cloud API (http://www.pdftron.com/pdfnet/cloud).
@note See 'pdftron.PDF.Flattener' for alternate approach to optimize PDFs for fast viewing on mobile devices and the Web.
Optimizer.ImageSettings
A class that stores downsampling/recompression settings for color and grayscale images.
Optimizer.MonoImageSettings
A class that stores image downsampling/recompression settings for monochrome images.
Optimizer.OptimizerSettings
A class that stores settings for the optimizer
Optimizer.TextSettings
A class that stores text optimization settings.
OptionsBase
PDF2HtmlReflowParagraphsModule
static interface to PDFTron SDKs PDF to HTML functionality
PDF2WordModule
static interface to PDFTron SDKs PDF to Word functionality
PDFDoc
PDFDoc is a high-level class describing a single PDF (Portable Document Format) document. Most applications using PDFNet will use this class to open existing PDF documents, or to create new PDF documents from scratch.
The class offers a number of entry points into the document. For example,
- To access pages use pdfdoc.getPageIterator() or pdfdoc.PageFind(page_num).
- To access form fields use pdfdoc.GetFieldIterator(), pdfdoc.GetFieldIterator(name) or pdfdoc.GetField(name).
- To access document's meta-data use pdfdoc.GetDocInfo().
- To access the outline tree use pdfdoc.GetFirstBookmark().
- To access low-level Document Catalog use pdfdoc.GetRoot().
PDFDocGenerator
A collection of static methods to create blank documents
PDFDocInfo
PDFDocInfo is a high-level utility class that can be used to read and modify document's metadata.
PDFDocViewPrefs
PDFDocViewPrefs is a high-level utility class that can be used to control the way the document is to be presented on the screen or in print.
PDFDocViewPrefs class corresponds to PageMode, PageLayout, and ViewerPreferences entries in the document’s catalog. For more details please refer to section 8.1 'Viewer Preferences' in PDF Reference Manual.
PDFDraw
PDFDraw contains methods for converting PDF pages to images and to Bitmap objects. Utility methods are provided to export PDF pages to various raster formats as well as to convert pages to GDI+ bitmaps for further manipulation or drawing.
PDFNetInternalTools
Encapsulates the conversion of a single document from one format to another.
PDFRasterizer
PDFRasterizer is a low-level PDF rasterizer. The main purpose of this class is to convert PDF pages to raster images (or bitmaps). PDFRasterizer is a relatively low-level class. If you need to convert PDF page to an image format or a Bitmap, consider using PDF.PDFDraw. Similarly, if you are building an interactive PDF viewing application use PDF.PDFViewCtrl instead.
Page
Page is a high-level class representing PDF page object (see 'Page Objects' in Section 3.6.2, 'Page Tree,' in PDF Reference Manual).
Among other associated objects, a page object contains:
- A series of objects representing the objects drawn on the page (See Element and ElementReader class for examples of how to extract page content).
- A list of resources used in drawing the page
- Annotations
- Beads, private metadata, optional thumbnail image, etc.
PageIterator
PageIterator is an iterator type that can be used to traverse a list pages in a PDF document. For more information, please PDFDoc.GetPageIterator().
PageLabel
PDF page labels can be used to describe a page. This is used to allow for non-sequential page numbering or the addition of arbitrary labels for a page (such as the inclusion of Roman numerals at the beginning of a book). PDFNet PageLabel object can be used to specify the numbering style to use (for example, upper- or lower-case Roman, decimal, and so forth), the starting number for the first page, and an arbitrary prefix to be pre-appended to each number (for example, "A-" to generate "A-1", "A-2", "A-3", and so forth.)
PageLabel
corresponds to the PDF Page Label object (Section 8.3.1,
'Page Labels' in the PDF Reference Manual.
Each page in a PDF document is identified by an integer page index that expresses the page’s relative position within the document. In addition, a document may optionally define page labels to identify each page visually on the screen or in print. Page labels and page indices need not coincide: the indices are fixed, running consecutively through the document starting from 1 for the first page, but the labels can be specified in any way that is appropriate for the particular document. For example, if the document begins with 12 pages of front matter numbered in roman numerals and the remainder of the document is numbered in Arabic, the first page would have a page index of 1 and a page label of i, the twelfth page would have index 12 and label xii, and the thirteenth page would have index 13 and label 1.
For purposes of page labeling, a document can be divided into labeling ranges, each of which is a series of consecutive pages using the same numbering system. Pages within a range are numbered sequentially in ascending order. A page's label consists of a numeric portion based on its position within its labeling range, optionally preceded by a label prefix denoting the range itself. For example, the pages in an appendix might be labeled with decimal numeric portions prefixed with the string "A-" and the resulting page labels would be "A-1", "A-2",
There is no default numbering style; if no 'S' (Style) entry is present, page labels consist solely of a label prefix with no numeric portion. For example, if the 'P' entry (Prefix) specifies the label prefix "Appendix", each page is simply labeled "Appendix" with no page number. If the 'P' entry is also missing or empty, the page label is an empty string.
Create a page labeling scheme that starts with the first page in the document (page 1) and is using uppercase roman numbering style.
doc.SetPageLabel(1, PageLabel::Create(doc, PageLabel::e_roman_uppercase, "My Prefix ", 1));
Create a page labeling scheme that starts with the fourth page in the document and is using decimal arabic numbering style. Also the numeric portion of the first label should start with number 4 (otherwise the first label would be "My Prefix 1").
PageLabel L2 = PageLabel::Create(doc, PageLabel::e_decimal, "My Prefix ", 4);
doc.SetPageLabel(4, L2);
Create a page labeling scheme that starts with the seventh page in the document and is using alphabetic numbering style. The numeric portion of the first label should start with number 1.
PageLabel L3 = PageLabel::Create(doc, PageLabel::e_alphabetic_uppercase, "My Prefix ", 1);
doc.SetPageLabel(7, L3);
Read page labels from an existing PDF document.
PageLabel label = new PageLabel();
for (int i=1; i<=doc.GetPageCount(); ++i) {
label = doc.GetPageLabel(i);
if (label.IsValid()) {
string title = label.GetLabelTitle(i);
}
PageSet
PageSet is a container of page numbers ordered following a linear sequence. The page numbers are integers and must be greater than zero. Duplicates are allowed.
PathData
Contains the information required to draw the path. Contains an array of PathSegmentType Operators and corresponding path data Points. A point may be on or off (off points are control points). The meaning of a point depends on associated id (or segment type) in the path segment type array.
PatternColor
Patterns are quite general, and have many uses; for example, they can be used to create various graphical textures, such as weaves, brick walls, sunbursts, and similar geometrical and chromatic effects. Patterns are specified in a special family of color spaces named Pattern, whose 'color values' are PatternColor objects instead of the numeric component values used with other spaces. Therefore PatternColor is to pattern color space what is ColorPt to all other color spaces.
A tiling pattern consists of a small graphical figure called a pattern cell. Painting with the pattern replicates the cell at fixed horizontal and vertical intervals to fill an area. The effect is as if the figure were painted on the surface of a clear glass tile, identical copies of which were then laid down in an array covering the area and trimmed to its boundaries. This is called tiling the area.
The pattern cell can include graphical elements such as filled areas, text, and sampled images. Its shape need not be rectangular, and the spacing of tiles can differ from the dimensions of the cell itself.
The order in which individual tiles (instances of the cell) are painted is unspecified and unpredictable; it is inadvisable for the figures on adjacent tiles to overlap.
Point
The Class Point.
PrintToPdfModule
An interface into Apryse SDKs Print To PDF functionality
PrintToPdfOptions
PrinterMode
PrinterMode is a utility class used to set printer options for printing PDF documents.
QuadPoint
Rect
Rect is a utility class used to manipulate PDF rectangle objects (refer to section 3.8.3 of the PDF Reference Manual).
Rect can be associated with a SDF/Cos rectangle array using Rect(Obj*) constructor or later using Rect::Attach(Obj*) or Rect::Update(Obj*) methods.
Rect keeps a local cache for rectangle points so it is necessary to call Rect::Update() method if the changes to the Rect should be saved in the attached Cos/SDF array.
RectCollection
Redactor
PDF Redactor is a separately licensable Add-on that offers options to remove (not just covering or obscuring) content within a region of PDF. With printed pages, redaction involves blacking-out or cutting-out areas of the printed page. With electronic documents that use formats such as PDF, redaction typically involves removing sensitive content within documents for safe distribution to courts, patent and government institutions, the media, customers, vendors or any other audience with restricted access to the content.
The redaction process in PDFNet consists of two steps:
a) Content identification: A user applies redact annotations that specify the pieces or regions of content that should be removed. The content for redaction can be identified either interactively (e.g. using 'pdftron.PDF.PDFViewCtrl' as shown in PDFView sample) or programmatically (e.g. using 'pdftron.PDF.TextSearch' or 'pdftron.PDF.TextExtractor'). Up until the next step is performed, the user can see, move and redefine these annotations. b) Content removal: Using 'pdftron.PDF.Redactor.Redact()' the user instructs PDFNet to apply the redact regions, after which the content in the area specified by the redact annotations is removed. The redaction function includes number of options to control the style of the redaction overlay (including color, text, font, border, transparency, etc.).
PDFTron Redactor makes sure that if a portion of an image, text, or vector graphics is contained in a redaction region, that portion of the image or path data is destroyed and is not simply hidden with clipping or image masks. PDFNet API can also be used to review and remove metadata and other content that can exist in a PDF document, including XML Forms Architecture (XFA) content and Extensible Metadata Platform (XMP) content.
Redactor.Appearance
Class used to customize the appearance of the optional redaction overlay.
Redactor.Redaction
Reflow
Reflow annotations between PDF and HTML
RefreshOptions
SVGConvertOptions
Shading
Shading is a class that represents a flat interface around all PDF shading types:
- In Function-based (type 1) shadings, the color at every point in the domain is defined by a specified mathematical function. The function need not be smooth or continuous. This is the most general of the available shading types, and is useful for shadings that cannot be adequately described with any of the other types.
- Axial shadings (type 2) define a color blend along a line between two points, optionally extended beyond the boundary points by continuing the boundary colors.
- Radial shadings (type 3) define a color blend that varies between two circles. Shadings of this type are commonly used to depict three-dimensional spheres and cones.
- Free-form Gouraud-shaded triangle mesh shadings (type 4) and lattice gouraud shadings (type 5) are commonly used to represent complex colored and shaded three-dimensional shapes. The area to be shaded is defined by a path composed entirely of triangles. The color at each vertex of the triangles is specified, and a technique known as Gouraud interpolation is used to color the interiors. The interpolation functions defining the shading may be linear or nonlinear.
A Coons patch generally has two independent aspects:
- Colors are specified for each corner of the unit square, and bilinear interpolation is used to fill in colors over the entire unit square
- Coordinates are mapped from the unit square into a four-sided patch whose sides are not necessarily linear. The mapping is continuous: the corners of the unit square map to corners of the patch and the sides of the unit square map to sides of the patch.
- Tensor-product patch mesh shadings (type 7) are identical to type 6 (Coons mesh), except that they are based on a bicubic tensor-product patch defined by 16 control points, instead of the 12 control points that define a Coons patch. The shading Patterns dictionaries representing the two patch types differ only in the value of the Type entry and in the number of control points specified for each patch in the data stream. Although the Coons patch is more concise and easier to use, the tensor- product patch affords greater control over color mapping.
ShapedText
A sequence of positioned glyphs -- the visual representation of a given text string
Stamper
Stamper is a utility class that can be used to stamp PDF pages with text, images, or vector art (including another PDF page) in only a few lines of code.
Although Stamper is very simple to use compared to ElementBuilder/ElementWriter it is not as powerful or flexible. In case you need full control over PDF creation use ElementBuilder/ElementWriter to add new content to existing PDF pages as shown in the ElementBuilder sample project.
StructuredOutputModule
static interface to PDFTron SDKs PDF to Word, Excel, PowerPoint, HTML functionality
TemplateDocument
Encapsulates a template document that can merged with data to generate any number of PDFs.
TextDiffOptions
TextExtractor
Possible use case scenarios for TextExtractor include:
- Converting PDF pages to text or XML for content repurposing.
- Searching PDF pages for specific words or keywords.
- Indexing large PDF repositories for indexing or content.
- Classifying or summarizing PDF documents based on their text content.
- Finding specific words for content editing purposes (such as splitting pages.
- Normalize all text content to Unicode.
- Extract inferred logical structure (word by word, line by line, or paragraph by paragraph).
- Extract positioning information for every line, word, or a glyph.
- Extract style information (such as information about the font, font size, font styles, etc) for every line, word, or a glyph.
- Control the content analysis process. A number of options (such as removal of text obscured by images) is available to let the user direct the flow of content recognition algorithms that will meet their requirements.
- Offer utility methods to convert PDF page content to text, XML, or HTML.
TextExtractor is analyzing only textual content of the page. This means that the rasterized (e.g. in scanned pages) or vectorized text (where glyphs are converted to path outlines) will not be recognized as text. Please note that it is still possible to extract this content using pdftron.PDF.ElementReader interface.
In some cases TextExtractor may extract text that does not appear to be on the visible page (e.g. when text is obscured by an image or a rectangle). In these situations it is possible to use processing flags such as 'e_remove_hidden_text' and 'e_no_invisible_text' to remove hidden text.
//... Initialize PDFNet ...
PDFDoc doc = new PDFDoc(filein);
doc.initSecurityHandler();
Page page = doc.pageBegin().current();
TextExtractor txt = new TextExtractor();
txt.begin(page, 0, TextExtractor.ProcessingFlags.e_remove_hidden_text);
string text = txt.getAsText();
// or traverse words one by one...
TextExtractor.Word word;
for (TextExtractor.Line line = txt.GetFirstLine(); line.IsValid(); line=line.GetNextLine()) {
for (word=line.GetFirstWord(); word.IsValid(); word=word.GetNextWord()) {
string w = word.GetString();
}
}
TextExtractor.Line
TextExtractor.Line object represents a line of text on a PDF page. Each line consists of a sequence of words, and each words in one or more styles.
TextExtractor.Style
A class representing predominant text style associated with a given Line, a Word, or a Glyph. The class includes information about the font, font size, font styles, text color, etc.
TextExtractor.Word
TextExtractor.Word object represents a word on a PDF page. Each word contains a sequence of characters in one or more styles (see TextExtractor.Style).
TextRange
The TextRange
class represents a contiguous range of text on a PDF page.
It may be the result of a text search, or simply a couple of highlighted or
underlined words.
Each text range contains a few pieces of information:
page: the number of the page this piece of text is on; position: the start position (text offset); length: the length.
You are able to retrieve further information about the text range, such as its coordinates, the text itself, as well as characters before and after.
TextSearch
TextSearch searches through a PDF document for a user-given search pattern. The current implementation supports both verbatim search and the search using regular expressions, whose detailed syntax can be found at:
http://www.boost.org/doc/libs/release/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
TextSearch also provides users with several useful search modes and extra
information besides the found string that matches the pattern. TextSearch
can either keep running until a matched string is found or be set to return
periodically in order for the caller to perform any necessary updates
(e.g., UI updates). It is also worth mentioning that the search modes can be
changed on the fly while searching through a document.
Possible use case scenarios for TextSearch include:
<ul><li>Guide users of a PDF viewer (e.g. implemented by PDFViewCtrl) to places
where they are intersted in;</li><li>Find interested PDF documents which contain certain patterns;</li><li>Extract interested information (e.g., credit card numbers) from a set of files;</li><li>Extract Highlight information (refer to the Highlights class for details) from
files for external use.</li><li>Since hyphens ('-') are frequently used in PDF documents to concatenate the two
broken pieces of a word at the end of a line, for example
<code>
"TextSearch is powerful for finding patterns in PDF files; yes, it is really pow-
erful."
</code>
a search for "powerful" should return both instances. However, not all end-of-line
hyphens are hyphens added to connect a broken word; some of them could be "real"
hyphens. In addition, an input search pattern may also contain hyphens that complicate
the situation. To tackle this problem, the following conventions are adopted:
<ol><li>When in the verbatim search mode and the pattern contains no hyphen, a matching
string is returned if it is exactly the same or it contains end-of-line
or start-of-line hyphens. For example, as mentioned above, a search for "powerful"
would return both instances.</li><li>When in verbatim search mode and the pattern contains one or multiple hyphens, a
matching string is returned only if the string matches the pattern exactly. For
example, a search for "pow-erful" will only return the second instance, and a search
for "power-ful" will return nothing.</li><li>When searching using regular expressions, hyphens are not taken care implicitly.
Users should take care of it themselves. For example, in order to find both the
"powerful" instances, the input pattern can be "pow-{0,1}erful".</li></ol>
</li></ul>
<example>
For a full sample, please take a look at the TextSearch sample project.
<pre><code class="lang-csharp">//... Initialize PDFNet ...
PDFDoc doc = new PDFDoc(filein);
doc.initSecurityHandler();
int mode = TextSearch.e_whole_word | TextSearch.e_page_stop;
UString pattern( "joHn sMiTh" );
TextSearch txt_search = new TextSearch();
//PDFDoc doesn't allow simultaneous access from different threads. If this
//document could be used from other threads (e.g., the rendering thread inside
//PDFView/PDFViewCtrl, if used), it is good practice to lock it.
//Notice: don't forget to call doc.Unlock() to avoid deadlock.
doc.Lock();
txt_search.Begin( doc, pattern, mode, -1, -1 );
while ( true )
{
TextSearchResult result = txt_search.Run();
if ( result.getCode() == TextSearchResult.e_TextSearch_found )
{
System.out.println("found one instance: " + result.getResultStr());
}
}
else
{
break;
}
//unlock the document to avoid deadlock.
doc.UnLock();</code></pre>
</example>
TimestampingConfiguration
A class representing a set of options for timestamping a document.
TimestampingResult
A class representing the result of testing a timestamping configuration.
TrustVerificationResult
The detailed result of a trust verification step of a verification operation performed on a digital signature.
VerificationOptions
Options pertaining to digital signature verification.
VerificationResult
The result of a verification operation performed on a digital signature.
ViewChangeCollection
Class for collecting changes to a PDFDoc and/or viewer, which can be passed to various functions to act on. Allows for chaining of modifications, which can then be updated by PDFNet in the best possible way.
ViewerOptimizedOptions
A class containing ViewerOptimizedOptions
WebFontDownloader
static interface to control the behaviour of PDFNet web font downloading
WordToPDFOptions
Structs
TextExtractor.CharRange
TextExtractor.CharRange object represents a range of text based on Unicode character indices.
Enums
Action.FormActionFlag
Flags used by submit form actions. Exclude flag is also used by reset form action. No other action types use flags in the current version of PDF standard (ISO 2300).
Action.Type
Action types
Annot.AnnotationState
annotation appearances types
Annot.BorderStyle.Style
The border style
Annot.Flag
Flags specifying various characteristics of the annotation.
Annot.Type
Annotation types
BarcodeOptions.BarcodeOrientation
A set of flags used to specify the barcode orientation(s). Can be bitwise OR-ed to search for multiple orientations. Orientation only affects the following barcode types: e_linear, e_post_net_planet, e_four_state, e_gs1_databar_stacked, e_pdf417, e_micro_pdf417, e_patch_code and e_pharma_code.
BarcodeOptions.BarcodeProfile
An enumeration used to specify the barcode detection profile.
BarcodeOptions.BarcodeTypeGroup
A set of flags used to specify a subset of barcode types. Can be bitwise OR-ed to combine multiple groups.
BarcodeOptions.OutputFormat
An enumeration used to specify the format of the data output.
CADConvertOptions.LayoutSortOrder
Layout sorting options
ColorSpace.Type
Convert.ExcelOutputOptions.SearchableImageSetting
Convert.FlattenFlag
Convert.FlattenThresholdFlag
Convert.HTMLOutputOptions.ContentReflowSetting
Convert.HTMLOutputOptions.SearchableImageSetting
Convert.OutputOptionsOCR.LanguageChoice
Convert.OutputOptionsOCR.PreferredOCREngine
Convert.PowerPointOutputOptions.SearchableImageSetting
Convert.Printer.Mode
Convert.StructuredOutputOptions.SectionConversionSetting
Convert.WordOutputOptions.SearchableImageSetting
Convert.WordOutputOptions.WordOutputFormat
Convert.XODOutputOptions.AnnotationOutputFlag
DataExtractionModule.DataExtractionEngine
Data Extraction Engines
Destination.FitType
DigitalSignatureField.DocumentPermissions
DigitalSignatureField.FieldPermissions
DigitalSignatureField.SubFilterType
DisallowedChange.Type
DocumentConversionResult
Element.Type
Element
types
ElementWriter.WriteMode
Enumeration describing the placement of the element written to a page.
Field.EventType
Event types for field.
Field.Flag
Flags specifying various characteristics of the fields.
Field.TextJustification
form of quadding (justification) to be used in displaying the text fields.
Field.Type
interactive form field type
Flattener.FlattenMode
Flattener.Threshold
Font.Encoding
Font.StandardType1Font
Font.Type
Font types
Function.Type
functions types
GState.BlendMode
The standard separable blend modes available in PDF.
GState.GStateAttribute
GState properties
GState.LineCap
LineCap types
GState.LineJoin
LineJoin types
GState.RenderingIntent
GState.TextRenderingMode
Text Rendering modes
GeometryCollectionSnappingMode
HTML2PDF.Proxy.Type
HTML2PDF.WebPageSettings.ErrorHandling
How to handle objects that failed to load.
Image.InputFilter
InputFilter types
OfficeToPDFOptions.DisplayComments
Word document comment options
OfficeToPDFOptions.StructureTagLevel
Level of detail for structure tags.
Optimizer.ImageSettings.CompressionMode
Different Compression Modes for color and grayscale images.
Optimizer.ImageSettings.DownsampleMode
Different Downsample Modes for color and grayscale images.
Optimizer.MonoImageSettings.CompressionMode
mono-image compression mode
Optimizer.MonoImageSettings.DownsampleMode
mono-image downsample mode
PDFDoc.ExtractFlag
PDFDoc.FlattenAnnotationFlag
Flatten selected items in the document.
PDFDoc.InsertFlag
PDFDoc.SignaturesVerificationStatus
PDFDocViewPrefs.PageLayout
PageLayout specifies the page layout to be used when the document is opened
PDFDocViewPrefs.PageMode
PageMode specifies how the document should be displayed when opened
PDFDocViewPrefs.ViewerPref
ViewerPref enumeration specifies how various GUI elements should behave when the document is opened.
PDFDraw.PixelFormat
PDFNetInternalToolsLogBackend
PDFNetInternalToolsLogLevel
PDFRasterizer.ColorPostProcessMode
ColorPostProcessMode is used to modify colors after rendering.
PDFRasterizer.OverprintPreviewMode
Determines if overprint is used.
PDFRasterizer.Type
PDFNet includes two separate rasterizer implementations utilizing different graphics libraries. The default rasterizer is 'e_BuiltIn' which is a high-quality, anti-aliased and platform independent rasterizer. This rasterizer is available on all supported platforms. On Windows platforms, PDFNet also includes GDI+ based rasterizer. This rasterizer is included mainly to provide vector output for printing, for EMF/WMF export, etc. For plain image rasterization we recommend using the built-in rasterizer.
Page.Box
PDF page can define as many as five separate boundaries to control various aspects of the imaging process (for more details please refer to Section 10.10.1 'Page Boundaries' in PDF Reference Manual).
Page.Rotate
specify page rotations in degrees
PageLabel.Style
The numbering style to be used for the numeric portion of page label.
PageSet.Filter
PageSet filters
PathData.PathSegmentType
Enumaration used to indicate operator type.
PatternColor.TilingType
PatternColor.Type
PrinterMode.DuplexMode
Enumerated values for specifying how the printed pages are flipped when duplexing
PrinterMode.NUp
Enumerated values for specifying the layout of multiple document pages onto output pages
PrinterMode.NUpPageOrder
Enumerated values for specifying the ordering of document pages onto output pages
PrinterMode.Orientation
Enumerated values for specifying the orientation of output pages
PrinterMode.OutputColor
Enumerated values for specifying the color mode for printing
PrinterMode.OutputQuality
Enumerated values for specifying the quality of the printing
PrinterMode.PaperSize
Paper sizes.
PrinterMode.PrintContentTypes
Enumerated values for specifying the document content to print
PrinterMode.ScaleType
Enumerated values for specifying the scaling of document pages
Shading.Type
ShapedText.FailureReason
ShapedText.ShapingStatus
Stamper.HorizontalAlignment
Stamper.SizeType
Size Types
Stamper.TextAlignment
Stamper.VerticalAlignment
TemplateDocumentResult
TextExtractor.ProcessingFlags
Processing options that can be passed in Begin() method to direct the flow of content recognition algorithms.
TextExtractor.XMLOutputFlags
Flags controlling the structure of XML output in a call to GetAsXML().
TextSearch.ResultCode
The code indicating the reason when a search returns.
TextSearch.SearchMode
Search modes that control how searching is conducted.
VerificationOptions.CertificateTrustFlag
An enumeration representing the level of trust associated with a particular certificate. Multiple flag values can be combined using bitwise operators.
VerificationOptions.SignatureVerificationSecurityLevel
An enumeration representing the level of security to use when verifying digital signatures.
VerificationOptions.TimeMode
An enumeration representing the least-secure type of reference-time to use when verifying digital signatures. One can choose the time of signing (not very secure), timestamp time (more secure), current time (most secure, lower verification rate). Note: this is orthogonal to the expiry verification mode (shell/chain/hybrid).