Opait PDF Library
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
Opait.Pdf.Api.PdfOptions Class Reference

Defines various PDF options. More...

Public Member Functions

 PdfOptions ()
 Initializes a new instance of the PdfOptions class with default settings.
 
void Reset (bool full=true)
 Resets all options to their default values. More...
 
XElement ToXml ()
 Saves the current instance of PdfOptions as an XML element. More...
 

Static Public Member Functions

static PdfOptions FromXml (XElement xml)
 Initializes a new instance of the PdfOptions class from a previously serialized XML element. More...
 

Static Public Attributes

static int DefaultFileVersion = 17
 Default PDF file version when new documents are generated.
 
static int DefaultMonochromeDpi = 300
 Default resolution for monochrome images.
 
static int DefaultGrayscaleDpi = 150
 Default resolution for grayscale images.
 
static int DefaultColorDpi = 72
 Default resolution for full-color images.
 
static int DefaultJpegQuality = 75
 Default JPEG compression quality.
 
static int MinimumThreshold = 40
 Minimum allowed fixed binarization threshold.
 
static int DefaultThreshold = 180
 Default fixed binarization threshold.
 
static int MaximumThreshold = 210
 Maximum allowed fixed binarization threshold.
 
static int DefaultPageTreeNodes = 10
 Default PDF page tree node size.
 

Properties

string FileName [get, set]
 Gets or sets the path to the target file.
 
string PageRange [get, set]
 Gets or sets the ranges of page numbers to save, or null to save all pages in the source document.
 
PdfSaveFormat SaveFormat [get, set]
 Gets or sets the format for saving PDF files.
 
bool Flatten [get, set]
 Gets or sets a value to indicate whether forms should be flatten when the document is saved or printed.
 
bool Encrypt [get, set]
 Gets or sets a flag to indicate Whether PDF file is encrypted.
 
bool EncryptMetaData [get, set]
 Gets or sets a flag to indicate whether metadata is also encrypted.
 
string UserPassword [get, set]
 Gets or sets the password used to open the PDF file.
 
string OwnerPassword [get, set]
 Gest or sets the password used to alter the PDF security.
 
string RedactPassword [get, set]
 Gest or sets the password used to encrypt embedded redaction data.
 
bool PreventPrint [get, set]
 Gets or sets a flag to prevent printing of protected PDF file.
 
bool PreventCopy [get, set]
 Gets or sets a flag to prevent copying of protected PDF file.
 
bool PreventModify [get, set]
 Gets or sets a flag to prevent modifying of protected PDF file.
 
int FileVersion [get, set]
 Gets or sets the default PDF file version for new documents.
 
bool SaveAsPdfA [get, set]
 Gets or sets a flag to save PDF documents in PDF/A-1b specification. Certain restrictions will apply to such files. For example, PDF/A files may not be encrypted or linearized.
 
bool FastWebAccess [get, set]
 If enabled, PDF files will be linearized to make them load faster on the WEB. This was more important in the past when Internet bandwidth was limited. Cannot be used with PDF/A files.
 
bool CompressContent [get, set]
 Gets or sets a flag to compress PDF page content stream. Page content streams are normally compressed using flate algorithm. You may want to disable the compression for debugging purposes.
 
bool FullPageOcr [get, set]
 If set, then PDF pages will be fully rasterized and any existing text object will be lost. If not set, then only qualified image objects will be processed through OCR and the data will be merged with the page. The existing attributes will remain. Default is false.
 
PdfPixelFormat PixelFormat [get, set]
 Gets or sets the pixel color depth when rasterizing PDF pages.
 
int Resolution [get, set]
 Gets or sets the desired resolution of the raster images. If set to zero, a default resolution is used based on the color depth.
 
BinarizationMethod BinarizationMethod [get, set]
 Gets or sets the binarization method when grayscale images are converted to black-and-white.
 
int Threshold [get, set]
 Gets or sets a color value in the range [0,255] below which a pixel is assumed black when converting to monochrome using the threshold method.
 
int JpegQuality [get, set]
 Gets or sets the default quality when saving in JPEG format.
 
string FontFamily [get, set]
 Gets or sets the font family to use if text is visible.
 
bool EmbedFont [get, set]
 Gets or sets a flag to indicate whether to embed the font descriptor in the generated PDF file.
 
PdfPageSize DefaultPageSize [get, set]
 Defines the default page size when new pages are created.
 
int PageTreeNodeSize [get, set]
 The maximum number of entries in the page tree nodes.
 
bool SaveStandardWidths [get, set]
 Saving font descriptors and character widths are optional for the standard built-in fonts. This option controls whether font descriptors and character widths will be saved when using built-in fonts.
 
bool MinimizeSize [get, set]
 Whether to minimize sizes of PDF files. Interpretation is application dependent.
 

Detailed Description

Defines various PDF options.

Member Function Documentation

◆ FromXml()

static PdfOptions Opait.Pdf.Api.PdfOptions.FromXml ( XElement  xml)
static

Initializes a new instance of the PdfOptions class from a previously serialized XML element.

Parameters
xmlThe parent of the serialized XML element.

◆ Reset()

void Opait.Pdf.Api.PdfOptions.Reset ( bool  full = true)

Resets all options to their default values.

Parameters
fullIf 'true' then also reset save and OCR options.

◆ ToXml()

XElement Opait.Pdf.Api.PdfOptions.ToXml ( )

Saves the current instance of PdfOptions as an XML element.

Returns
The XML element representing the current instance.