public abstract class Document extends Object
ScribbleMgr
; use the getScribbleMgr()
method
to retrieve on suitable for this document.Modifier | Constructor and Description |
---|---|
protected |
Document(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(File dir)
Export the scribbles to PNG files.
|
void |
exportToPNG(String dirPath)
Export the scribbles to PNG files.
|
void |
format(String outputFile)
Deprecated.
only for debug purpuse; will be deleted in future release
|
protected abstract String |
getDbName()
Return the file name as it is present in the database file.
|
protected abstract String |
getDefaultFileName()
Return the default filename used to create the output files.
|
static Document |
getDocument(File file)
Return the document suitable for 'file'.
|
protected ScribbleMgr |
getScribbleMgr()
Returns an initialized
ScribbleMgr . |
void |
merge()
Creates a PDF file with the scribbles.
|
abstract void |
merge(File file)
Creates a PDF file with the scribbles.
|
(package private) static void |
merge(File input,
File output,
List<Integer> scribbledPages,
ScribbleMgr sm,
int idFile,
boolean skipEmptyPages)
Merging core.
|
void |
merge(String outFilePath)
Creates a PDF file with the scribbles.
|
protected File db
protected Document(File db)
db
- database fileIllegalArgumentException
- if the db
file does not exists or
is not a filepublic static Document getDocument(File file)
file
- a fileIllegalArgumentException
- in case of unknown fileprotected ScribbleMgr getScribbleMgr()
ScribbleMgr
.protected abstract String getDbName()
file_metadata.filename
column.ScribbleMgr
protected abstract String getDefaultFileName()
public void merge()
default file
name
and the set color
for the strokes.public void merge(String outFilePath)
set color
for the strokes.outFilePath
- path to the output file/folder; if it is null
or empty, the default one
is usedpublic abstract void merge(File file)
set color
for the strokes.file
- output filestatic void merge(File input, File output, List<Integer> scribbledPages, ScribbleMgr sm, int idFile, boolean skipEmptyPages) throws IOException, 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 dbIOException
SQLException
com.lowagie.text.DocumentException
public void exportToPNG()
exportToPNG(File)
public void exportToPNG(String dirPath)
dirPath
- output folderexportToPNG(File)
public void exportToPNG(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 getDefaultFileName()
method and 'pg' is the page number.
dir
- output folder; if it is null
, the exportToPNG()
method will be usedpublic void format(String outputFile)
outputFile
- path to the output text file; if it is null
or empty, the default one returned by getDefaultFileName()
is
used© 2013 andynaz - http://andynaz.altervista.org