-
public class Document
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumDocument.PDFPageFormatAvailable PDF page formats when generating PDF documents.
public enumDocument.PageSourceTypeAvailable page source types when generating image files from scanned or imported pages.
-
Method Summary
Modifier and Type Method Description final static FilewritePDF(File file, Boolean overwrite, Document.PDFPageFormat pageFormat, Integer maxSizeKB)This method generates a PDF document from the loaded or scanned pages. final static FilewritePDF(File file, Boolean overwrite, Document.PDFPageFormat pageFormat)This method generates a PDF document from the loaded or scanned pages. final static FilewritePDF(File file, Boolean overwrite)This method generates a PDF document from the loaded or scanned pages. final static FilewritePDF(File file)This method generates a PDF document from the loaded or scanned pages. final static FilewriteImage(Integer page, File file)This method generates a JPG from the loaded or scanned page and saves it to a local file. final static BitmapgetImage(Integer page, BitmapFactory.Options options, Document.PageSourceType pageSourceType)This method generates a JPG from the loaded or scanned page and returns it as a Bitmap. final static BitmapgetImage(Integer page, BitmapFactory.Options options)This method generates a JPG from the loaded or scanned page and returns it as a Bitmap. final static BitmapgetImage(Integer page)This method generates a JPG from the loaded or scanned page and returns it as a Bitmap. final static ByteArraygetImageBytes(Integer page, Document.PageSourceType pageSourceType)This method generates a JPG from the loaded or scanned page and returns it as a ByteArray. final static ByteArraygetImageBytes(Integer page)This method generates a JPG from the loaded or scanned page and returns it as a ByteArray. final static BooleanloadFile(String path, String password)This method loads a file from the given path. final static BooleanloadFile(String path)This method loads a file from the given path. final static BooleanloadFile(ByteArray bytes, String fileExtension, String password)This method loads a file from the given ByteArray. final static BooleanloadFile(ByteArray bytes, String fileExtension)This method loads a file from the given ByteArray. final static BooleanloadFile(Uri uri, String password)This method loads a file from the given Uri. final static BooleanloadFile(Uri uri)This method loads a file from the given Uri. final static BooleanaddPageFile(String path)This method adds a page from the given path to the currently loaded document. final static BooleanaddPage(ByteArray bytes, String fileExtension)This method adds a page from the given ByteArray to the currently loaded document. final static IntegerpageCount()This method returns the page count of the currently loaded document. -
-
Method Detail
-
writePDF
@JvmOverloads() final static File writePDF(File file, Boolean overwrite, Document.PDFPageFormat pageFormat, Integer maxSizeKB)
This method generates a PDF document from the loaded or scanned pages.
- Parameters:
file- the File where to save the PDF document.overwrite- if file already exist, indicate whether to override it or to append number, e.g.pageFormat- the PDF page format, refer to PDFPageFormat.maxSizeKB- the maximum file size in KB of the PDF or 0 if no compression should be applied.
-
writePDF
@JvmOverloads() final static File writePDF(File file, Boolean overwrite, Document.PDFPageFormat pageFormat)
This method generates a PDF document from the loaded or scanned pages.
- Parameters:
file- the File where to save the PDF document.overwrite- if file already exist, indicate whether to override it or to append number, e.g.pageFormat- the PDF page format, refer to PDFPageFormat.
-
writePDF
@JvmOverloads() final static File writePDF(File file, Boolean overwrite)
This method generates a PDF document from the loaded or scanned pages.
- Parameters:
file- the File where to save the PDF document.overwrite- if file already exist, indicate whether to override it or to append number, e.g.
-
writePDF
@JvmOverloads() final static File writePDF(File file)
This method generates a PDF document from the loaded or scanned pages.
- Parameters:
file- the File where to save the PDF document.
-
writeImage
final static File writeImage(Integer page, File file)
This method generates a JPG from the loaded or scanned page and saves it to a local file.
- Parameters:
page- the page to be generated as JPGfile- the file where to save the JPG file
-
getImage
@JvmOverloads() final static Bitmap getImage(Integer page, BitmapFactory.Options options, Document.PageSourceType pageSourceType)
This method generates a JPG from the loaded or scanned page and returns it as a Bitmap.
- Parameters:
page- the page to be generated as JPGpageSourceType- the PageSourceType type to be used when generating the JPG
-
getImage
@JvmOverloads() final static Bitmap getImage(Integer page, BitmapFactory.Options options)
This method generates a JPG from the loaded or scanned page and returns it as a Bitmap.
- Parameters:
page- the page to be generated as JPG
-
getImage
@JvmOverloads() final static Bitmap getImage(Integer page)
This method generates a JPG from the loaded or scanned page and returns it as a Bitmap.
- Parameters:
page- the page to be generated as JPG
-
getImageBytes
@JvmOverloads() final static ByteArray getImageBytes(Integer page, Document.PageSourceType pageSourceType)
This method generates a JPG from the loaded or scanned page and returns it as a ByteArray.
- Parameters:
page- the page to be generated as JPGpageSourceType- the PageSourceType type to be used when generating the JPG
-
getImageBytes
@JvmOverloads() final static ByteArray getImageBytes(Integer page)
This method generates a JPG from the loaded or scanned page and returns it as a ByteArray.
- Parameters:
page- the page to be generated as JPG
-
loadFile
@JvmOverloads() final static Boolean loadFile(String path, String password)
This method loads a file from the given path.
Only paths in internal app directory and it's subdirectories are supported.
- Parameters:
path- the path pointing to the file to be loaded.password- the password if file is encrypted.
-
loadFile
@JvmOverloads() final static Boolean loadFile(String path)
This method loads a file from the given path.
Only paths in internal app directory and it's subdirectories are supported.
- Parameters:
path- the path pointing to the file to be loaded.
-
loadFile
@JvmOverloads() final static Boolean loadFile(ByteArray bytes, String fileExtension, String password)
This method loads a file from the given ByteArray.
- Parameters:
bytes- the ByteArray of the file to be loaded.fileExtension- the extension of the file to be loaded, e.g.password- the password if file is encrypted.
-
loadFile
@JvmOverloads() final static Boolean loadFile(ByteArray bytes, String fileExtension)
This method loads a file from the given ByteArray.
- Parameters:
bytes- the ByteArray of the file to be loaded.fileExtension- the extension of the file to be loaded, e.g.
-
loadFile
@JvmOverloads() final static Boolean loadFile(Uri uri, String password)
This method loads a file from the given Uri.
- Parameters:
uri- the content Uri pointing to the file to be loaded.password- the password if file is encrypted.
-
loadFile
@JvmOverloads() final static Boolean loadFile(Uri uri)
This method loads a file from the given Uri.
- Parameters:
uri- the content Uri pointing to the file to be loaded.
-
addPageFile
final static Boolean addPageFile(String path)
This method adds a page from the given path to the currently loaded document.
Only paths in internal app directory and it's subdirectories are supported.
- Parameters:
path- the path pointing to the file to be loaded.
-
addPage
final static Boolean addPage(ByteArray bytes, String fileExtension)
This method adds a page from the given ByteArray to the currently loaded document.
- Parameters:
bytes- the ByteArray of the file to be loaded.fileExtension- the extension of the file to be loaded, e.g.
-
-
-
-