HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.PdfWriter Class Reference
Inheritance diagram for iTextSharp.text.pdf.PdfWriter:
iTextSharp.text.pdf.interfaces.IPdfAnnotations iTextSharp.text.pdf.interfaces.IPdfRunDirection iTextSharp.text.pdf.interfaces.IPdfXConformance iTextSharp.text.pdf.interfaces.IPdfPageActions iTextSharp.text.pdf.interfaces.IPdfDocumentActions iTextSharp.text.pdf.interfaces.IPdfVersion iTextSharp.text.pdf.interfaces.IPdfEncryptionSettings iTextSharp.text.pdf.interfaces.IPdfViewerPreferences iTextSharp.text.DocWriter iTextSharp.text.pdf.PdfCopy iTextSharp.text.pdf.PdfStamperImp iTextSharp.text.pdf.PdfSmartCopy

Classes

class  PdfBody
 
class  PdfTrailer
 

Public Member Functions

float GetVerticalPosition (bool ensureNewLine)
 
PdfIndirectObject AddToBody (PdfObject objecta)
 
PdfIndirectObject AddToBody (PdfObject objecta, bool inObjStm)
 
PdfIndirectObject AddToBody (PdfObject objecta, PdfIndirectReference refa)
 
PdfIndirectObject AddToBody (PdfObject objecta, PdfIndirectReference refa, bool inObjStm)
 
PdfIndirectObject AddToBody (PdfObject objecta, int refNumber)
 
PdfIndirectObject AddToBody (PdfObject objecta, int refNumber, bool inObjStm)
 
void SetLinearPageMode ()
 
int ReorderPages (int[] order)
 
virtual PdfIndirectReference GetPageReference (int page)
 
override void Open ()
 
override void Close ()
 
void SetAtLeastPdfVersion (char version)
 
void SetPdfVersion (PdfName version)
 
void AddDeveloperExtension (PdfDeveloperExtension de)
 
virtual void AddViewerPreference (PdfName key, PdfObject value)
 
virtual void AddJavaScript (PdfAction js)
 
virtual void AddJavaScript (String code, bool unicode)
 
virtual void AddJavaScript (String code)
 
void AddJavaScript (String name, PdfAction js)
 
void AddJavaScript (String name, String code, bool unicode)
 
void AddJavaScript (String name, String code)
 
virtual void AddFileAttachment (String description, byte[] fileStore, String file, String fileDisplay)
 
virtual void AddFileAttachment (String description, PdfFileSpecification fs)
 
void AddFileAttachment (PdfFileSpecification fs)
 
virtual void SetOpenAction (String name)
 
virtual void SetOpenAction (PdfAction action)
 
virtual void SetAdditionalAction (PdfName actionType, PdfAction action)
 
virtual void AddAnnotation (PdfAnnotation annot)
 
virtual void AddCalculationOrder (PdfFormField annot)
 
void CreateXmpMetadata ()
 
bool IsPdfX ()
 
void SetOutputIntents (String outputConditionIdentifier, String outputCondition, String registryName, String info, ICC_Profile colorProfile)
 
void SetOutputIntents (String outputConditionIdentifier, String outputCondition, String registryName, String info, byte[] destOutputProfile)
 
bool SetOutputIntents (PdfReader reader, bool checkExistence)
 
void SetEncryption (byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionType)
 
void SetEncryption (X509Certificate[] certs, int[] permissions, int encryptionType)
 
void SetEncryption (byte[] userPassword, byte[] ownerPassword, int permissions, bool strength128Bits)
 
void SetEncryption (bool strength, String userPassword, String ownerPassword, int permissions)
 
void SetEncryption (int encryptionType, String userPassword, String ownerPassword, int permissions)
 
void SetFullCompression ()
 
void ReleaseTemplate (PdfTemplate tp)
 
virtual PdfImportedPage GetImportedPage (PdfReader reader, int pageNumber)
 
virtual void FreeReader (PdfReader reader)
 
void SetTagged ()
 
bool IsTagged ()
 
void AddOCGRadioGroup (ArrayList group)
 
void LockLayer (PdfLayer layer)
 
void SetBoxSize (String boxName, Rectangle size)
 
Rectangle GetBoxSize (String boxName)
 
virtual void SetPageAction (PdfName actionType, PdfAction action)
 
void SetDefaultColorspace (PdfName key, PdfObject cs)
 
void ClearTextWrap ()
 
PdfName AddDirectImageSimple (Image image)
 
PdfName AddDirectImageSimple (Image image, PdfIndirectReference fixedRef)
 
bool FitsPage (Table table, float margin)
 
bool FitsPage (Table table)
 
virtual void ResetPageDictEntries ()
 
virtual void AddPageDictEntry (PdfName key, PdfObject obj)
 
virtual PdfAnnotation CreateAnnotation (Rectangle rect, PdfName subtype)
 
- Public Member Functions inherited from iTextSharp.text.DocWriter
virtual bool Add (IElement element)
 Signals that an Element was added to the Document. More...
 
virtual bool SetPageSize (Rectangle pageSize)
 Sets the pagesize. More...
 
virtual bool SetMargins (float marginLeft, float marginRight, float marginTop, float marginBottom)
 Sets the margins. More...
 
virtual bool NewPage ()
 Signals that an new page has to be started. More...
 
virtual void ResetHeader ()
 Resets the header of this document. More...
 
virtual void ResetFooter ()
 Resets the footer of this document. More...
 
virtual void ResetPageCount ()
 Sets the page number to 0. More...
 
virtual void Pause ()
 Let the writer know that all writing has to be paused. More...
 
bool IsPaused ()
 
virtual void Resume ()
 Let the writer know that writing may be resumed. More...
 
virtual void Flush ()
 Flushes the Stream. More...
 
virtual bool SetMarginMirroring (bool marginMirroring)
 
virtual bool SetMarginMirroringTopBottom (bool MarginMirroring)
 

Static Public Member Functions

static PdfWriter GetInstance (Document document, Stream os)
 
static PdfWriter GetInstance (Document document, Stream os, IDocListener listener)
 
- Static Public Member Functions inherited from iTextSharp.text.DocWriter
static byte[] GetISOBytes (string text)
 Converts a string into a Byte array according to the ISO-8859-1 codepage. More...
 

Static Public Attributes

const int GENERATION_MAX = 65535
 
const char VERSION_1_2 = '2'
 
const char VERSION_1_3 = '3'
 
const char VERSION_1_4 = '4'
 
const char VERSION_1_5 = '5'
 
const char VERSION_1_6 = '6'
 
const char VERSION_1_7 = '7'
 
static readonly PdfName PDF_VERSION_1_2 = new PdfName("1.2")
 
static readonly PdfName PDF_VERSION_1_3 = new PdfName("1.3")
 
static readonly PdfName PDF_VERSION_1_4 = new PdfName("1.4")
 
static readonly PdfName PDF_VERSION_1_5 = new PdfName("1.5")
 
static readonly PdfName PDF_VERSION_1_6 = new PdfName("1.6")
 
static readonly PdfName PDF_VERSION_1_7 = new PdfName("1.7")
 
const int PageLayoutSinglePage = 1
 
const int PageLayoutOneColumn = 2
 
const int PageLayoutTwoColumnLeft = 4
 
const int PageLayoutTwoColumnRight = 8
 
const int PageLayoutTwoPageLeft = 16
 
const int PageLayoutTwoPageRight = 32
 
const int PageModeUseNone = 64
 
const int PageModeUseOutlines = 128
 
const int PageModeUseThumbs = 256
 
const int PageModeFullScreen = 512
 
const int PageModeUseOC = 1024
 
const int PageModeUseAttachments = 2048
 
const int HideToolbar = 1 << 12
 
const int HideMenubar = 1 << 13
 
const int HideWindowUI = 1 << 14
 
const int FitWindow = 1 << 15
 
const int CenterWindow = 1 << 16
 
const int DisplayDocTitle = 1 << 17
 
const int NonFullScreenPageModeUseNone = 1 << 18
 
const int NonFullScreenPageModeUseOutlines = 1 << 19
 
const int NonFullScreenPageModeUseThumbs = 1 << 20
 
const int NonFullScreenPageModeUseOC = 1 << 21
 
const int DirectionL2R = 1 << 22
 
const int DirectionR2L = 1 << 23
 
const int PrintScalingNone = 1 << 24
 
static PdfName DOCUMENT_CLOSE = PdfName.WC
 
static PdfName WILL_SAVE = PdfName.WS
 
static PdfName DID_SAVE = PdfName.DS
 
static PdfName WILL_PRINT = PdfName.WP
 
static PdfName DID_PRINT = PdfName.DP
 
const int SIGNATURE_EXISTS = 1
 
const int SIGNATURE_APPEND_ONLY = 2
 
const int PDFXNONE = 0
 
const int PDFX1A2001 = 1
 
const int PDFX32002 = 2
 
const int PDFA1A = 3
 
const int PDFA1B = 4
 
const int STANDARD_ENCRYPTION_40 = 0
 
const int STANDARD_ENCRYPTION_128 = 1
 
