HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.PdfSmartCopy Class Reference
Inheritance diagram for iTextSharp.text.pdf.PdfSmartCopy:
iTextSharp.text.pdf.PdfCopy 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

Classes

class  ByteStore
 

Public Member Functions

 PdfSmartCopy (Document document, Stream os)
 
- Public Member Functions inherited from iTextSharp.text.pdf.PdfCopy
 PdfCopy (Document document, Stream os)
 
override PdfImportedPage GetImportedPage (PdfReader reader, int pageNumber)
 
void AddPage (PdfImportedPage iPage)
 
void AddPage (Rectangle rect, int rotation)
 
void CopyAcroForm (PdfReader reader)
 
override void Close ()
 
override void AddAnnotation (PdfAnnotation annot)
 
override void FreeReader (PdfReader reader)
 
PageStamp CreatePageStamp (PdfImportedPage iPage)
 
- Public Member Functions inherited from iTextSharp.text.pdf.PdfWriter
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 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)
 
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)
 

Protected Member Functions

override PdfIndirectReference CopyIndirect (PRIndirectReference inp)
 
- Protected Member Functions inherited from iTextSharp.text.pdf.PdfCopy
virtual PdfDictionary CopyDictionary (PdfDictionary inp)
 
virtual PdfStream CopyStream (PRStream inp)
 
virtual PdfArray CopyArray (PdfArray inp)
 
virtual PdfObject CopyObject (PdfObject inp)
 
int SetFromIPage (PdfImportedPage iPage)
 
void SetFromReader (PdfReader reader)
 
override PdfDictionary GetCatalog (PdfIndirectReference rootObj)
 
- Protected Member Functions inherited from iTextSharp.text.pdf.PdfWriter
 PdfWriter ()
 
 PdfWriter (PdfDocument document, Stream os)
 
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from iTextSharp.text.pdf.PdfWriter
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 inherited from iTextSharp.text.pdf.PdfWriter
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 Attributes inherited from iTextSharp.text.pdf.PdfCopy
Hashtable indirects
 
Hashtable indirectMap
 
int currentObjectNum = 1
 
PdfReader reader
 
PdfIndirectReference acroForm
 
int[] namePtr = {0}
 
- Protected Attributes inherited from iTextSharp.text.pdf.PdfWriter
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 inherited from iTextSharp.text.pdf.PdfCopy
bool RotateContents [get, set]
 
- Properties inherited from iTextSharp.text.pdf.PdfWriter
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

PdfSmartCopy has the same functionality as PdfCopy, but when resources (such as fonts, images,...) are encountered, a reference to these resources is saved in a cache, so that they can be reused. This requires more memory, but reduces the file size of the resulting PDF document.

Constructor & Destructor Documentation

◆ PdfSmartCopy()

iTextSharp.text.pdf.PdfSmartCopy.PdfSmartCopy ( Document  document,
Stream  os 
)

Creates a PdfSmartCopy instance.

Member Function Documentation

◆ CopyIndirect()

override PdfIndirectReference iTextSharp.text.pdf.PdfSmartCopy.CopyIndirect ( PRIndirectReference  inp)
protectedvirtual

Translate a PRIndirectReference to a PdfIndirectReference In addition, translates the object numbers, and copies the referenced object to the output file if it wasn't available in the cache yet. If it's in the cache, the reference to the already used stream is returned.

NB: PRIndirectReferences (and PRIndirectObjects) really need to know what file they came from, because each file has its own namespace. The translation we do from their namespace to ours is at best heuristic, and guaranteed to fail under some circumstances.

Reimplemented from iTextSharp.text.pdf.PdfCopy.


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