HiraokaHyperTools.iTextSharp-LGPL
0.2.5
|
Public Member Functions | |
override bool | NewPage () |
override bool | Add (IElement element) |
override void | Open () |
override void | Close () |
void | SetStandardFont (Font standardFont) |
bool | IsOtherFont (Font font) |
void | SetImagepath (String imagepath) |
void | ResetImagepath () |
void | SetHeader (HeaderFooter header) |
void | SetFooter (HeaderFooter footer) |
bool | Add (String str) |
![]() | |
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 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 HtmlWriter | GetInstance (Document document, Stream os) |
![]() | |
static byte[] | GetISOBytes (string text) |
Converts a string into a Byte array according to the ISO-8859-1 codepage. More... | |
Static Public Attributes | |
static byte[] | BEGINCOMMENT = GetISOBytes("<!-- ") |
static byte[] | ENDCOMMENT = GetISOBytes(" -->") |
const string | NBSP = " " |
![]() | |
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 | |
HtmlWriter (Document doc, Stream os) | |
void | InitHeader () |
void | InitFooter () |
void | WriteHeader (Meta meta) |
void | WriteLink (Header header) |
void | WriteJavaScript (Header header) |
void | WriteComment (String comment) |
void | Write (IElement element, int indent) |
void | WriteSection (Section section, int indent) |
void | Write (Font font, Properties styleAttributes) |
void | WriteCssProperty (String prop, String value) |
![]() | |
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 | |
Stack | currentfont = new Stack() |
Font | standardfont = new Font() |
String | imagepath = null |
int | pageN = 0 |
HeaderFooter | header = null |
HeaderFooter | footer = null |
Properties | markup = new Properties() |
![]() | |
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 |
Additional Inherited Members | |
![]() | |
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] |
![]() | |
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... | |
A DocWriter
class for HTML.
An HtmlWriter
can be added as a DocListener
to a certain Document
by getting an instance. Every Element
added to the original Document
will be written to the Stream
of this HtmlWriter
.
Example:
// creation of the document with a certain size and certain margins Document document = new Document(PageSize.A4, 50, 50, 50, 50); try { // this will write HTML to the Standard Stream HtmlWriter.GetInstance(document, System.out); // this will write HTML to a file called text.html HtmlWriter.GetInstance(document, new FileOutputStream("text.html")); // this will write HTML to for instance the Stream of a HttpServletResponse-object HtmlWriter.GetInstance(document, response.GetOutputStream()); } catch (DocumentException de) { System.err.Println(de.GetMessage()); } // this will close the document and all the OutputStreams listening to it document.Close();
|
protected |
Constructs a HtmlWriter
.
doc | The Document that has to be written as HTML |
os | The Stream the writer has to write to. |
|
virtual |
Signals that an Element
was added to the Document
.
true
if the element was added, false
if not. DocumentException | when a document isn't open yet, or has been closed |
Reimplemented from iTextSharp.text.DocWriter.
bool iTextSharp.text.html.HtmlWriter.Add | ( | String | str | ) |
Signals that a String
was added to the Document
.
true
if the string was added, false
if not. DocumentException | when a document isn't open yet, or has been closed |
|
virtual |
Signals that the Document
was closed and that no other Elements
will be added.
Reimplemented from iTextSharp.text.DocWriter.
|
static |
Gets an instance of the HtmlWriter
.
document | The Document that has to be written |
os | The Stream the writer has to write to. |
HtmlWriter
|
protected |
Adds the header to the top of the Document
|
protected |
Adds the header to the top of the Document
bool iTextSharp.text.html.HtmlWriter.IsOtherFont | ( | Font | font | ) |
Checks if a given font is the same as the font that was last used.
font | the font of an object |
|
virtual |
Signals that an new page has to be started.
true
if this action succeeded, false
if not. DocumentException | when a document isn't open yet, or has been closed |
Reimplemented from iTextSharp.text.DocWriter.
|
virtual |
Signals that the Document
has been opened and that Elements
can be added.
The HEAD
-section of the HTML-document is written.
Reimplemented from iTextSharp.text.DocWriter.
void iTextSharp.text.html.HtmlWriter.ResetImagepath | ( | ) |
Resets the imagepath.
void iTextSharp.text.html.HtmlWriter.SetFooter | ( | HeaderFooter | footer | ) |
Changes the footer of this document.
footer | the new footer |
void iTextSharp.text.html.HtmlWriter.SetHeader | ( | HeaderFooter | header | ) |
Changes the header of this document.
header | the new header |
void iTextSharp.text.html.HtmlWriter.SetImagepath | ( | String | imagepath | ) |
Sets the basepath for images.
This is especially useful if you add images using a file, rather than an URL. In PDF there is no problem, since the images are added inline, but in HTML it is sometimes necessary to use a relative path or a special path to some images directory.
imagepath | the new imagepath |
void iTextSharp.text.html.HtmlWriter.SetStandardFont | ( | Font | standardFont | ) |
Changes the standardfont.
standardFont | The font |
|
protected |
|
protected |
Writes the HTML representation of an element.
element | the element |
indent | the indentation |
|
protected |
Writes some comment.
This method writes some comment.
comment | the comment that has to be written |
IOException |
|
protected |
Writes out a CSS property.
|
protected |
Writes a Metatag in the header.
meta | the element that has to be written |
IOException |
|
protected |
Writes a JavaScript section or, if the markup attribute HtmlTags.URL is set, a JavaScript reference in the header.
header | the element that has to be written |
IOException |
|
protected |
Writes a link in the header.
header | the element that has to be written |
IOException |
|
protected |
Writes the HTML representation of a section.
section | the section to write |
indent | the indentation |
|
static |
This is a possible HTML-tag.
|
protected |
This is the current font of the HTML.
|
static |
This is a possible HTML-tag.
|
protected |
This is the textual part of the footer
|
protected |
This is the textual part of a header
|
protected |
This is a path for images.
|
protected |
Store the markup properties of a MarkedObject.
|
static |
This is a possible HTML-tag.
|
protected |
Stores the page number.
This is the standard font of the HTML.