const int ENCRYPTION_AES_128 = 2
 
const int DO_NOT_ENCRYPT_METADATA = 8
 
const int EMBEDDED_FILES_ONLY = 24
 
const int ALLOW_PRINTING = 4 + 2048
 
const int ALLOW_MODIFY_CONTENTS = 8
 
const int ALLOW_COPY = 16
 
const int ALLOW_MODIFY_ANNOTATIONS = 32
 
const int ALLOW_FILL_IN = 256
 
const int ALLOW_SCREENREADERS = 512
 
const int ALLOW_ASSEMBLY = 1024
 
const int ALLOW_DEGRADED_PRINTING = 4
 
const int AllowPrinting = ALLOW_PRINTING
 
const int AllowModifyContents = ALLOW_MODIFY_CONTENTS
 
const int AllowCopy = ALLOW_COPY
 
const int AllowModifyAnnotations = ALLOW_MODIFY_ANNOTATIONS
 
const int AllowFillIn = ALLOW_FILL_IN
 
const int AllowScreenReaders = ALLOW_SCREENREADERS
 
const int AllowAssembly = ALLOW_ASSEMBLY
 
const int AllowDegradedPrinting = ALLOW_DEGRADED_PRINTING
 
const bool STRENGTH40BITS = false
 
const bool STRENGTH128BITS = true
 
static readonly PdfName PAGE_OPEN = PdfName.O
 
static readonly PdfName PAGE_CLOSE = PdfName.C
 
const float SPACE_CHAR_RATIO_DEFAULT = 2.5f
 
const float NO_SPACE_CHAR_RATIO = 10000000f
 
const int RUN_DIRECTION_DEFAULT = 0
 
const int RUN_DIRECTION_NO_BIDI = 1
 
const int RUN_DIRECTION_LTR = 2
 
const int RUN_DIRECTION_RTL = 3
 
- Static Public Attributes inherited from iTextSharp.text.DocWriter
const byte NEWLINE = (byte)'\n'
 This is some byte that is often used. More...
 
const byte TAB = (byte)'\t'
 This is some byte that is often used. More...
 
const byte LT = (byte)'<'
 This is some byte that is often used. More...
 
const byte SPACE = (byte)' '
 This is some byte that is often used. More...
 
const byte EQUALS = (byte)'='
 This is some byte that is often used. More...
 
const byte QUOTE = (byte)'\"'
 This is some byte that is often used. More...
 
const byte GT = (byte)'>'
 This is some byte that is often used. More...
 
const byte FORWARD = (byte)'/'
 This is some byte that is often used. More...
 

Protected Member Functions

 PdfWriter ()
 
 PdfWriter (PdfDocument document, Stream os)
 
virtual PdfDictionary GetCatalog (PdfIndirectReference rootObj)
 
void AddSharedObjectsToBody ()
 
void FillOCProperties (bool erase)
 
virtual PdfIndirectReference Add (PdfICCBased icc)
 
- Protected Member Functions inherited from iTextSharp.text.DocWriter
 DocWriter ()
 
 DocWriter (Document document, Stream os)
 Constructs a DocWriter. More...
 
void Write (string str)
 Writes a string to the stream. More...
 
void AddTabs (int indent)
 Writes a number of tabs. More...
 
void Write (string key, string value)
 Writes a key-value pair to the stream. More...
 
void WriteStart (string tag)
 Writes a starttag to the stream. More...
 
void WriteEnd (string tag)
 Writes an endtag to the stream. More...
 
void WriteEnd ()
 Writes an endtag to the stream. More...
 
bool WriteMarkupAttributes (Properties markup)
 Writes the markup attributes of the specified MarkupAttributes object to the stream. More...
 

Protected Attributes

PdfContentByte directContent
 
PdfContentByte directContentUnder
 
PdfPages root
 
ArrayList pageReferences = new ArrayList()
 
int currentPageNumber = 1
 
PdfName tabs = null
 
int prevxref = 0
 
ArrayList newBookmarks
 
PdfVersionImp pdf_version = new PdfVersionImp()
 
byte[] xmpMetadata = null
 
PdfEncryption crypto
 
bool fullCompression = false
 
Hashtable documentFonts = new Hashtable()
 
int fontNumber = 1
 
Hashtable formXObjects = new Hashtable()
 
int formXObjectsCounter = 1
 
Hashtable importedPages = new Hashtable()
 
PdfReaderInstance currentPdfReaderInstance
 
Hashtable documentColors = new Hashtable()
 
int colorNumber = 1
 
Hashtable documentPatterns = new Hashtable()
 
int patternNumber = 1
 
Hashtable documentShadingPatterns = new Hashtable()
 
Hashtable documentShadings = new Hashtable()
 
Hashtable documentExtGState = new Hashtable()
 
Hashtable documentProperties = new Hashtable()
 
bool tagged = false
 
PdfStructureTreeRoot structureTreeRoot
 
Hashtable documentOCG = new Hashtable()
 
ArrayList documentOCGorder = new ArrayList()
 
PdfOCProperties vOCProperties
 
PdfArray OCGRadioGroup = new PdfArray()
 
PdfArray OCGLocked = new PdfArray()
 
PdfDictionary group
 
int runDirection = RUN_DIRECTION_NO_BIDI
 
float userunit = 0f
 
PdfDictionary defaultColorspace = new PdfDictionary()
 
Hashtable documentSpotPatterns = new Hashtable()
 
ColorDetails patternColorspaceRGB
 
ColorDetails patternColorspaceGRAY
 
ColorDetails patternColorspaceCMYK
 
PdfDictionary imageDictionary = new PdfDictionary()
 
Hashtable JBIG2Globals = new Hashtable()
 
PdfDictionary pageDictEntries = new PdfDictionary()
 
- Protected Attributes inherited from iTextSharp.text.DocWriter
Rectangle pageSize
 The pageSize. More...
 
Document document
 This is the document that has to be written. More...
 
OutputStreamCounter os
 The stream of this writer. More...
 
bool open = false
 Is the writer open for writing? More...
 
bool pause = false
 Do we have to pause all writing actions? More...
 
bool closeStream = true
 

Properties

PdfDictionary Info [get]
 
virtual PdfContentByte DirectContent [get]
 
virtual PdfContentByte DirectContentUnder [get]
 
PdfIndirectReference PdfIndirectReference [get]
 
PdfDictionary ExtraCatalog [get]
 
int PageNumber [get]
 
virtual int CurrentPageNumber [get]
 
PdfName Tabs [get, set]
 
IPdfPageEvent PageEvent [get, set]
 
PdfOutline RootOutline [get]
 
ArrayList Outlines [set]
 
virtual char PdfVersion [set]
 
virtual int ViewerPreferences [set]
 
virtual PdfPageLabels PageLabels [set]
 
PdfCollection Collection [set]
 
PdfAcroForm AcroForm [get]
 
virtual int SigFlags [set]
 
byte[] XmpMetadata [get, set]
 
byte[] PageXmpMetadata [set]
 
int PDFXConformance [get, set]
 
bool FullCompression [get]
 
int CompressionLevel [get, set]
 
int CurrentDocumentSize [get]
 
PdfStructureTreeRoot StructureTreeRoot [get]
 
PdfOCProperties OCProperties [get]
 
Rectangle PageSize [get]
 
virtual Rectangle CropBoxSize [set]
 
bool PageEmpty [set]
 
virtual int Duration [set]
 
virtual PdfTransition Transition [set]
 
virtual Image Thumbnail [set]
 
PdfDictionary Group [get, set]
 
virtual float SpaceCharRatio [get, set]
 
virtual int RunDirection [get, set]
 
float Userunit [get, set]
 
PdfDictionary DefaultColorspace [get]
 
bool StrictImageSequence [get, set]
 
bool UserProperties [get, set]
 
bool RgbTransparencyBlending [get, set]
 
virtual PdfDictionary PageDictEntries [get]
 
- Properties inherited from iTextSharp.text.DocWriter
virtual HeaderFooter Header [set]
 Changes the header of this document. More...
 
virtual HeaderFooter Footer [set]
 Changes the footer of this document. More...
 
virtual int PageCount [set]
 Sets the page number. More...
 
virtual bool CloseStream [get, set]
 
- Properties inherited from iTextSharp.text.IDocListener
int PageCount [set]
 Sets the page number. More...
 
HeaderFooter Header [set]
 Changes the header of this document. More...
 
HeaderFooter Footer [set]
 Changes the footer of this document. More...
 
- Properties inherited from iTextSharp.text.pdf.interfaces.IPdfViewerPreferences
int ViewerPreferences [set]
 
- Properties inherited from iTextSharp.text.pdf.interfaces.IPdfVersion
char PdfVersion [set]
 
- Properties inherited from iTextSharp.text.pdf.interfaces.IPdfPageActions
int Duration [set]
 
PdfTransition Transition [set]
 
- Properties inherited from iTextSharp.text.pdf.interfaces.IPdfXConformance
int PDFXConformance [get, set]
 
