Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| PDF Clown 0.1.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.pdfclown.tokens
Class Writer

    java.lang.Object
      org.pdfclown.tokens.Writer

    public abstract class Writer

extends Object

PDF file writer.

Version:
  0.1.2, 02/04/12
Author:
  Stefano Chizzolini (http://www.stefanochizzolini.it)

Field Summary
`protected File` | `file`
`protected IOutputStream` | `stream`

Constructor Summary
`protected` | `Writer(File file, IOutputStream stream)`

Method Summary
`static Writer` | `get(File file, IOutputStream stream)` Gets a new writer instance for the specified file.
`File` | `getFile()` Gets the file to serialize.
`IOutputStream` | `getStream()` Gets the target stream.
`protected void` | `updateTrailer(PdfDictionary trailer, IOutputStream stream)` Updates the specified trailer.
`void` | `write(SerializationModeEnum mode)` Serializes the `file` to the `target stream`.
`protected void` | `writeHeader()` Serializes the beginning of the file [PDF:1.6:3.4.1].
`protected abstract void` | `writeIncremental()` Serializes the PDF file as incremental update [PDF:1.6:3.4.5].
`protected abstract void` | `writeLinearized()` Serializes the PDF file linearized [PDF:1.6:F].
`protected abstract void` | `writeStandard()` Serializes the PDF file compactly [PDF:1.6:3.4].
`protected void` | `writeTail(long startxref)` Serializes the end of the file [PDF:1.6:3.4.4].

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### file

    protected final File file

### stream

    protected final IOutputStream stream

Constructor Detail

### Writer

    protected Writer(File file,
                     IOutputStream stream)

Method Detail

### get

    public static Writer get(File file,
                             IOutputStream stream)

  Gets a new writer instance for the specified file.

  Parameters:
    `file` - File to serialize.
    `stream` - Target stream.

### getFile

    public File getFile()

  Gets the file to serialize.

### getStream

    public IOutputStream getStream()

  Gets the target stream.

### write

    public void write(SerializationModeEnum mode)

  Serializes the `file` to the `target stream`.

  Parameters:
    `mode` - Serialization mode.

### updateTrailer

    protected void updateTrailer(PdfDictionary trailer,
                                 IOutputStream stream)

  Updates the specified trailer. NOTE: this method has to be called just before serializing the trailer object.

### writeHeader

    protected final void writeHeader()

  Serializes the beginning of the file [PDF:1.6:3.4.1].

### writeIncremental

    protected abstract void writeIncremental()

  Serializes the PDF file as incremental update [PDF:1.6:3.4.5].

### writeLinearized

    protected abstract void writeLinearized()

  Serializes the PDF file linearized [PDF:1.6:F].

### writeStandard

    protected abstract void writeStandard()

  Serializes the PDF file compactly [PDF:1.6:3.4].

### writeTail

    protected final void writeTail(long startxref)

  Serializes the end of the file [PDF:1.6:3.4.4].

  Parameters:
    `startxref` - Byte offset from the beginning of the file to the beginning of the last cross-reference section.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| PDF Clown 0.1.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Project home page
Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.