PDF Clown
0.0.8

it.stefanochizzolini.clown.files
Class File

java.lang.Object
  extended by it.stefanochizzolini.clown.files.File
All Implemented Interfaces:
Closeable

public class File
extends Object
implements Closeable

PDF file representation.

Since:
0.0.0
Version:
0.0.8
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Nested Class Summary
static class File.ResolvedObject<T extends PdfDataObject>
           
 
Constructor Summary
File()
           
File(IInputStream stream)
           
File(String path)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
 Document getDocument()
           
 IndirectObjects getIndirectObjects()
           
 Reader getReader()
           
 PdfDictionary getTrailer()
           
 String getVersion()
          Gets the file header version [PDF:1.6:3.4.1].
 XRefEntry[] getXRefEntries()
           
 int hashCode()
           
 PdfReference register(PdfDataObject object)
          Registers an internal data object.
static PdfDataObject resolve(PdfObject object)
          Forces a generic object to be expressed as its corresponding data object.
static
<T extends PdfDataObject>
File.ResolvedObject<T>
resolve(PdfObject object, IPdfIndirectObject container)
          Resolves a generic object.
 void save()
          Serializes the file to the current file-system path using the standard serialization mode.
 void save(SerializationModeEnum mode)
          Serializes the file to the current file-system path.
 void unregister(PdfReference reference)
          Unregisters an internal object.
static boolean update(PdfDirectObject object)
          Forces a direct object to be updated (whether possible).
 void writeTo(File file, SerializationModeEnum mode)
          Serializes the file to the specified file-system file.
 void writeTo(IOutputStream stream, SerializationModeEnum mode)
          Serializes the file to the specified stream.
 void writeTo(String path, SerializationModeEnum mode)
          Serializes the file to the specified file-system path.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File

public File()

File

public File(String path)
     throws FileFormatException,
            FileNotFoundException
Throws:
FileFormatException
FileNotFoundException

File

public File(IInputStream stream)
     throws FileFormatException
Throws:
FileFormatException
Method Detail

resolve

public static PdfDataObject resolve(PdfObject object)
Forces a generic object to be expressed as its corresponding data object.


resolve

public static <T extends PdfDataObject> File.ResolvedObject<T> resolve(PdfObject object,
                                                                       IPdfIndirectObject container)
Resolves a generic object.


update

public static boolean update(PdfDirectObject object)
Forces a direct object to be updated (whether possible).


getDocument

public Document getDocument()

getIndirectObjects

public IndirectObjects getIndirectObjects()

getReader

public Reader getReader()

getTrailer

public PdfDictionary getTrailer()

getVersion

public String getVersion()
Gets the file header version [PDF:1.6:3.4.1].

Remarks

This property represents just the original file version; to get the actual version, use the Document.getVersion method.


getXRefEntries

public XRefEntry[] getXRefEntries()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

register

public PdfReference register(PdfDataObject object)
Registers an internal data object.

Since:
0.0.4

save

public void save()
          throws IOException
Serializes the file to the current file-system path using the standard serialization mode.

Throws:
IOException

save

public void save(SerializationModeEnum mode)
          throws IOException
Serializes the file to the current file-system path.

Parameters:
mode - Serialization mode.
Throws:
IOException

unregister

public void unregister(PdfReference reference)
Unregisters an internal object.

Since:
0.0.5

writeTo

public void writeTo(String path,
                    SerializationModeEnum mode)
             throws IOException
Serializes the file to the specified file-system path.

Parameters:
path - Target path.
mode - Serialization mode.
Throws:
IOException

writeTo

public void writeTo(File file,
                    SerializationModeEnum mode)
             throws IOException
Serializes the file to the specified file-system file.

Parameters:
file - Target file.
mode - Serialization mode.
Throws:
IOException

writeTo

public void writeTo(IOutputStream stream,
                    SerializationModeEnum mode)
Serializes the file to the specified stream.

Remarks

It's caller responsibility to close the stream after this method ends.

Parameters:
stream - Target stream.
mode - Serialization mode.

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

PDF Clown
0.0.8

Project home page

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