- Properties inherited from iTextSharp.text.pdf.interfaces.IPdfRunDirection
int RunDirection [get, set]
 
- Properties inherited from iTextSharp.text.pdf.interfaces.IPdfAnnotations
PdfAcroForm AcroForm [get]
 
int SigFlags [set]
 

Detailed Description

A DocWriter class for PDF.

When this PdfWriter is added to a certain PdfDocument, the PDF representation of every Element added to this Document will be written to the outputstream.

Constructor & Destructor Documentation

◆ PdfWriter() [1/2]

iTextSharp.text.pdf.PdfWriter.PdfWriter ( )
protected

Constructs a PdfWriter.

◆ PdfWriter() [2/2]

iTextSharp.text.pdf.PdfWriter.PdfWriter ( PdfDocument  document,
Stream  os 
)
protected

Constructs a PdfWriter.

Remark: a PdfWriter can only be constructed by calling the method getInstance(Document document, Stream os).

Parameters
documentThe PdfDocument that has to be written
osThe Stream the writer has to write to.

Member Function Documentation

◆ Add()

virtual PdfIndirectReference iTextSharp.text.pdf.PdfWriter.Add ( PdfICCBased  icc)
protectedvirtual

◆ AddAnnotation()

virtual void iTextSharp.text.pdf.PdfWriter.AddAnnotation ( PdfAnnotation  annot)
virtual

Adds a PdfAnnotation or a PdfFormField to the document. Only the top parent of a PdfFormField needs to be added.

Parameters
annotthe PdfAnnotation or the PdfFormField to add

Implements iTextSharp.text.pdf.interfaces.IPdfAnnotations.

Reimplemented in iTextSharp.text.pdf.PdfStamperImp, and iTextSharp.text.pdf.PdfCopy.

◆ AddCalculationOrder()

virtual void iTextSharp.text.pdf.PdfWriter.AddCalculationOrder ( PdfFormField  annot)
virtual

Adds the PdfAnnotation to the calculation order array.

Parameters
annotthe PdfAnnotation to be added

Implements iTextSharp.text.pdf.interfaces.IPdfAnnotations.

◆ AddDeveloperExtension()

void iTextSharp.text.pdf.PdfWriter.AddDeveloperExtension ( PdfDeveloperExtension  de)
See also
com.lowagie.text.pdf.interfaces.PdfVersion::addDeveloperExtension(com.lowagie.text.pdf.PdfDeveloperExtension)
Since
2.1.6

Implements iTextSharp.text.pdf.interfaces.IPdfVersion.

◆ AddDirectImageSimple() [1/2]

PdfName iTextSharp.text.pdf.PdfWriter.AddDirectImageSimple ( Image  image)

Adds an image to the document but not to the page resources. It is used with templates and Document.Add(Image).

Parameters
imagethe Image to add
Returns
the name of the image added
Exceptions
PdfExceptionon error
DocumentExceptionon error

◆ AddDirectImageSimple() [2/2]

PdfName iTextSharp.text.pdf.PdfWriter.AddDirectImageSimple ( Image  image,
PdfIndirectReference  fixedRef 
)

Adds an image to the document but not to the page resources. It is used with templates and Document.Add(Image).

Parameters
imagethe Image to add
fixedRefthe reference to used. It may be null, a PdfIndirectReference or a PRIndirectReference.
Returns
the name of the image added
Exceptions
PdfExceptionon error
DocumentExceptionon error

◆ AddFileAttachment() [1/3]

void iTextSharp.text.pdf.PdfWriter.AddFileAttachment ( PdfFileSpecification  fs)

Adds a file attachment at the document level.

Parameters
fsthe file specification

◆ AddFileAttachment() [2/3]

virtual void iTextSharp.text.pdf.PdfWriter.AddFileAttachment ( String  description,
byte[]  fileStore,
String  file,
String  fileDisplay 
)
virtual

Adds a file attachment at the document level.

Parameters
descriptionthe file description
fileStorean array with the file. If it's null the file will be read from the disk
filethe path to the file. It will only be used if fileStore is not null
fileDisplaythe actual file name stored in the pdf
Exceptions
IOExceptionon error

◆ AddFileAttachment() [3/3]

virtual void iTextSharp.text.pdf.PdfWriter.AddFileAttachment ( String  description,
PdfFileSpecification  fs 
)
virtual

Adds a file attachment at the document level.

Parameters
descriptionthe file description
fsthe file specification

◆ AddJavaScript() [1/6]

virtual void iTextSharp.text.pdf.PdfWriter.AddJavaScript ( PdfAction  js)
virtual

Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.

Parameters
jsThe JavaScript action

◆ AddJavaScript() [2/6]

virtual void iTextSharp.text.pdf.PdfWriter.AddJavaScript ( String  code)
virtual

Adds a JavaScript action at the document level. When the document opens all this JavaScript runs.

Parameters
codethe JavaScript code

◆ AddJavaScript() [3/6]

virtual void iTextSharp.text.pdf.PdfWriter.AddJavaScript ( String  code,
bool  unicode 
)
virtual

Adds a JavaScript action at the document level. When the document opens all this JavaScript runs.

Parameters
codethe JavaScript code
unicodeselect JavaScript unicode. Note that the internal Acrobat JavaScript engine does not support unicode, so this may or may not work for you

◆ AddJavaScript() [4/6]

void iTextSharp.text.pdf.PdfWriter.AddJavaScript ( String  name,
PdfAction  js 
)

Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.

Parameters
nameThe name of the JS Action in the name tree
jsThe JavaScript action

◆ AddJavaScript() [5/6]

void iTextSharp.text.pdf.PdfWriter.AddJavaScript ( String  name,
String  code 
)

Use this method to adds a JavaScript action at the document level. When the document opens, all this JavaScript runs.

Parameters
nameThe name of the JS Action in the name tree
codethe JavaScript code

◆ AddJavaScript() [6/6]

void iTextSharp.text.pdf.PdfWriter.AddJavaScript ( String  name,
String  code,
bool  unicode 
)

Use this method to add a JavaScript action at the document level. When the document opens, all this JavaScript runs.

Parameters
nameThe name of the JS Action in the name tree
codethe JavaScript code
unicodeselect JavaScript unicode. Note that the internal Acrobat JavaScript engine does not support unicode, so this may or may not work for you

◆ AddOCGRadioGroup()

void iTextSharp.text.pdf.PdfWriter.AddOCGRadioGroup ( ArrayList  group)

Sets a collection of optional content groups whose states are intended to follow a "radio button" paradigm. That is, the state of at most one optional content group in the array should be ON at a time: if one group is turned ON, all others must be turned OFF.

Parameters
groupthe radio group

◆ AddPageDictEntry()

virtual void iTextSharp.text.pdf.PdfWriter.AddPageDictEntry ( PdfName  key,
PdfObject  obj 
)
virtual

◆ AddSharedObjectsToBody()

void iTextSharp.text.pdf.PdfWriter.AddSharedObjectsToBody ( )
protected

◆ AddToBody() [1/6]

PdfIndirectObject iTextSharp.text.pdf.PdfWriter.AddToBody ( PdfObject  objecta)

Adds an object to the PDF body.

Parameters
object
Returns
a PdfIndirectObject
Exceptions
IOException

◆ AddToBody() [2/6]

PdfIndirectObject iTextSharp.text.pdf.PdfWriter.AddToBody ( PdfObject  objecta,
bool  inObjStm 
)

Adds an object to the PDF body.

Parameters
object
inObjStm
Returns
a PdfIndirectObject
Exceptions
IOException

◆ AddToBody() [3/6]

PdfIndirectObject iTextSharp.text.pdf.PdfWriter.AddToBody ( PdfObject  objecta,
int  refNumber 
)

Adds an object to the PDF body.

Parameters
object
refNumber
Returns
a PdfIndirectObject
Exceptions
IOException

◆ AddToBody() [4/6]

PdfIndirectObject iTextSharp.text.pdf.PdfWriter.AddToBody ( PdfObject  objecta,
int  refNumber,
bool  inObjStm 
)

Adds an object to the PDF body.

Parameters
object
refNumber
inObjStm
Returns
a PdfIndirectObject
Exceptions
IOException

◆ AddToBody() [5/6]

PdfIndirectObject iTextSharp.text.pdf.PdfWriter.AddToBody ( PdfObject  objecta,
PdfIndirectReference  refa 
)

Adds an object to the PDF body.

Parameters
object
ref
Returns
a PdfIndirectObject
Exceptions
IOException

◆ AddToBody() [6/6]

PdfIndirectObject iTextSharp.text.pdf.PdfWriter.AddToBody ( PdfObject  objecta,
PdfIndirectReference  refa,
bool  inObjStm 
)

Adds an object to the PDF body.

Parameters
object
ref
inObjStm
Returns
a PdfIndirectObject
Exceptions
IOException

◆ AddViewerPreference()

virtual void iTextSharp.text.pdf.PdfWriter.AddViewerPreference ( PdfName  key,
PdfObject  value 
)
virtual

Adds a viewer preference

Parameters
preferencesthe viewer preferences
See also
PdfViewerPreferences::addViewerPreference

