|
|||||||||
prev class next class | frames no frames | ||||||||
summary: nested | field | constr | method | detail: field | constr | method |
java.lang.objectcom.spire.pdf.pdfdocument
public class pdfdocument
root object of the library to create pdf files.
constructor summary | |
---|---|
pdfdocument()
initializes a new instance of the class. |
|
pdfdocument(byte[] bytes)
initializes a new instance of the class. |
|
pdfdocument(byte[] bytes,
java.lang.string password)
initializes a new instance of the class. |
|
pdfdocument(java.io.inputstream stream)
initializes a new instance of the class. |
|
pdfdocument(java.io.inputstream stream,
java.lang.string password)
initializes a new instance. |
|
pdfdocument(pdfconformancelevel pdflevel)
set document pdfconformancelevel |
|
pdfdocument(java.lang.string filename)
initializes a new instance of the class. |
|
pdfdocument(java.lang.string filename,
java.lang.string password)
initializes a new instance of the class. |
method summary | |
---|---|
pdfpagebase |
appendpage()
append a page to the pdf files |
void |
appendpage(pdfdocument doc)
append a page to the pdf files |
void |
close()
closes the document. |
void |
createbooklet(java.lang.string filename,
double width,
double height,
boolean doubleside)
for the document create booklet |
void |
createbooklet(java.lang.string filename,
float width,
float height,
boolean doubleside)
for the document create booklet |
void |
createbooklet(java.lang.string filename,
float width,
float height,
boolean doubleside,
begindrawpage,
enddrawpage)
for the document create booklet |
java.lang.object |
deepclone()
creates a new object that is a copy of the current instance. |
void |
dispose()
releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection. |
pdfaction |
getafteropenaction()
gets the action to execute when the document is opened. |
pdfjavascriptaction |
getafterprintaction()
gets the action to be performed after the document is printed. |
pdfjavascriptaction |
getaftersaveaction()
gets the jave script action to be performed after the document is saved. |
boolean |
getallowcreateform()
get or set allow create form. |
pdfattachmentcollection |
getattachments()
gets the collection of document attachments displayed on a pdf page. |
pdfjavascriptaction |
getbeforecloseaction()
gets or sets the action to be performed before the document is closed. |
pdfjavascriptaction |
getbeforeprintaction()
gets or sets the action to be performed before the document is printed. |
pdfjavascriptaction |
getbeforesaveaction()
gets the java script action to be performed before the document is saved. |
pdfbookmarkcollection |
getbookmarks()
gets the bookmarks. |
|
getcolorspace()
gets the color space for page that will be created. |
pdfcompressionlevel |
getcompressionlevel()
gets or sets the desired level of stream compression. |
pdfconformancelevel |
getconformance()
get document pdfconformancelevel |
pdfconvertoptions |
getconvertoptions()
gets some options when do convert operation. |
boolean |
getcustomhandlelandscape()
gets a value indicating handle pagesettings landscape. |
int |
getcustomscaling()
get or set current pdf document print pagescaling |
int |
getdocprintdpi()
get the dpi to print using image |
pdfdocumentinformation |
getdocumentinformation()
gets document's information and properties. |
static boolean |
getenablefontcache()
indicates whether enable font cache. |
static boolean |
getexporttextenableocr()
|
static iocr |
getexporttextocrhandler()
|
pdffileinfo |
getfileinfo()
get the file info int the pdf document |
pdfform |
getform()
gets the loaded form. |
|
getjavascripts()
gets the additional document's actions. |
pdflayercollection |
getlayers()
gets optional content properties |
pdfpagenumber |
getpagenumber()
get the pdfpagelabel. |
pdfpagecollection |
getpages()
gets the pages. |
pdfprintpagescaling |
getpagescaling()
get pdfdocument print pagescaling |
pdfpagesettings |
getpagesettings()
get a page settings in the pdf documents |
pdfdocumentbase |
getpdfstandard()
get current active pdf object |
int |
getprintfrompage()
gets the pagenumber which you choose as the start page to printing |
|
getprintpagemode()
get or set pdfdocument pages print mode |
int |
getprinttopage()
gets the pagenumber which you choose as the final page to printing. |
boolean |
getprintusingimagemode()
get print by using image mode |
pdfsectioncollection |
getsections()
gets the sections of a page |
pdfsecurity |
getsecurity()
gets the security parameters of the document. |
byte[] |
getsignatrecontuent(java.lang.string signname)
|
java.lang.object |
gettag()
|
pdfdocumenttemplate |
gettemplate()
gets the template of pdf document |
pdfusedfont[] |
getusedfonts()
gets the m_fonts which are available in the pdf document. |
boolean |
getusehighqualityimage()
indicates whether to use the high qulity image when convert document |
pdfviewerpreferences |
getviewerpreferences()
gets a viewer preferences object controlling the way the document is to be presented on the screen or in print. |
xmpmetadata |
getxmpmetadata()
|
float |
getzoomfator()
|
pdfpagebase |
insertpage(pdfdocument doc,
int pageindex)
imports a page. |
pdfpagebase |
insertpage(pdfdocument doc,
pdfpagebase page)
imports a page. |
pdfpagebase |
insertpagerange(pdfdocument doc,
int startindex,
int endindex)
imports a page range from a loaded document. |
static boolean |
isautooptimizingtextcolor()
|
static void |
isautooptimizingtextcolor(boolean autooptimizingtextcolor)
|
boolean |
isencrypted()
indicates the document is encrypted or not |
boolean |
isportfolio()
indicates the document is a pdf portfolio or not. |
void |
loadfrombytes(byte[] bytes)
initializes a new instance of the class. |
void |
loadfromfile(java.lang.string filename)
initializes a new instance of the class. |
void |
loadfromfile(java.lang.string filename,
fileformat fileformat)
|
void |
loadfromfile(java.lang.string filename,
java.lang.string password)
initializes a new instance of the class. |
void |
loadfromstream(java.io.inputstream stream)
initializes a new instance of the class. |
void |
loadfromxps(byte[] xpsbytes)
load a xps bytes array. |
void |
loadfromxps(java.io.inputstream xpsstream)
load a xps stream. |
void |
loadfromxps(java.lang.string filename)
load a xps file. |
static pdfdocumentbase |
merge(pdfdocumentbase dest,
java.lang.object... srcs)
merges the specified source documents and return destination document. |
static pdfdocumentbase |
mergefiles(java.io.inputstream[] inputstreams)
merges the pdf documents specified by the stream. |
static pdfdocumentbase |
mergefiles(java.lang.string[] inputfiles)
merges the pdf documents specified by the paths the array of string paths. |
static pdfdocumentbase |
mergefiles(java.lang.string firstinputfile,
java.lang.string secinputfile)
merges the pdf documents specified by the paths. |
java.awt.image.bufferedimage |
saveasimage(int pageindex)
saves pdf document page as bufferedimage |
java.awt.image.bufferedimage |
saveasimage(int pageindex,
pdfimagetype type)
saves pdf document page as image |
java.awt.image.bufferedimage |
saveasimage(int pageindex,
pdfimagetype type,
int dpix,
int dpiy)
saves pdf document page as image,set pdfimagetype and image dpi |
void |
savetofile(java.lang.string filename)
saves pdf document to file. |
void |
savetofile(java.lang.string filename,
fileformat fileformat)
saves pdf document to file. |
void |
savetofile(java.lang.string filename,
int startindex,
int endindex,
fileformat fileformat)
saves pdf document to other format files. |
void |
savetopdf(java.lang.string filename,
pdfconformancelevel pdfconformancelevel)
this is recreate pdf for pdf conformance. |
void |
savetopdfx1a2001(java.lang.string filename)
deprecated. |
java.io.bytearrayoutputstream[] |
savetostream(int startindex,
int endindex,
fileformat format)
|
void |
savetostream(java.io.outputstream stream)
saves the document to the specified stream. |
void |
savetostream(java.io.outputstream stream,
fileformat format)
|
void |
setafteropenaction(pdfaction value)
sets the action to execute when the document is opened. |
void |
setafterprintaction(pdfjavascriptaction value)
sets the action to be performed after the document is printed. |
void |
setaftersaveaction(pdfjavascriptaction value)
sets the jave script action to be performed after the document is saved. |
void |
setallowcreateform(boolean value)
|
void |
setbeforecloseaction(pdfjavascriptaction value)
|
void |
setbeforeprintaction(pdfjavascriptaction value)
|
void |
setbeforesaveaction(pdfjavascriptaction value)
sets the java script action to be performed before the document is saved. |
void |
setcolorspace( value)
sets the color space for page that will be created. |
void |
setcompressionlevel(pdfcompressionlevel value)
sets the desired level of stream compression. |
void |
setcustomhandlelandscape(boolean value)
set a value indicating handle pagesettings landscape. |
void |
setcustomscaling(int value)
set current pdf document print pagescaling |
void |
setdocprintdpi(int docprintdpi)
sets the dpi to print using image |
static void |
setenablefontcache(boolean value)
|
static void |
setexporttextenableocr(boolean enableocr)
|
static void |
setexporttextocrhandler(iocr iocr)
when export text,if have image ,will call iocr and add text to export content. |
static void |
setexporttextocrhandler(iocr iocr,
boolean enableocr)
|
void |
setfileinfo(pdffileinfo value)
set the file info int the pdf document |
void |
setpagenumber(pdfpagenumber value)
set the pdfpagelabel. |
void |
setpagescaling(pdfprintpagescaling value)
set pdfdocument print pagescaling |
void |
setpagesettings(pdfpagesettings value)
set a page settings in the pdf documents |
void |
setpdfstandard(pdfdocumentbase value)
set current active pdf object |
void |
setprintfrompage(int value)
sets the pagenumber which you choose as the start page to printing |
void |
setprintpagemode( value)
set pdfdocument pages print mode |
void |
setprinttopage(int value)
sets the pagenumber which you choose as the final page to printing. |
void |
setprintusingimagemode(boolean usingimagemode)
set print by using image mode |
void |
settag(java.lang.object value)
|
void |
setusehighqualityimage(boolean value)
|
void |
setusepsdirectlyforconvert(boolean value)
|
void |
setviewerpreferences(pdfviewerpreferences value)
sets a viewer preferences object controlling the way the document is to be presented on the screen or in print. |
void |
split(java.lang.string destfilepattern)
splits a pdf file to many pdf files, each of them consists of one page from the source file. |
void |
split(java.lang.string destfilepattern,
int startnumber)
splits a pdf file to many pdf files, each of them consists of one page from the source file. |
boolean |
verifysignature(java.lang.string signname)
verify signature int the pdf document |
constructor detail |
---|
public pdfdocument()
public pdfdocument(java.lang.string filename)
filename
- the path to source pdf file.this constructor imports an existing pdf file into the document object. it automatically populates the pages collection with the pages of the given document.
public pdfdocument(java.lang.string filename, java.lang.string password)
filename
- the path to source pdf document.password
- the password (user or owner) of the encrypted document.public pdfdocument(pdfconformancelevel pdflevel)
pdflevel
- public pdfdocument(byte[] bytes)
bytes
- the byte array with the file content.public pdfdocument(byte[] bytes, java.lang.string password)
bytes
- the byte array with the file content.password
- the password (user or owner) of the encrypted document.public pdfdocument(java.io.inputstream stream)
stream
- the stream with the file.public pdfdocument(java.io.inputstream stream, java.lang.string password)
stream
- the stream with the file.password
- the password (user or owner) of the encrypted document.method detail |
---|
public boolean getusehighqualityimage()
public void setusehighqualityimage(boolean value)
public boolean getallowcreateform()
public void setallowcreateform(boolean value)
public void setusepsdirectlyforconvert(boolean value)
public pdfconvertoptions getconvertoptions()
public pdfprintpagescaling getpagescaling()
public void setpagescaling(pdfprintpagescaling value)
public int getcustomscaling()
public void setcustomscaling(int value)
public pdfdocumentbase getpdfstandard()
public void setpdfstandard(pdfdocumentbase value)
public pdfconformancelevel getconformance()
public pdfattachmentcollection getattachments()
public pdfbookmarkcollection getbookmarks()
public getcolorspace()
public void setcolorspace( value)
public pdfdocumentinformation getdocumentinformation()
public getjavascripts()
public pdfform getform()
public pdfpagenumber getpagenumber()
public void setpagenumber(pdfpagenumber value)
public pdfpagecollection getpages()
public pdfusedfont[] getusedfonts()
public pdfcompressionlevel getcompressionlevel()
all new objects should be compressed with this level of the compression.
public void setcompressionlevel(pdfcompressionlevel value)
value
- public pdfpagesettings getpagesettings()
public void setpagesettings(pdfpagesettings value)
public pdfsectioncollection getsections()
public pdffileinfo getfileinfo()
public void setfileinfo(pdffileinfo value)
public pdfsecurity getsecurity()
public pdfviewerpreferences getviewerpreferences()
public void setviewerpreferences(pdfviewerpreferences value)
public pdfaction getafteropenaction()
public void setafteropenaction(pdfaction value)
public pdfjavascriptaction getafterprintaction()
public void setafterprintaction(pdfjavascriptaction value)
value
- public pdfjavascriptaction getaftersaveaction()
public void setaftersaveaction(pdfjavascriptaction value)
value
- public pdfjavascriptaction getbeforecloseaction()
public void setbeforecloseaction(pdfjavascriptaction value)
public pdfjavascriptaction getbeforeprintaction()
public void setbeforeprintaction(pdfjavascriptaction value)
public pdfjavascriptaction getbeforesaveaction()
public void setbeforesaveaction(pdfjavascriptaction value)
public xmpmetadata getxmpmetadata()
public pdfdocumenttemplate gettemplate()
public static boolean getenablefontcache()
public static void setenablefontcache(boolean value)
public java.lang.object gettag()
public void settag(java.lang.object value)
public boolean isencrypted()
public boolean isportfolio()
public pdflayercollection getlayers()
com.spire.ms.system.exception
public void dispose()
public void loadfromfile(java.lang.string filename, java.lang.string password)
filename
- the path to source pdf document.password
- the password (user or owner) of the encrypted document.public void loadfromfile(java.lang.string filename)
filename
- the path to source pdf file.this constructor imports an existing pdf file into the document object. it automatically populates the pages collection with the pages of the given document.
public void loadfromfile(java.lang.string filename, fileformat fileformat)
public void loadfromxps(byte[] xpsbytes)
xpsbytes
- the xps byte arraypublic void loadfromxps(java.lang.string filename)
filename
- public void loadfromxps(java.io.inputstream xpsstream)
xpsstream
- public void loadfrombytes(byte[] bytes)
bytes
- the byte array with the file content.public void loadfromstream(java.io.inputstream stream)
stream
- the stream with the file.public void createbooklet(java.lang.string filename, float width, float height, boolean doubleside)
filename
- booklet file namewidth
- booklet widthheight
- booklet heightdoubleside
- booklet double sidepublic void createbooklet(java.lang.string filename, double width, double height, boolean doubleside)
filename
- booklet namewidth
- booklet widthheight
- booklet heightdoubleside
- booklet doublesidepublic void createbooklet(java.lang.string filename, float width, float height, boolean doubleside, begindrawpage, enddrawpage)
filename
- booklet namewidth
- booklet widthheight
- booklet heightdoubleside
- booklet double sidebegindrawpage
- booklet begin draw pageenddrawpage
- booklet end draw pagepublic boolean verifysignature(java.lang.string signname)
signname
- sign name
public byte[] getsignatrecontuent(java.lang.string signname)
public void close()
the document is disposed after calling the close method. so, the document can not be saved if close method was invoked.
public void savetostream(java.io.outputstream stream)
stream
- the stream object where pdf document will be saved.public void savetostream(java.io.outputstream stream, fileformat format)
public java.io.bytearrayoutputstream[] savetostream(int startindex, int endindex, fileformat format)
public void savetofile(java.lang.string filename)
filename
- a relative or absolute path for the filepublic void savetofile(java.lang.string filename, fileformat fileformat)
filename
- a relative or absolute path for the filefileformat
- file format for the file@deprecated public void savetopdfx1a2001(java.lang.string filename)
filename
- public void savetopdf(java.lang.string filename, pdfconformancelevel pdfconformancelevel)
filename
- pdfconformancelevel
- public void savetofile(java.lang.string filename, int startindex, int endindex, fileformat fileformat)
filename
- a relative or absolute path for the filestartindex
- the start page index.the index starts at 0endindex
- the end page index.fileformat
- file format for the filepublic java.awt.image.bufferedimage saveasimage(int pageindex)
pageindex
- page with page index to save as image
public java.awt.image.bufferedimage saveasimage(int pageindex, pdfimagetype type)
pageindex
- page indextype
- pdfimagetype type
public java.awt.image.bufferedimage saveasimage(int pageindex, pdfimagetype type, int dpix, int dpiy)
pageindex
- page indextype
- pdfimagetype typedpix
- pictures x resolutiondpiy
- pictures y resolution
public java.lang.object deepclone()
the resulting clone must be of the same type as or a compatible type to the original instance.
public void appendpage(pdfdocument doc)
public pdfpagebase appendpage()
public pdfpagebase insertpage(pdfdocument doc, pdfpagebase page)
doc
- the loaded document.page
- the page.
public pdfpagebase insertpage(pdfdocument doc, int pageindex)
doc
- the loaded document.pageindex
- index of the page.
public pdfpagebase insertpagerange(pdfdocument doc, int startindex, int endindex)
doc
- the loaded document.startindex
- the start page index.endindex
- the end page index.
public static pdfdocumentbase merge(pdfdocumentbase dest, java.lang.object... srcs)
dest
- the source documents.
public static pdfdocumentbase mergefiles(java.lang.string[] inputfiles)
public static pdfdocumentbase mergefiles(java.io.inputstream[] inputstreams)
inputstreams
-
public static pdfdocumentbase mergefiles(java.lang.string firstinputfile, java.lang.string secinputfile)
firstinputfile
- secinputfile
-
public void split(java.lang.string destfilepattern)
destfilepattern
- template for destination file names.
public void split(java.lang.string destfilepattern, int startnumber)
public getprintpagemode()
public void setprintpagemode( value)
public float getzoomfator()
public int getprintfrompage()
public void setprintfrompage(int value)
public int getprinttopage()
public void setprinttopage(int value)
public boolean getcustomhandlelandscape()
public void setcustomhandlelandscape(boolean value)
public void setdocprintdpi(int docprintdpi)
public int getdocprintdpi()
public boolean getprintusingimagemode()
public void setprintusingimagemode(boolean usingimagemode)
public static void setexporttextocrhandler(iocr iocr)
iocr
- public static void setexporttextocrhandler(iocr iocr, boolean enableocr)
iocr
- enableocr
- public static iocr getexporttextocrhandler()
public static void setexporttextenableocr(boolean enableocr)
enableocr
- public static boolean getexporttextenableocr()
public static boolean isautooptimizingtextcolor()
public static void isautooptimizingtextcolor(boolean autooptimizingtextcolor)
|
|||||||||
prev class next class | frames no frames | ||||||||
summary: nested | field | constr | method | detail: field | constr | method |