iRex DR1000 Merger v0.3

it.andynaz.irex.dr1000.document
Class PdfDocument

java.lang.Object
  extended by it.andynaz.irex.dr1000.document.Document
      extended by it.andynaz.irex.dr1000.document.PdfDocument

public class PdfDocument
extends Document

Represent a DR1000 PDF file. An object of that kind is associated with a path to a PDF file.

Version:
2013-02-22
Author:
andynaz

Field Summary
static String DB_DEFAULT_NAME
          Name of the default SQLite database file for PDF documents.
private  File file
          Source PDF file.
 
Fields inherited from class it.andynaz.irex.dr1000.document.Document
db
 
Constructor Summary
PdfDocument(String filePath)
          Creates a PDF document.
PdfDocument(String filePath, File db)
          Creates a PDF document.
 
Method Summary
protected  String getDefaultFileName()
          Return the name of the PDF source file, without the extension.
protected  String getFileName()
          Return the name of the PDF file.
 void merge(String outputFile)
          Merge the scribbles with the PDF.
 
Methods inherited from class it.andynaz.irex.dr1000.document.Document
format, getScribbleMgr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB_DEFAULT_NAME

public static final String DB_DEFAULT_NAME
Name of the default SQLite database file for PDF documents.

See Also:
Constant Field Values

file

private File file
Source PDF file.

Constructor Detail

PdfDocument

public PdfDocument(String filePath)
Creates a PDF document.

Parameters:
filePath - path to the PDF file
Throws:
IllegalArgumentException - if filePath does not represent a file

PdfDocument

public PdfDocument(String filePath,
                   File db)
Creates a PDF document.

Parameters:
filePath - path to the PDF file
db - path to the database file
Throws:
IllegalArgumentException - if filePath does not represent a file
Method Detail

getFileName

protected String getFileName()
Return the name of the PDF file.

Specified by:
getFileName in class Document
Returns:
the name of the PDF file
See Also:
ScribbleMgr

getDefaultFileName

protected String getDefaultFileName()
Return the name of the PDF source file, without the extension.

Specified by:
getDefaultFileName in class Document
Returns:
the name of the PDF source file, without the extension

merge

public void merge(String outputFile)
Merge the scribbles with the PDF. The output is written in the file specified by the 'output' argument.

If the file is not found in the database, the program list all the files in the database having at least a scribble, so that user can choose which is the corresponding one. This can happen with a file having a name with all uppercases character, as the Linux operating system of the DR1000 may not recognize them properly.

Specified by:
merge in class Document
Parameters:
outputFile - the output file path; if it is null or empty, the default one returned by getDefaultFileName() is used

iRex DR1000 Merger v0.3

© 2013 andynaz - http://andynaz.altervista.org