Implements iTextSharp.text.pdf.interfaces.IPdfViewerPreferences.

Reimplemented in iTextSharp.text.pdf.PdfStamperImp.

◆ ClearTextWrap()

void iTextSharp.text.pdf.PdfWriter.ClearTextWrap ( )

Clears text wrapping around images (if applicable). Method suggested by Pelikan Stephan

Exceptions
DocumentException

◆ Close()

override void iTextSharp.text.pdf.PdfWriter.Close ( )
virtual

Signals that the Document was closed and that no other Elements will be added.

The pages-tree is built and written to the outputstream. A Catalog is constructed, as well as an Info-object, the referencetable is composed and everything is written to the outputstream embedded in a Trailer.

Reimplemented from iTextSharp.text.DocWriter.

◆ CreateAnnotation()

virtual PdfAnnotation iTextSharp.text.pdf.PdfWriter.CreateAnnotation ( Rectangle  rect,
PdfName  subtype 
)
virtual

◆ CreateXmpMetadata()

void iTextSharp.text.pdf.PdfWriter.CreateXmpMetadata ( )

Creates XMP Metadata based on the metadata in the PdfDocument.

◆ FillOCProperties()

void iTextSharp.text.pdf.PdfWriter.FillOCProperties ( bool  erase)
protected

◆ FitsPage() [1/2]

bool iTextSharp.text.pdf.PdfWriter.FitsPage ( Table  table)

Checks if a Table fits the current page of the PdfDocument.

Parameters
tablethe table that has to be checked
Returns
true if the Table fits the page, false otherwise.

◆ FitsPage() [2/2]

bool iTextSharp.text.pdf.PdfWriter.FitsPage ( Table  table,
float  margin 
)

Checks if a Table fits the current page of the PdfDocument.

Parameters
tablethe table that has to be checked
margina certain margin
Returns
true if the Table fits the page, false otherwise.

◆ FreeReader()

virtual void iTextSharp.text.pdf.PdfWriter.FreeReader ( PdfReader  reader)
virtual

Writes the reader to the document and frees the memory used by it. The main use is when concatenating multiple documents to keep the memory usage restricted to the current appending document.

Parameters
readerthe PdfReader to free
Exceptions
IOExceptionon error

Reimplemented in iTextSharp.text.pdf.PdfCopy.

◆ GetBoxSize()

Rectangle iTextSharp.text.pdf.PdfWriter.GetBoxSize ( String  boxName)

Gives the size of a trim, art, crop or bleed box, or null if not defined.

Parameters
boxNamecrop, trim, art or bleed

◆ GetCatalog()

virtual PdfDictionary iTextSharp.text.pdf.PdfWriter.GetCatalog ( PdfIndirectReference  rootObj)
protectedvirtual

Reimplemented in iTextSharp.text.pdf.PdfCopy.

◆ GetImportedPage()

virtual PdfImportedPage iTextSharp.text.pdf.PdfWriter.GetImportedPage ( PdfReader  reader,
int  pageNumber 
)
virtual

Gets a page from other PDF document. The page can be used as any other PdfTemplate. Note that calling this method more than once with the same parameters will retrieve the same object.

Parameters
readerthe PDF document where the page is
pageNumberthe page number. The first page is 1
Returns
the template representing the imported page

Reimplemented in iTextSharp.text.pdf.PdfCopy.

◆ GetInstance() [1/2]

static PdfWriter iTextSharp.text.pdf.PdfWriter.GetInstance ( Document  document,
Stream  os 
)
static

Use this method to get an instance of the PdfWriter.

Parameters
documentThe Document that has to be written
osThe Stream the writer has to write to.
Returns
a new PdfWriter
Exceptions
DocumentExceptionon error

◆ GetInstance() [2/2]

static PdfWriter iTextSharp.text.pdf.PdfWriter.GetInstance ( Document  document,
Stream  os,
IDocListener  listener 
)
static

Use this method to get an instance of the PdfWriter.

Returns
a new PdfWriter
Parameters
documentThe Document that has to be written
osThe Stream the writer has to write to.
listenerA DocListener to pass to the PdfDocument.
Exceptions
DocumentExceptionon error

◆ GetPageReference()

virtual PdfIndirectReference iTextSharp.text.pdf.PdfWriter.GetPageReference ( int  page)
virtual

Use this method to get a reference to a page existing or not. If the page does not exist yet the reference will be created in advance. If on closing the document, a page number greater than the total number of pages was requested, an exception is thrown.

Parameters
pagethe page number. The first page is 1
Returns
the reference to the page

Reimplemented in iTextSharp.text.pdf.PdfStamperImp.

◆ GetVerticalPosition()

float iTextSharp.text.pdf.PdfWriter.GetVerticalPosition ( bool  ensureNewLine)

Use this method to get the current vertical page position.

Parameters
ensureNewLineTells whether a new line shall be enforced. This may cause side effects for elements that do not terminate the lines they've started because those lines will get terminated.
Returns
The current vertical page position.

◆ IsPdfX()

bool iTextSharp.text.pdf.PdfWriter.IsPdfX ( )
See also
com.lowagie.text.pdf.interfaces.PdfXConformance::isPdfX()

Implements iTextSharp.text.pdf.interfaces.IPdfXConformance.

◆ IsTagged()

bool iTextSharp.text.pdf.PdfWriter.IsTagged ( )

Check if the document is marked for tagging.

Returns
true if the document is marked for tagging

◆ LockLayer()

void iTextSharp.text.pdf.PdfWriter.LockLayer ( PdfLayer  layer)

Use this method to lock an optional content group. The state of a locked group cannot be changed through the user interface of a viewer application. Producers can use this entry to prevent the visibility of content that depends on these groups from being changed by users.

Parameters
layerthe layer that needs to be added to the array of locked OCGs
Since
2.1.2

◆ Open()

override void iTextSharp.text.pdf.PdfWriter.Open ( )
virtual

Signals that the Document has been opened and that Elements can be added.

When this method is called, the PDF-document header is written to the outputstream.

Reimplemented from iTextSharp.text.DocWriter.

◆ ReleaseTemplate()

void iTextSharp.text.pdf.PdfWriter.ReleaseTemplate ( PdfTemplate  tp)

Releases the memory used by a template by writing it to the output. The template can still be added to any content but changes to the template itself won't have any effect.

Parameters
tpthe template to release
Exceptions
IOExceptionon error

◆ ReorderPages()

int iTextSharp.text.pdf.PdfWriter.ReorderPages ( int[]  order)

Use this method to reorder the pages in the document. A null argument value only returns the number of pages to process. It is advisable to issue a Document.newPage() before using this method.

Returns
the total number of pages
Parameters
orderan array with the new page sequence. It must have the same size as the number of pages.
Exceptions
DocumentExceptionif all the pages are not present in the array

◆ ResetPageDictEntries()

virtual void iTextSharp.text.pdf.PdfWriter.ResetPageDictEntries ( )
virtual

◆ SetAdditionalAction()

virtual void iTextSharp.text.pdf.PdfWriter.SetAdditionalAction ( PdfName  actionType,
PdfAction  action 
)
virtual

Additional-actions defining the actions to be taken in response to various trigger events affecting the document as a whole. The actions types allowed are: DOCUMENT_CLOSE, WILL_SAVE, DID_SAVE, WILL_PRINT and DID_PRINT.

Parameters
actionTypethe action type
actionthe action to execute in response to the trigger
Exceptions
PdfExceptionon invalid action type

Implements iTextSharp.text.pdf.interfaces.IPdfDocumentActions.

Reimplemented in iTextSharp.text.pdf.PdfStamperImp.

◆ SetAtLeastPdfVersion()

void iTextSharp.text.pdf.PdfWriter.SetAtLeastPdfVersion ( char  version)
See also
com.lowagie.text.pdf.interfaces.PdfVersion::setAtLeastPdfVersion(char)

Implements iTextSharp.text.pdf.interfaces.IPdfVersion.

◆ SetBoxSize()

void iTextSharp.text.pdf.PdfWriter.SetBoxSize ( String  boxName,
Rectangle  size 
)

Sets the page box sizes. Allowed names are: "crop", "trim", "art" and "bleed".

Parameters
boxNamethe box size
sizethe size

◆ SetDefaultColorspace()

void iTextSharp.text.pdf.PdfWriter.SetDefaultColorspace ( PdfName  key,
PdfObject  cs 
)

Sets the default colorspace that will be applied to all the document. The colorspace is only applied if another colorspace with the same name is not present in the content.

The colorspace is applied immediately when creating templates and at the page end for the main document content.

Parameters
keythe name of the colorspace. It can be PdfName.DEFAULTGRAY, PdfName.DEFAULTRGB or PdfName.DEFAULTCMYK
csthe colorspace. A null or PdfNull removes any colorspace with the same name

◆ SetEncryption() [1/5]

void iTextSharp.text.pdf.PdfWriter.SetEncryption ( bool  strength,
String  userPassword,
String  ownerPassword,
int  permissions 
)

Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.

