![]() |
||
Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate |
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aspose.pdf.kit.Form
Represents a class which is used to modify AcroForms Field in existing pdf documents. Various form fields can be easily modified or flattened with APIs, including: -text field -list box field -combo box field -radio button box field -check box field Additionally, image button field can be filled with a specified image. It can be used like this:
//Open the document and create a Form object like this: Form form = new Form("Online.pdf", "output.pdf"); //Add a logo field at the top of each page like this: form.setWaterMark("newwatermark.jpg"); //Fill a text field like this: form.setField("fullName", "Luke Fu"); //Select a radio button like this: form.setField("gender", "male"); //Paste a image onto the existing button field like this: form.fillImageField("photo", "watermark.jpg"); //Choose a item from a combe box field like this: form.setField("bankList", "list Item3"); //Choose a item from a list field like this: form.setField("period", "1 year"); //Select a ckeck box like this: form.setField("pay", "Yes"); //Flatten all the fields like this: //form.allFlatten(); //Close the document like this: form.close();
Constructor Summary | |
Form(java.io.InputStream srcStream,
java.io.OutputStream dstStream)
Represents a constructor of the Form object with source stream and destination stream. |
|
Form(java.io.InputStream srcStream,
java.lang.String desFilename)
Represents a constructor of the Form object with source stream and destination file. |
|
Form(java.lang.String srcFilename,
java.io.OutputStream dstStream)
Represents a constructor of the Form object with source file and destination stream. |
|
Form(java.lang.String srcFilename,
java.lang.String desFilename)
Represents a constructor of the Form object with source file and destination file. |
Method Summary | |
void |
allFlatten()
Flattens all fields in the specified pdf document. |
void |
close()
Saves all the modifications and closes the destination file. |
void |
fillImageField(java.lang.String fieldName,
java.lang.String imageFilename)
Pastes an image onto the existing button field as its appearance. |
java.io.OutputStream |
getOutputStream()
The getter of the mDestStream member. |
void |
partialFlatten(java.lang.String fieldName)
Flattens part of the fields set in the specified pdf document. |
void |
setField(java.lang.String fieldName,
java.lang.String value)
Modifies the value of an existing field according to a specified field name. |
void |
setWaterMark(java.lang.String imageFilename)
Inserts an appointed watermark or logo field at the top of the pdf document. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Form(java.lang.String srcFilename, java.lang.String desFilename) throws java.lang.Exception
srcFilename
- The path of the input pdf file.desFilename
- The path of the output pdf file.
java.lang.Exception
- On error.public Form(java.lang.String srcFilename, java.io.OutputStream dstStream) throws java.lang.Exception
srcFilename
- The path of the input pdf file.dstStream
- The path of the output stream.
java.lang.Exception
- On error.public Form(java.io.InputStream srcStream, java.io.OutputStream dstStream) throws java.lang.Exception
srcStream
- The path of the input stream.dstStream
- The path of the output stream.
java.lang.Exception
- On error.public Form(java.io.InputStream srcStream, java.lang.String desFilename) throws java.lang.Exception
srcStream
- The path of the input stream.desFilename
- The path of the pdf file.
java.lang.Exception
- On error.Method Detail |
public void setField(java.lang.String fieldName, java.lang.String value) throws java.lang.Exception
fieldName
- The fully qualified field name.value
- The value to be appointed.
java.lang.Exception
public void partialFlatten(java.lang.String fieldName) throws java.lang.Exception
fieldName
- The fully qualified field name.
java.lang.Exception
- On flattening error.public void allFlatten() throws java.lang.Exception
java.lang.Exception
- On flattening error.public void close() throws java.lang.Exception
java.lang.Exception
- On closing error.public java.io.OutputStream getOutputStream() throws java.lang.Exception
java.lang.Exception
public void fillImageField(java.lang.String fieldName, java.lang.String imageFilename) throws PdfKitException, java.io.IOException
fieldName
- The fully qualified field name of the image button field.imageFilename
- The path of the image file, relative and absolute are both ok.
PdfKitException
java.io.IOException
public void setWaterMark(java.lang.String imageFilename) throws java.net.MalformedURLException, java.io.IOException, com.aspose.pdf.kit.BadElementException, PdfKitException
imageFilename
- The path of the watermark image or logo file,
relative and absolute are both ok.
java.net.MalformedURLException
java.io.IOException
com.aspose.pdf.kit.BadElementException
PdfKitException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |