HiraokaHyperTools.iTextSharp-LGPL
0.2.5
|
Classes | |
class | IndirectReferences |
class | PageStamp |
class | RefKey |
class | StampContent |
Public Member Functions | |
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) |
![]() | |
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) |
![]() | |
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 | |
virtual PdfIndirectReference | CopyIndirect (PRIndirectReference inp) |
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) |
![]() | |
PdfWriter () | |
PdfWriter (PdfDocument document, Stream os) | |
void | AddSharedObjectsToBody () |
void | FillOCProperties (bool erase) |
virtual PdfIndirectReference | Add (PdfICCBased icc) |
![]() | |
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 PdfWriter | GetInstance (Document document, Stream os) |
static PdfWriter | GetInstance (Document document, Stream os, IDocListener listener) |
![]() | |
static byte[] | GetISOBytes (string text) |
Converts a string into a Byte array according to the ISO-8859-1 codepage. More... | |
![]() | |
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 |
![]() | |
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... | |
Make copies of PDF documents. Documents can be edited after reading and before writing them out.
iTextSharp.text.pdf.PdfCopy.PdfCopy | ( | Document | document, |
Stream | os | ||
) |
Constructor
document | |
os | outputstream |
|
virtual |
Adds a PdfAnnotation
or a PdfFormField
to the document. Only the top parent of a PdfFormField
needs to be added.
annot | the PdfAnnotation or the PdfFormField to add |
Reimplemented from iTextSharp.text.pdf.PdfWriter.
void iTextSharp.text.pdf.PdfCopy.AddPage | ( | PdfImportedPage | iPage | ) |
Add an imported page to our output
iPage | an imported page |
IOException,BadPdfFormatException |
void iTextSharp.text.pdf.PdfCopy.AddPage | ( | Rectangle | rect, |
int | rotation | ||
) |
Adds a blank page.
rect | The page dimension |
rotation | The rotation angle in degrees |
|
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.
void iTextSharp.text.pdf.PdfCopy.CopyAcroForm | ( | PdfReader | reader | ) |
Copy the acroform for an input document. Note that you can only have one, we make no effort to merge them.
reader | The reader of the input file that is being copied |
IOException,BadPdfFormatException |
Translate a PRArray to a PdfArray. Also translate all of the objects contained in it
|
protectedvirtual |
Translate a PRDictionary to a PdfDictionary. Also translate all of the objects contained in it.
|
protectedvirtual |
Translate a PRIndirectReference to a PdfIndirectReference In addition, translates the object numbers, and copies the referenced object to the output file. 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 in iTextSharp.text.pdf.PdfSmartCopy.
Translate a PR-object to a Pdf-object
PageStamp iTextSharp.text.pdf.PdfCopy.CreatePageStamp | ( | PdfImportedPage | iPage | ) |
Create a page stamp. New content and annotations, including new fields, are allowed. The fields added cannot have parents in another pages. This method modifies the PdfReader instance.
The general usage to stamp something in a page is:
PdfImportedPage page = copy.getImportedPage(reader, 1); PdfCopy.PageStamp ps = copy.createPageStamp(page); ps.addAnnotation(PdfAnnotation.createText(copy, new Rectangle(50, 180, 70, 200), "Hello", "No Thanks", true, "Comment")); PdfContentByte under = ps.getUnderContent(); under.addImage(img); PdfContentByte over = ps.getOverContent(); over.beginText(); over.setFontAndSize(bf, 18); over.setTextMatrix(30, 30); over.showText("total page " + totalPage); over.endText(); ps.alterContents(); copy.addPage(page);
iPage | an imported page |
PageStamp
|
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.
reader | the PdfReader to free |
IOException | on error |
Reimplemented from iTextSharp.text.pdf.PdfWriter.
|
protectedvirtual |
Reimplemented from iTextSharp.text.pdf.PdfWriter.
|
virtual |
Grabs a page from the input document
reader | the reader of the document |
pageNumber | which page to get |
Reimplemented from iTextSharp.text.pdf.PdfWriter.
|
protected |
convenience method. Given an importedpage, set our "globals"
|
protected |
convenience method. Given a reader, set our "globals"
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
getset |
Checks if the content is automatically adjusted to compensate the original page rotation.
true
. rotateContents | true to set auto-rotation, false otherwise |