Parameters
strengthtrue for 128 bit key length, false for 40 bit key length
userPasswordthe user password. Can be null or empty
ownerPasswordthe owner password. Can be null or empty
permissionsthe user permissions
Exceptions
DocumentExceptionif the document is already open

◆ SetEncryption() [2/5]

void iTextSharp.text.pdf.PdfWriter.SetEncryption ( byte[]  userPassword,
byte[]  ownerPassword,
int  permissions,
bool  strength128Bits 
)

Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.

Parameters
userPasswordthe user password. Can be null or empty
ownerPasswordthe owner password. Can be null or empty
permissionsthe user permissions
strength128Bitstrue for 128 bit key length, false for 40 bit key length
Exceptions
DocumentExceptionif the document is already open

◆ SetEncryption() [3/5]

void iTextSharp.text.pdf.PdfWriter.SetEncryption ( byte[]  userPassword,
byte[]  ownerPassword,
int  permissions,
int  encryptionType 
)

Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.

Parameters
userPasswordthe user password. Can be null or empty
ownerPasswordthe owner password. Can be null or empty
permissionsthe user permissions
encryptionTypethe type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
Exceptions
DocumentExceptionif the document is already open

Implements iTextSharp.text.pdf.interfaces.IPdfEncryptionSettings.

◆ SetEncryption() [4/5]

void iTextSharp.text.pdf.PdfWriter.SetEncryption ( int  encryptionType,
String  userPassword,
String  ownerPassword,
int  permissions 
)

Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.

Parameters
encryptionTypethe type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
userPasswordthe user password. Can be null or empty
ownerPasswordthe owner password. Can be null or empty
permissionsthe user permissions
Exceptions
DocumentExceptionif the document is already open

◆ SetEncryption() [5/5]

void iTextSharp.text.pdf.PdfWriter.SetEncryption ( X509Certificate[]  certs,
int[]  permissions,
int  encryptionType 
)

Sets the certificate encryption options for this document. An array of one or more public certificates must be provided together with an array of the same size for the permissions for each certificate. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them. Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext

Parameters
certsthe public certificates to be used for the encryption
permissionsthe user permissions for each of the certicates
encryptionTypethe type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128.
Exceptions
DocumentExceptionif the document is already open

Implements iTextSharp.text.pdf.interfaces.IPdfEncryptionSettings.

◆ SetFullCompression()

void iTextSharp.text.pdf.PdfWriter.SetFullCompression ( )

Sets the document's compression to the new 1.5 mode with object streams and xref streams. It can be set at any time but once set it can't be unset.

If set before opening the document it will also set the pdf version to 1.5.

◆ SetLinearPageMode()

void iTextSharp.text.pdf.PdfWriter.SetLinearPageMode ( )

Use this method to make sure the page tree has a lineair structure (every leave is attached directly to the root). Use this method to allow page reordering with method reorderPages.

◆ SetOpenAction() [1/2]

virtual void iTextSharp.text.pdf.PdfWriter.SetOpenAction ( PdfAction  action)
virtual

When the document opens this action will be invoked.

Parameters
actionthe action to be invoked

Implements iTextSharp.text.pdf.interfaces.IPdfDocumentActions.

Reimplemented in iTextSharp.text.pdf.PdfStamperImp.

◆ SetOpenAction() [2/2]

virtual void iTextSharp.text.pdf.PdfWriter.SetOpenAction ( String  name)
virtual

When the document opens it will jump to the destination with this name.

Parameters
namethe name of the destination to jump to

Implements iTextSharp.text.pdf.interfaces.IPdfDocumentActions.

Reimplemented in iTextSharp.text.pdf.PdfStamperImp.

◆ SetOutputIntents() [1/3]

bool iTextSharp.text.pdf.PdfWriter.SetOutputIntents ( PdfReader  reader,
bool  checkExistence 
)

Copies the output intent dictionary from other document to this one.

Parameters
readerthe other document
checkExistencetrue to just check for the existence of a valid output intent dictionary, false to insert the dictionary if it exists
Exceptions
IOExceptionon error
Returns
true if the output intent dictionary exists, false otherwise

◆ SetOutputIntents() [2/3]

void iTextSharp.text.pdf.PdfWriter.SetOutputIntents ( String  outputConditionIdentifier,
String  outputCondition,
String  registryName,
String  info,
byte[]  destOutputProfile 
)

Sets the values of the output intent dictionary. Null values are allowed to suppress any key.

Prefer the ICC_Profile-based version of this method.

Parameters
outputConditionIdentifiera value
outputConditiona value, "PDFA/A" to force GTS_PDFA1, otherwise cued by pdfxConformance.
registryNamea value
infoa value
destOutputProfilea value
Since
1.x
Exceptions
IOException

◆ SetOutputIntents() [3/3]

void iTextSharp.text.pdf.PdfWriter.SetOutputIntents ( String  outputConditionIdentifier,
String  outputCondition,
String  registryName,
String  info,
ICC_Profile  colorProfile 
)

Sets the values of the output intent dictionary. Null values are allowed to suppress any key.

Parameters
outputConditionIdentifiera value
outputConditiona value
registryNamea value
infoa value
destOutputProfilea value
Exceptions
IOExceptionon error

◆ SetPageAction()

virtual void iTextSharp.text.pdf.PdfWriter.SetPageAction ( PdfName  actionType,
PdfAction  action 
)
virtual

Sets the open and close page additional action.

Parameters
actionTypethe action type. It can be PdfWriter.PAGE_OPEN or PdfWriter.PAGE_CLOSE
actionthe action to perform
Exceptions
PdfExceptionif the action type is invalid

Implements iTextSharp.text.pdf.interfaces.IPdfPageActions.

Reimplemented in iTextSharp.text.pdf.PdfStamperImp.

◆ SetPdfVersion()

void iTextSharp.text.pdf.PdfWriter.SetPdfVersion ( PdfName  version)
See also
com.lowagie.text.pdf.interfaces.PdfVersion::setPdfVersion(com.lowagie.text.pdf.PdfName)

Implements iTextSharp.text.pdf.interfaces.IPdfVersion.

◆ SetTagged()

void iTextSharp.text.pdf.PdfWriter.SetTagged ( )

Mark this document for tagging. It must be called before open.

Member Data Documentation

◆ ALLOW_ASSEMBLY

const int iTextSharp.text.pdf.PdfWriter.ALLOW_ASSEMBLY = 1024
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ ALLOW_COPY

const int iTextSharp.text.pdf.PdfWriter.ALLOW_COPY = 16
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ ALLOW_DEGRADED_PRINTING

const int iTextSharp.text.pdf.PdfWriter.ALLOW_DEGRADED_PRINTING = 4
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ ALLOW_FILL_IN

const int iTextSharp.text.pdf.PdfWriter.ALLOW_FILL_IN = 256
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ ALLOW_MODIFY_ANNOTATIONS

const int iTextSharp.text.pdf.PdfWriter.ALLOW_MODIFY_ANNOTATIONS = 32
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ ALLOW_MODIFY_CONTENTS

const int iTextSharp.text.pdf.PdfWriter.ALLOW_MODIFY_CONTENTS = 8
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ ALLOW_PRINTING

const int iTextSharp.text.pdf.PdfWriter.ALLOW_PRINTING = 4 + 2048
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ ALLOW_SCREENREADERS

const int iTextSharp.text.pdf.PdfWriter.ALLOW_SCREENREADERS = 512
static

The operation permitted when the document is opened with the user password

Since
2.0.7

◆ AllowAssembly

const int iTextSharp.text.pdf.PdfWriter.AllowAssembly = ALLOW_ASSEMBLY
static
Deprecated:
As of iText 2.0.7, use ALLOW_ASSEMBLY instead. Scheduled for removal at or after 2.2.0

◆ AllowCopy

const int iTextSharp.text.pdf.PdfWriter.AllowCopy = ALLOW_COPY
static
Deprecated:
As of iText 2.0.7, use ALLOW_COPY instead. Scheduled for removal at or after 2.2.0

◆ AllowDegradedPrinting

const int iTextSharp.text.pdf.PdfWriter.AllowDegradedPrinting = ALLOW_DEGRADED_PRINTING
static
Deprecated:
As of iText 2.0.7, use ALLOW_DEGRADED_PRINTING instead. Scheduled for removal at or after 2.2.0

◆ AllowFillIn

const int iTextSharp.text.pdf.PdfWriter.AllowFillIn = ALLOW_FILL_IN
static
Deprecated:
As of iText 2.0.7, use ALLOW_FILL_IN instead. Scheduled for removal at or after 2.2.0

◆ AllowModifyAnnotations

const int iTextSharp.text.pdf.PdfWriter.AllowModifyAnnotations = ALLOW_MODIFY_ANNOTATIONS
static
Deprecated:
As of iText 2.0.7, use ALLOW_MODIFY_ANNOTATIONS instead. Scheduled for removal at or after 2.2.0

◆ AllowModifyContents

const int iTextSharp.text.pdf.PdfWriter.AllowModifyContents = ALLOW_MODIFY_CONTENTS
static
Deprecated:
As of iText 2.0.7, use ALLOW_MODIFY_CONTENTS instead. Scheduled for removal at or after 2.2.0

