![]() |
||
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.PdfFileInfo
Represents a class for accessing meta information of Pdf file.
[SampleCode] PdfFileInfo fileInfo = new PdfFileInfo(inFile); System.out.println("TITLE: " + fileInfo.getTitle()); System.out.println("AUTHOR:" + fileInfo.getAuthor()); System.out.println("CREATIONDATE:" + fileInfo.getCreationDate()); System.out.println("CREATOR:" + fileInfo.getCreator()); System.out.println("KeyWORDS:" + fileInfo.getKeywords()); System.out.println("MODDATE:" + fileInfo.getModDate()); HashMap header = fileInfo.getHeader(); Object[] headerKeys = header.keySet().toArray(); for (int hIndex = 0; hIndex < headerKeys.length; hIndex++) { System.out.println(headerKeys[hIndex].toString() + ":" + header.get(headerKeys[hIndex].toString())); }
Constructor Summary | |
PdfFileInfo(java.io.InputStream inputStream)
Creates a PdfFileInfo object instance, and reads input Pdf Stream. |
|
PdfFileInfo(java.lang.String inputFile)
Creates a PdfFileInfo object instance, and reads input Pdf file. |
Method Summary | |
boolean |
beEncrypted()
Checkes whether the Pdf file is encrypted. |
void |
clearInfo()
Clears all changeable information of Pdf file. |
java.lang.String |
getAuthor()
Gets the Author information of Pdf file. |
java.lang.String |
getCreationDate()
Gets the CreationDate information of Pdf file. |
java.lang.String |
getCreator()
Gets the Creator information of Pdf file. |
java.util.HashMap |
getHeader()
Gets the customized information of Pdf file. |
java.lang.String |
getKeywords()
Gets the Keywords information of Pdf file. |
java.lang.String |
getMetaInfo(java.lang.String name)
Gets customized information of Pdf file with property name. |
java.lang.String |
getModDate()
Gets the modified date information of Pdf file. |
int |
getNumberofPages()
Gets the number of file pages. |
float |
getPageHeight(int pageNum)
Gets the height size of the specified page. |
int |
getPageRotation(int pageNum)
Gets the rotation of the specified page. |
float |
getPageWidth(int pageNum)
Gets the width size of the specified page. |
java.lang.String |
getProducer()
Gets the Producer information of Pdf file. |
java.lang.String |
getSubject()
Gets the Subject information of Pdf file. |
java.lang.String |
getTitle()
Gets the Title information of Pdf file. |
boolean |
saveNewInfo(java.io.OutputStream outStream)
Changes the properties specified explicitly by setting file information, other properties remain. |
boolean |
saveNewInfo(java.lang.String outputFile)
Changes the meta-information specified explicitly by setting file information, other information remains. |
void |
setAuthor(java.lang.String author)
Sets the Author information of Pdf file. |
void |
setCreator(java.lang.String creator)
Sets the Creator information of Pdf file. |
void |
setHeader(java.util.HashMap header)
Sets the customized information of Pdf file. |
void |
setKeywords(java.lang.String keywords)
Sets the Keywords information of Pdf file. |
void |
setMetaInfo(java.lang.String name,
java.lang.String value)
Sets customized information of Pdf file with property name and property value. |
void |
setSubject(java.lang.String subject)
Sets the Subject information of Pdf file. |
void |
setTitle(java.lang.String title)
Sets the Title information of Pdf file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PdfFileInfo(java.lang.String inputFile) throws java.io.IOException
inputFile
- String Input Pdf file path.
java.io.IOException
public PdfFileInfo(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- InputStream Input Pdf Stream.
java.io.IOException
Method Detail |
public int getNumberofPages()
public boolean beEncrypted()
public java.lang.String getAuthor()
public void setAuthor(java.lang.String author)
author
- String New author of the file.public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- String New Title infomation of Pdf file.public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
subject
- String New Subject information of Pdf file.public java.lang.String getCreator()
public void setCreator(java.lang.String creator)
creator
- String New Creator information of Pdf file.public java.lang.String getKeywords()
public void setKeywords(java.lang.String keywords)
keywords
- String New Keywords information of Pdf file.public java.util.HashMap getHeader()
public void setHeader(java.util.HashMap header)
header
- HashMap New customized meta information of Pdf file.public java.lang.String getCreationDate()
public java.lang.String getProducer()
public java.lang.String getModDate()
public boolean saveNewInfo(java.lang.String outputFile) throws java.io.IOException, PdfKitException, java.io.IOException
outputFile
- String Output Pdf file name.
java.io.IOException
PdfKitException
java.io.IOException
public boolean saveNewInfo(java.io.OutputStream outStream) throws PdfKitException, java.io.IOException
[SampleCode] String inFile = "example1.pdf"; String outFile = "kitOut.pdf"; HashMap header = new HashMap(); header.put("Zone", "+800"); PdfFileInfo fileInfo = new PdfFileInfo(inFile); fileInfo.setAuthor("William"); fileInfo.setTitle("Hello"); fileInfo.setSubject("Peace"); fileInfo.setKeywords("A,B"); fileInfo.setHeader(null); fileInfo.saveNewInfo(outFile);
outStream
- OutputStream Output Pdf Stream.
PdfKitException
java.io.IOException
public void clearInfo()
public float getPageHeight(int pageNum) throws java.io.IOException
pageNum
- int Indicate the page.
java.io.IOException
public float getPageWidth(int pageNum) throws java.io.IOException
pageNum
- int Indicate the page.
java.io.IOException
public int getPageRotation(int pageNum) throws java.lang.Exception
pageNum
- int Indicate which page.
java.lang.Exception
public java.lang.String getMetaInfo(java.lang.String name)
name
- meta property's name.
public void setMetaInfo(java.lang.String name, java.lang.String value)
name
- meta property's name.value
- meta property's value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |