public abstract class Document
extends java.lang.Object
ScribbleMgr
; use the getScribbleMgr()
method
to retrieve a ScribbleMgr suitable for this document.Modifier and Type | Field and Description |
---|---|
protected java.io.File |
_db
Database file.
|
Modifier | Constructor and Description |
---|---|
protected |
Document(java.io.File db)
Creates a new Document with an associated database file.
|
Modifier and Type | Method and Description |
---|---|
void |
exportToPNG()
Export the scribbles to PNG files.
|
void |
exportToPNG(java.io.File dir)
Export the scribbles to PNG files.
|
void |
exportToPNG(java.lang.String dirPath)
Export the scribbles to PNG files.
|
void |
format(java.lang.String outputFile)
Deprecated.
only for debug purpuse; will be deleted in future release
|
protected abstract java.lang.String |
getDbName()
Returns the file name as it is present in the database file.
|
static Document |
getDocument(java.io.File file)
Return the document representing 'file'.
|
protected abstract java.lang.String |
getName()
Returns the name of this document.
|
protected ScribbleMgr |
getScribbleMgr()
Returns an initialized
ScribbleMgr . |
abstract void |
merge()
Creates a PDF file with the scribbles.
|
abstract void |
merge(java.io.File file)
Creates a PDF file with the scribbles.
|
(package private) void |
merge(java.io.File input,
java.io.File output,
java.util.List<java.lang.Integer> scribbledPages,
ScribbleMgr sm,
int idFile,
boolean skipEmptyPages)
Merging core.
|
void |
merge(java.lang.String output)
Creates a PDF file with the scribbles.
|
protected Document(java.io.File db)
db
- database filejava.lang.IllegalArgumentException
- if the db
file does not exists or
is not a filepublic static Document getDocument(java.io.File file)
file
- a filejava.lang.IllegalArgumentException
- in case of unknown fileprotected ScribbleMgr getScribbleMgr()
ScribbleMgr
.protected abstract java.lang.String getDbName()
file_metadata.filename
column.ScribbleMgr
protected abstract java.lang.String getName()
The filename returned should be without the file extensions or suffixes (if needed, they will be added in the calling methods).
public abstract void merge()
public void merge(java.lang.String output)
color
set for the strokes.output
- path to the output file/folder; if it is null
or
empty, the merge()
method is invokedpublic abstract void merge(java.io.File file)
color
set for the strokes.file
- output filevoid merge(java.io.File input, java.io.File output, java.util.List<java.lang.Integer> scribbledPages, ScribbleMgr sm, int idFile, boolean skipEmptyPages) throws java.io.IOException, java.sql.SQLException, com.lowagie.text.DocumentException
Warning: this is a service method and could be changend in future releases. Note that no check is done, so all the object passed as arguments must be ready to be used
input
- original PDF fileoutput
- output filescribbledPages
- list of scribbled page numberssm
- active scribble managedidFile
- file id, as is present in the dbskipEmptyPages
- set to true
to include only the annotated
pages in the outputjava.io.IOException
java.sql.SQLException
com.lowagie.text.DocumentException
public void exportToPNG()
exportToPNG(File)
public void exportToPNG(java.lang.String dirPath)
dirPath
- output folderexportToPNG(File)
public void exportToPNG(java.io.File dir)
For each page of scribble, the program creates a PNG file saved as
name-pg.png
, where 'name' is the name returned by the getName()
method and 'pg' is the page number.
dir
- output folder; if it is null
, the exportToPNG()
method will be usedpublic void format(java.lang.String outputFile)
outputFile
- path to the output text file; if it is null
or empty, the default one returned by getName()
is
used© 2015 andynaz - http://andynaz.altervista.org