public class ElementWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
e_overlay
The Constant e_overlay.
|
static int |
e_replacement
The Constant e_replacement.
|
static int |
e_underlay
Enumeration describing the placement of the element written to a page.
|
Constructor and Description |
---|
ElementWriter()
Instantiates a new element writer.
|
Modifier and Type | Method and Description |
---|---|
void |
begin(Doc doc)
Begin writing an Element sequence to a new stream.
|
void |
begin(Doc doc,
boolean compress)
Begin writing an Element sequence to a new stream.
|
void |
begin(Obj streamobj_to_update)
Begin writing an Element sequence to a stream.
|
void |
begin(Obj streamobj_to_update,
boolean compress)
Begin writing an Element sequence to a stream.
|
void |
begin(Page page)
Begin writing to the given page.
|
void |
begin(Page page,
int write_mode)
Begin writing to the given page.
|
void |
begin(Page page,
int write_mode,
boolean page_coord_sys)
Begin writing to the given page.
|
void |
begin(Page page,
int write_mode,
boolean page_coord_sys,
boolean compress)
Begin writing to the given page.
|
void |
destroy()
Frees the native memory of the object.
|
Obj |
end()
Finish writing to a page.
|
void |
flush()
The Flush method flushes all pending Element writing operations.
|
void |
writeBuffer(byte[] data)
Writes an arbitrary buffer to the content stream.
|
void |
writeElement(Element element)
Writes the Element to the content stream.
|
void |
writePlacedElement(Element element)
A utility function that surrounds the given Element with a graphics state
Save/Restore Element (i.e.
|
void |
writeString(java.lang.String str)
Writes an arbitrary string to the content stream.
|
public static final int e_underlay
public static final int e_overlay
public static final int e_replacement
public ElementWriter() throws PDFNetException
PDFNetException
public void destroy() throws PDFNetException
PDFNetException
public void begin(Page page) throws PDFNetException
page
- The page to write content.PDFNetException
public void begin(Page page, int write_mode) throws PDFNetException
page
- The page to write content.write_mode
- the write modePDFNetException
public void begin(Page page, int write_mode, boolean page_coord_sys) throws PDFNetException
page
- The page to write content.write_mode
- the write modepage_coord_sys
- An optional flag used to select the target coordinate system
if true (default), the coordinates are relative to the lower-left corner of the page,
otherwise the coordinates are defined in PDF user coordinate system (which may,
or may not coincide with the page coordinates).PDFNetException
public void begin(Page page, int write_mode, boolean page_coord_sys, boolean compress) throws PDFNetException
page
- The page to write content.write_mode
- the write modepage_coord_sys
- An optional flag used to select the target coordinate system
if true (default), the coordinates are relative to the lower-left corner of the page,
otherwise the coordinates are defined in PDF user coordinate system (which may,
or may not coincide with the page coordinates).compress
- whether the page content stream should be compressed. This
may be useful for debugging content streams. Also some applications need
to do a clear text search on strings in the PDF files. By default, all
content streams are compressed.PDFNetException
public void begin(Obj streamobj_to_update) throws PDFNetException
streamobj_to_update
- A low-level SDF stream object that will contain
the new stream. Old stream inside that object will be discarded.PDFNetException
public void begin(Obj streamobj_to_update, boolean compress) throws PDFNetException
streamobj_to_update
- A low-level SDF stream object that will contain
the new stream. Old stream inside that object will be discarded.compress
- whether the content stream should be compressed. This may
be useful for debugging content streams. Also some applications need to do
a clear text search on strings in the PDF filePDFNetException
public void begin(Doc doc) throws PDFNetException
Note: the newly created content stream object is returned when writing operations are completed (i.e. after the call to ElementWriter::End()).
doc
- - A low-level SDF/Cos document that will contain the new stream. You can
access low-level document using PDFDoc::GetSDFDoc() or Obj::GetDoc() methods.PDFNetException
public void begin(Doc doc, boolean compress) throws PDFNetException
doc
- the document that will contain the new stream.compress
- whether the page content stream should be compressed. This
may be useful for debugging content streams. Also some applications need
to do a clear text search on strings in the PDF files.PDFNetException
public Obj end() throws PDFNetException
PDFNetException
public void writeElement(Element element) throws PDFNetException
element
- the element to be written to the content streamPDFNetException
public void writePlacedElement(Element element) throws PDFNetException
element
- the elementPDFNetException
public void flush() throws PDFNetException
PDFNetException
public void writeBuffer(byte[] data) throws PDFNetException
data
- the dataPDFNetException
public void writeString(java.lang.String str) throws PDFNetException
str
- the strPDFNetException