◆ AllowPrinting

const int iTextSharp.text.pdf.PdfWriter.AllowPrinting = ALLOW_PRINTING
static
Deprecated:
As of iText 2.0.7, use ALLOW_PRINTING instead. Scheduled for removal at or after 2.2.0

◆ AllowScreenReaders

const int iTextSharp.text.pdf.PdfWriter.AllowScreenReaders = ALLOW_SCREENREADERS
static
Deprecated:
As of iText 2.0.7, use ALLOW_SCREENREADERS instead. Scheduled for removal at or after 2.2.0

◆ CenterWindow

const int iTextSharp.text.pdf.PdfWriter.CenterWindow = 1 << 16
static

A viewer preference

◆ colorNumber

int iTextSharp.text.pdf.PdfWriter.colorNumber = 1
protected

The color number counter for the colors in the document.

◆ crypto

PdfEncryption iTextSharp.text.pdf.PdfWriter.crypto
protected

Contains the business logic for cryptography.

◆ currentPageNumber

int iTextSharp.text.pdf.PdfWriter.currentPageNumber = 1
protected

The current page number.

◆ currentPdfReaderInstance

PdfReaderInstance iTextSharp.text.pdf.PdfWriter.currentPdfReaderInstance
protected

◆ defaultColorspace

PdfDictionary iTextSharp.text.pdf.PdfWriter.defaultColorspace = new PdfDictionary()
protected

◆ DID_PRINT

PdfName iTextSharp.text.pdf.PdfWriter.DID_PRINT = PdfName.DP
static

action value

◆ DID_SAVE

PdfName iTextSharp.text.pdf.PdfWriter.DID_SAVE = PdfName.DS
static

action value

◆ directContent

PdfContentByte iTextSharp.text.pdf.PdfWriter.directContent
protected

The direct content in this document.

◆ directContentUnder

PdfContentByte iTextSharp.text.pdf.PdfWriter.directContentUnder
protected

The direct content under in this document.

◆ DirectionL2R

const int iTextSharp.text.pdf.PdfWriter.DirectionL2R = 1 << 22
static

A viewer preference

◆ DirectionR2L

const int iTextSharp.text.pdf.PdfWriter.DirectionR2L = 1 << 23
static

A viewer preference

◆ DisplayDocTitle

const int iTextSharp.text.pdf.PdfWriter.DisplayDocTitle = 1 << 17
static

A viewer preference

◆ DO_NOT_ENCRYPT_METADATA

const int iTextSharp.text.pdf.PdfWriter.DO_NOT_ENCRYPT_METADATA = 8
static

Add this to the mode to keep the metadata in clear text

◆ DOCUMENT_CLOSE

PdfName iTextSharp.text.pdf.PdfWriter.DOCUMENT_CLOSE = PdfName.WC
static

action value

◆ documentColors

Hashtable iTextSharp.text.pdf.PdfWriter.documentColors = new Hashtable()
protected

The colors of this document

◆ documentExtGState

Hashtable iTextSharp.text.pdf.PdfWriter.documentExtGState = new Hashtable()
protected

◆ documentFonts

Hashtable iTextSharp.text.pdf.PdfWriter.documentFonts = new Hashtable()
protected

The fonts of this document

◆ documentOCG

Hashtable iTextSharp.text.pdf.PdfWriter.documentOCG = new Hashtable()
protected

◆ documentOCGorder

ArrayList iTextSharp.text.pdf.PdfWriter.documentOCGorder = new ArrayList()
protected

◆ documentPatterns

Hashtable iTextSharp.text.pdf.PdfWriter.documentPatterns = new Hashtable()
protected

The patterns of this document

◆ documentProperties

Hashtable iTextSharp.text.pdf.PdfWriter.documentProperties = new Hashtable()
protected

◆ documentShadingPatterns

Hashtable iTextSharp.text.pdf.PdfWriter.documentShadingPatterns = new Hashtable()
protected

◆ documentShadings

Hashtable iTextSharp.text.pdf.PdfWriter.documentShadings = new Hashtable()
protected

◆ documentSpotPatterns

Hashtable iTextSharp.text.pdf.PdfWriter.documentSpotPatterns = new Hashtable()
protected

◆ EMBEDDED_FILES_ONLY

const int iTextSharp.text.pdf.PdfWriter.EMBEDDED_FILES_ONLY = 24
static

Add this to the mode to keep encrypt only the embedded files.

Since
2.1.3

◆ ENCRYPTION_AES_128

const int iTextSharp.text.pdf.PdfWriter.ENCRYPTION_AES_128 = 2
static

Type of encryption

◆ FitWindow

const int iTextSharp.text.pdf.PdfWriter.FitWindow = 1 << 15
static

A viewer preference

◆ fontNumber

int iTextSharp.text.pdf.PdfWriter.fontNumber = 1
protected

The font number counter for the fonts in the document.

◆ formXObjects

Hashtable iTextSharp.text.pdf.PdfWriter.formXObjects = new Hashtable()
protected

The form XObjects in this document. The key is the xref and the value is Object[]{PdfName, template}.

◆ formXObjectsCounter

int iTextSharp.text.pdf.PdfWriter.formXObjectsCounter = 1
protected

The name counter for the form XObjects name.

◆ fullCompression

bool iTextSharp.text.pdf.PdfWriter.fullCompression = false
protected

Holds value of property fullCompression.

◆ GENERATION_MAX

const int iTextSharp.text.pdf.PdfWriter.GENERATION_MAX = 65535
static

The highest generation number possible.

Since
iText 2.1.6

◆ group

PdfDictionary iTextSharp.text.pdf.PdfWriter.group
protected

A group attributes dictionary specifying the attributes of the page’s page group for use in the transparent imaging model

◆ HideMenubar

const int iTextSharp.text.pdf.PdfWriter.HideMenubar = 1 << 13
static

A viewer preference

◆ HideToolbar

const int iTextSharp.text.pdf.PdfWriter.HideToolbar = 1 << 12
static

A viewer preference

◆ HideWindowUI

const int iTextSharp.text.pdf.PdfWriter.HideWindowUI = 1 << 14
static

A viewer preference

◆ imageDictionary

PdfDictionary iTextSharp.text.pdf.PdfWriter.imageDictionary = new PdfDictionary()
protected

Dictionary, containing all the images of the PDF document

◆ importedPages

Hashtable iTextSharp.text.pdf.PdfWriter.importedPages = new Hashtable()
protected

◆ JBIG2Globals

Hashtable iTextSharp.text.pdf.PdfWriter.JBIG2Globals = new Hashtable()
protected

A Hashtable with Stream objects containing JBIG2 Globals

Since
2.1.5

◆ newBookmarks

ArrayList iTextSharp.text.pdf.PdfWriter.newBookmarks
protected

◆ NO_SPACE_CHAR_RATIO

const float iTextSharp.text.pdf.PdfWriter.NO_SPACE_CHAR_RATIO = 10000000f
static

Disable the inter-character spacing.

◆ NonFullScreenPageModeUseNone

const int iTextSharp.text.pdf.PdfWriter.NonFullScreenPageModeUseNone = 1 << 18
static

A viewer preference

◆ NonFullScreenPageModeUseOC

const int iTextSharp.text.pdf.PdfWriter.NonFullScreenPageModeUseOC = 1 << 21
static

A viewer preference

◆ NonFullScreenPageModeUseOutlines

const int iTextSharp.text.pdf.PdfWriter.NonFullScreenPageModeUseOutlines = 1 << 19
static

A viewer preference

◆ NonFullScreenPageModeUseThumbs

const int iTextSharp.text.pdf.PdfWriter.NonFullScreenPageModeUseThumbs = 1 << 20
static

A viewer preference

◆ OCGLocked

PdfArray iTextSharp.text.pdf.PdfWriter.OCGLocked = new PdfArray()
protected

◆ OCGRadioGroup

PdfArray iTextSharp.text.pdf.PdfWriter.OCGRadioGroup = new PdfArray()
protected

◆ PAGE_CLOSE

readonly PdfName iTextSharp.text.pdf.PdfWriter.PAGE_CLOSE = PdfName.C
static

action value

◆ PAGE_OPEN

readonly PdfName iTextSharp.text.pdf.PdfWriter.PAGE_OPEN = PdfName.O
static

action value

◆ pageDictEntries

PdfDictionary iTextSharp.text.pdf.PdfWriter.pageDictEntries = new PdfDictionary()
protected

◆ PageLayoutOneColumn

const int iTextSharp.text.pdf.PdfWriter.PageLayoutOneColumn = 2
static

A viewer preference

◆ PageLayoutSinglePage

const int iTextSharp.text.pdf.PdfWriter.PageLayoutSinglePage = 1
static

A viewer preference

◆ PageLayoutTwoColumnLeft

const int iTextSharp.text.pdf.PdfWriter.PageLayoutTwoColumnLeft = 4
static

A viewer preference

◆ PageLayoutTwoColumnRight

const int iTextSharp.text.pdf.PdfWriter.PageLayoutTwoColumnRight = 8
static

A viewer preference

◆ PageLayoutTwoPageLeft

const int iTextSharp.text.pdf.PdfWriter.PageLayoutTwoPageLeft = 16
static

A viewer preference

◆ PageLayoutTwoPageRight

const int iTextSharp.text.pdf.PdfWriter.PageLayoutTwoPageRight = 32
static

A viewer preference

◆ PageModeFullScreen

const int iTextSharp.text.pdf.PdfWriter.PageModeFullScreen = 512
static

A viewer preference

◆ PageModeUseAttachments

const int iTextSharp.text.pdf.PdfWriter.PageModeUseAttachments = 2048
static

A viewer preference

◆ PageModeUseNone

const int iTextSharp.text.pdf.PdfWriter.PageModeUseNone = 64
static

A viewer preference

◆ PageModeUseOC

const int iTextSharp.text.pdf.PdfWriter.PageModeUseOC = 1024
static

A viewer preference

◆ PageModeUseOutlines

const int iTextSharp.text.pdf.PdfWriter.PageModeUseOutlines = 128
static

A viewer preference

◆ PageModeUseThumbs

const int iTextSharp.text.pdf.PdfWriter.PageModeUseThumbs = 256
static

A viewer preference

◆ pageReferences

ArrayList iTextSharp.text.pdf.PdfWriter.pageReferences = new ArrayList()
protected

The PdfIndirectReference to the pages.

◆ patternColorspaceCMYK

ColorDetails iTextSharp.text.pdf.PdfWriter.patternColorspaceCMYK
protected

◆ patternColorspaceGRAY

ColorDetails iTextSharp.text.pdf.PdfWriter.patternColorspaceGRAY
protected

◆ patternColorspaceRGB

ColorDetails iTextSharp.text.pdf.PdfWriter.patternColorspaceRGB
protected

◆ patternNumber

int iTextSharp.text.pdf.PdfWriter.patternNumber = 1
protected

The patten number counter for the colors in the document.

◆ pdf_version

PdfVersionImp iTextSharp.text.pdf.PdfWriter.pdf_version = new PdfVersionImp()
protected

Stores the version information for the header and the catalog.

◆ PDF_VERSION_1_2

readonly PdfName iTextSharp.text.pdf.PdfWriter.PDF_VERSION_1_2 = new PdfName("1.2")
static

possible PDF version (catalog)

◆ PDF_VERSION_1_3

readonly PdfName iTextSharp.text.pdf.PdfWriter.PDF_VERSION_1_3 = new PdfName("1.3")
static

possible PDF version (catalog)

◆ PDF_VERSION_1_4

readonly PdfName iTextSharp.text.pdf.PdfWriter.PDF_VERSION_1_4 = new PdfName("1.4")
static

possible PDF version (catalog)

◆ PDF_VERSION_1_5

readonly PdfName iTextSharp.text.pdf.PdfWriter.PDF_VERSION_1_5 = new PdfName("1.5")
static

possible PDF version (catalog)

◆ PDF_VERSION_1_6

readonly PdfName iTextSharp.text.pdf.PdfWriter.PDF_VERSION_1_6 = new PdfName("1.6")
static

possible PDF version (catalog)

◆ PDF_VERSION_1_7

readonly PdfName iTextSharp.text.pdf.PdfWriter.PDF_VERSION_1_7 = new PdfName("1.7")
static

possible PDF version (catalog)

◆ PDFA1A

const int iTextSharp.text.pdf.PdfWriter.PDFA1A = 3
static

PDFA-1A level.

◆ PDFA1B

const int iTextSharp.text.pdf.PdfWriter.PDFA1B = 4
static

PDFA-1B level.

◆ PDFX1A2001

const int iTextSharp.text.pdf.PdfWriter.PDFX1A2001 = 1
static

PDF/X level

◆ PDFX32002

const int iTextSharp.text.pdf.PdfWriter.PDFX32002 = 2
static

PDF/X level

◆ PDFXNONE

const int iTextSharp.text.pdf.PdfWriter.PDFXNONE = 0
static

PDF/X level

◆ prevxref

int iTextSharp.text.pdf.PdfWriter.prevxref = 0
protected

A number refering to the previous Cross-Reference Table.

◆ PrintScalingNone

const int iTextSharp.text.pdf.PdfWriter.PrintScalingNone = 1 << 24
static

A viewer preference

◆ root

PdfPages iTextSharp.text.pdf.PdfWriter.root
protected

The root of the page tree.

◆ RUN_DIRECTION_DEFAULT

const int iTextSharp.text.pdf.PdfWriter.RUN_DIRECTION_DEFAULT = 0
static

Use the default run direction.

◆ RUN_DIRECTION_LTR

const int iTextSharp.text.pdf.PdfWriter.RUN_DIRECTION_LTR = 2
static

Use bidirectional reordering with left-to-right preferential run direction.

◆ RUN_DIRECTION_NO_BIDI

const int iTextSharp.text.pdf.PdfWriter.RUN_DIRECTION_NO_BIDI = 1
static

Do not use bidirectional reordering.

◆ RUN_DIRECTION_RTL

const int iTextSharp.text.pdf.PdfWriter.RUN_DIRECTION_RTL = 3
static

Use bidirectional reordering with right-to-left preferential run direction.

◆ runDirection

int iTextSharp.text.pdf.PdfWriter.runDirection = RUN_DIRECTION_NO_BIDI
protected

◆ SIGNATURE_APPEND_ONLY

const int iTextSharp.text.pdf.PdfWriter.SIGNATURE_APPEND_ONLY = 2
static

signature value

◆ SIGNATURE_EXISTS

const int iTextSharp.text.pdf.PdfWriter.SIGNATURE_EXISTS = 1
static

signature value

◆ SPACE_CHAR_RATIO_DEFAULT

const float iTextSharp.text.pdf.PdfWriter.SPACE_CHAR_RATIO_DEFAULT = 2.5f
static

The default space-char ratio.

◆ STANDARD_ENCRYPTION_128

const int iTextSharp.text.pdf.PdfWriter.STANDARD_ENCRYPTION_128 = 1
static

Type of encryption

◆ STANDARD_ENCRYPTION_40

const int iTextSharp.text.pdf.PdfWriter.STANDARD_ENCRYPTION_40 = 0
static

Type of encryption

◆ STRENGTH128BITS

const bool iTextSharp.text.pdf.PdfWriter.STRENGTH128BITS = true
static
Deprecated:
As of iText 2.0.7, use STANDARD_ENCRYPTION_128 instead. Scheduled for removal at or after 2.2.0

◆ STRENGTH40BITS

const bool iTextSharp.text.pdf.PdfWriter.STRENGTH40BITS = false
static
Deprecated:
As of iText 2.0.7, use STANDARD_ENCRYPTION_40 instead. Scheduled for removal at or after 2.2.0

◆ structureTreeRoot

PdfStructureTreeRoot iTextSharp.text.pdf.PdfWriter.structureTreeRoot
protected

◆ tabs

PdfName iTextSharp.text.pdf.PdfWriter.tabs = null
protected

The value of the Tabs entry in the page dictionary.

Since
2.1.5

◆ tagged

bool iTextSharp.text.pdf.PdfWriter.tagged = false
protected

◆ userunit

float iTextSharp.text.pdf.PdfWriter.userunit = 0f
protected

◆ VERSION_1_2

const char iTextSharp.text.pdf.PdfWriter.VERSION_1_2 = '2'
static

possible PDF version (header)

◆ VERSION_1_3

const char iTextSharp.text.pdf.PdfWriter.VERSION_1_3 = '3'
static

possible PDF version (header)

◆ VERSION_1_4

const char iTextSharp.text.pdf.PdfWriter.VERSION_1_4 = '4'
static

possible PDF version (header)

◆ VERSION_1_5

const char iTextSharp.text.pdf.PdfWriter.VERSION_1_5 = '5'
static

possible PDF version (header)

◆ VERSION_1_6

const char iTextSharp.text.pdf.PdfWriter.VERSION_1_6 = '6'
static

possible PDF version (header)

◆ VERSION_1_7

const char iTextSharp.text.pdf.PdfWriter.VERSION_1_7 = '7'
static

possible PDF version (header)

◆ vOCProperties

PdfOCProperties iTextSharp.text.pdf.PdfWriter.vOCProperties
protected

◆ WILL_PRINT

PdfName iTextSharp.text.pdf.PdfWriter.WILL_PRINT = PdfName.WP
static

action value

◆ WILL_SAVE

PdfName iTextSharp.text.pdf.PdfWriter.WILL_SAVE = PdfName.WS
static

action value

◆ xmpMetadata

byte [] iTextSharp.text.pdf.PdfWriter.xmpMetadata = null
protected

XMP Metadata for the document.

Property Documentation

◆ AcroForm

PdfAcroForm iTextSharp.text.pdf.PdfWriter.AcroForm
get

Gets the AcroForm object.

Returns
the PdfAcroForm

◆ Collection

PdfCollection iTextSharp.text.pdf.PdfWriter.Collection
set

Sets the Collection dictionary.

Parameters
collectiona dictionary of type PdfCollection

◆ CompressionLevel

int iTextSharp.text.pdf.PdfWriter.CompressionLevel
getset

Sets the compression level to be used for streams written by this writer.

Parameters
compressionLevela value between 0 (best speed) and 9 (best compression)
Since
2.1.3

◆ CropBoxSize

virtual Rectangle iTextSharp.text.pdf.PdfWriter.CropBoxSize
set

Sets the crop box. The crop box should not be rotated even if the page is rotated. This change only takes effect in the next page.

Parameters
cropthe crop box

◆ CurrentDocumentSize

int iTextSharp.text.pdf.PdfWriter.CurrentDocumentSize
get

Gets the current document size. This size only includes the data already writen to the output stream, it does not include templates or fonts. It is usefull if used with freeReader() when concatenating many documents and an idea of the current size is needed.

Returns
the approximate size without fonts or templates

◆ CurrentPageNumber

virtual int iTextSharp.text.pdf.PdfWriter.CurrentPageNumber
get

◆ DefaultColorspace

PdfDictionary iTextSharp.text.pdf.PdfWriter.DefaultColorspace
get

Gets the default colorspaces.

Returns
the default colorspaces

◆ DirectContent

virtual PdfContentByte iTextSharp.text.pdf.PdfWriter.DirectContent
get

Use this method to get the direct content for this document. There is only one direct content, multiple calls to this method will allways retrieve the same object.

Returns
the direct content

◆ DirectContentUnder

virtual PdfContentByte iTextSharp.text.pdf.PdfWriter.DirectContentUnder
get

Use this method to get the direct content under for this document. There is only one direct content, multiple calls to this method will allways retrieve the same object.

Returns
the direct content

◆ Duration

virtual int iTextSharp.text.pdf.PdfWriter.Duration
set

Sets the display duration for the page (for presentations)

Parameters
secondsthe number of seconds to display the page

◆ ExtraCatalog

PdfDictionary iTextSharp.text.pdf.PdfWriter.ExtraCatalog
get

Sets extra keys to the catalog.

Returns
the catalog to change

◆ FullCompression

bool iTextSharp.text.pdf.PdfWriter.FullCompression
get

Gets the 1.5 compression status.

Returns
true if the 1.5 compression is on

◆ Group

PdfDictionary iTextSharp.text.pdf.PdfWriter.Group
getset

◆ Info

PdfDictionary iTextSharp.text.pdf.PdfWriter.Info
get

Use this method to get the info dictionary if you want to change it directly (add keys and values to the info dictionary).

Returns
the info dictionary

◆ OCProperties

PdfOCProperties iTextSharp.text.pdf.PdfWriter.OCProperties
get

Gets the Optional Content Properties Dictionary. Each call fills the dictionary with the current layer state. It's advisable to only call this method right before close and do any modifications at that time.

Returns
the Optional Content Properties Dictionary

◆ Outlines

ArrayList iTextSharp.text.pdf.PdfWriter.Outlines
set

Sets the bookmarks. The list structure is defined in SimpleBookmark.

Parameters
outlinesthe bookmarks or null to remove any

◆ PageDictEntries

virtual PdfDictionary iTextSharp.text.pdf.PdfWriter.PageDictEntries
get

◆ PageEmpty

bool iTextSharp.text.pdf.PdfWriter.PageEmpty
set

If you use SetPageEmpty(false), invoking NewPage() after a blank page will add a newPage.

Parameters
pageEmptythe state

◆ PageEvent

IPdfPageEvent iTextSharp.text.pdf.PdfWriter.PageEvent
getset

Gets the PdfPageEvent for this document or null if none is set.

Returns
the PdfPageEvent for this document or null if none is set

◆ PageLabels

virtual PdfPageLabels iTextSharp.text.pdf.PdfWriter.PageLabels
set

Use this method to add page labels

Parameters
pageLabelsthe page labels

◆ PageNumber

int iTextSharp.text.pdf.PdfWriter.PageNumber
get

Gets the pagenumber of this document. This number can be different from the real pagenumber, if you have (re)set the page number previously.

Returns
a page number

◆ PageSize

Rectangle iTextSharp.text.pdf.PdfWriter.PageSize
get

Gives the size of the media box.

Returns
a Rectangle

◆ PageXmpMetadata

byte [] iTextSharp.text.pdf.PdfWriter.PageXmpMetadata
set

Use this method to set the XMP Metadata for each page.

Parameters
xmpMetadataThe xmpMetadata to set.

◆ PdfIndirectReference

PdfIndirectReference iTextSharp.text.pdf.PdfWriter.PdfIndirectReference
get

Gets a PdfIndirectReference for an object that will be created in the future.

Returns
the PdfIndirectReference

◆ PdfVersion

virtual char iTextSharp.text.pdf.PdfWriter.PdfVersion
set
See also
com.lowagie.text.pdf.interfaces.PdfVersion::setPdfVersion(char)

◆ PDFXConformance

int iTextSharp.text.pdf.PdfWriter.PDFXConformance
getset

Sets the PDFX conformance level. Allowed values are PDFX1A2001 and PDFX32002. It must be called before opening the document.

Parameters
pdfxConformancethe conformance level

◆ RgbTransparencyBlending

bool iTextSharp.text.pdf.PdfWriter.RgbTransparencyBlending
getset

Sets the transparency blending colorspace to RGB. The default blending colorspace is CMYK and will result in faded colors in the screen and in printing. Calling this method will return the RGB colors to what is expected. The RGB blending will be applied to all subsequent pages until other value is set. Note that this is a generic solution that may not work in all cases.

Parameters
rgbTransparencyBlendingtrue to set the transparency blending colorspace to RGB, false to use the default blending colorspace

◆ RootOutline

PdfOutline iTextSharp.text.pdf.PdfWriter.RootOutline
get

Use this method to get the root outline and construct bookmarks.

Returns
the root outline

◆ RunDirection

virtual int iTextSharp.text.pdf.PdfWriter.RunDirection
getset

Sets the run direction. This is only used as a placeholder as it does not affect anything.

Parameters
runDirectionthe run direction

◆ SigFlags

virtual int iTextSharp.text.pdf.PdfWriter.SigFlags
set

Set the signature flags.

Parameters
fthe flags. This flags are ORed with current ones

◆ SpaceCharRatio

virtual float iTextSharp.text.pdf.PdfWriter.SpaceCharRatio
getset

Sets the ratio between the extra word spacing and the extra character spacing when the text is fully justified. Extra word spacing will grow spaceCharRatio times more than extra character spacing. If the ratio is PdfWriter.NO_SPACE_CHAR_RATIO then the extra character spacing will be zero.

Parameters
spaceCharRatiothe ratio between the extra word spacing and the extra character spacing

◆ StrictImageSequence

bool iTextSharp.text.pdf.PdfWriter.StrictImageSequence
getset

Sets the image sequence to follow the text in strict order.

Parameters
strictImageSequencenew value of property strictImageSequence

◆ StructureTreeRoot

PdfStructureTreeRoot iTextSharp.text.pdf.PdfWriter.StructureTreeRoot
get

Gets the structure tree root. If the document is not marked for tagging it will return null.

Returns
the structure tree root

◆ Tabs

PdfName iTextSharp.text.pdf.PdfWriter.Tabs
getset

Sets the value for the Tabs entry in the page tree.

Parameters
tabsCan be PdfName.R, PdfName.C or PdfName.S. Since the Adobe Extensions Level 3, it can also be PdfName.A or PdfName.W
Since
2.1.5

◆ Thumbnail

virtual Image iTextSharp.text.pdf.PdfWriter.Thumbnail
set

Sets the the thumbnail image for the current page.

Parameters
imagethe image
Exceptions
PdfExceptionon error
DocumentExceptionor error

◆ Transition

virtual PdfTransition iTextSharp.text.pdf.PdfWriter.Transition
set

Sets the transition for the page

Parameters
transitionthe Transition object

◆ UserProperties

bool iTextSharp.text.pdf.PdfWriter.UserProperties
getset

Sets the flag indicating the presence of structure elements that contain user properties attributes.

Parameters
userPropertiesthe user properties flag

◆ Userunit

float iTextSharp.text.pdf.PdfWriter.Userunit
getset

A UserUnit is a value that defines the default user space unit. The minimum UserUnit is 1 (1 unit = 1/72 inch). The maximum UserUnit is 75,000. Remark that this userunit only works starting with PDF1.6!

◆ ViewerPreferences

virtual int iTextSharp.text.pdf.PdfWriter.ViewerPreferences
set

Sets the viewer preferences as the sum of several constants.

Parameters
preferencesthe viewer preferences
See also
PdfViewerPreferences::setViewerPreferences

◆ XmpMetadata

byte [] iTextSharp.text.pdf.PdfWriter.XmpMetadata
getset

Sets XMP Metadata.

Parameters
xmpMetadataThe xmpMetadata to set.

The documentation for this class was generated from the following file: