aspose.pdf
Class Pdf

java.lang.Object
  extended by aspose.pdf.Pdf

public class Pdf
extends java.lang.Object

Represents the Pdf document.

Typical usages are the following:

In case you use Java 1.4 you must set system property "aspose.pdf.fontpath" before to create first Pdf object

[Java] Pdf pdf = new Pdf(); pdf.setTruetypeFontMapPath("d:/temp"); pdf.setIsTruetypeFontMapCached(true); //You can start your app with java -Daspose.pdf.fontpath=c:/windows/fonts instead pdf.setTruetypeFontDirectoryPath("c:/windows/fonts"); Section sec = pdf.getSections().add(); Text t1 = new Text("Arial"); t1.getSegments().getSegment(0).getTextInfo().setFontName("Arial"); sec.getParagraphs().add(t1); pdf1.save(....); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section PageHeight="1684"> <Text MarginTop="30"> <Segment FontName="Arial">Arial</Segment> </Text> </Section> </Pdf>


Field Summary
 Paragraphs bkFootNotes
          Indicates the backup footnote paragraphs.
 int[] CurrentBookmarkIds
          Indicates the array used to store the current bookmark Ids.
 Text currentTextInAll
          Indicates the current Text.
 TextInfo curSegTextInfo
          Indicates the TextInfo of the current Segment.
 java.util.Locale CustomLocale
          Indicates the custom locale as the value Locale.US.
 boolean firstItem
          Indicates the object is first item or not.
 boolean firstItemInOL
          Indicates the object is first item in OL or not.
 float FootNoteCurPosInMultiSegProcessing
          Indicates the current position of the footnote in multiple segments.
 float FootNoteHeightSum
          Indicates the footnote height.
 float FootNotePageBottom
          Indicates the footnote page bottom.
 Paragraphs footnoteParas
          Indicates the footnote Paragraph arrays.
 aspose.pdf.pdftext.Hashmap ImagePath
          ImagePath is used to save all of the paths of Image ,in order to delete these files.
 boolean IsContainsTable
          Indicates the pdf contains table or not.
 boolean IsFirstPage
          Indicates the page is the first page or not.
 boolean IsFirstPageCreated
          Indicates whether this is the first page or not.
 boolean IsFromHtml
          Indicates the document is from html or not.
 boolean IsFromRS
          Indicates the document is from Rs or not.
 boolean IsRowBrokenForFixedHeight
          Indicates whether break the row by fixed height or not.
 boolean isSamePage
          Indicates this is same page or not.
 boolean IsSaveCalled
          Indicates whether save has been called or not.
 boolean IsSaveState
          Indicates whether the document is in saving state
 boolean IsSecuritySet
          Indicates whether the security of the document has been set.
 java.util.Locale OriginalLocale
          Indicates default original locale.
 boolean PageHaveFootLine
          Indicates the page have footline or not.
 java.util.ArrayList<Paragraph> parsedObject
          Indicates the parsed objects.
 Heading pre1
          Indicates the Heading object.
 Paragraph preParagraph
          Indicates the previous paragraph.
 int RefPageID
          User access #$REFPAGE the corresponding unique ID.
 GeneratorBase TempGenerator1
          Initializes a new instance of the GeneratorBase class.
 int tempNumberOfFootNoteInDoc
          Indicates the temp number of the footnote in this document.
 java.util.ArrayList ToBeFreed
          The resources need to be released after the PDF is been generated To avoid memory leaks
 java.lang.String Url
          Indicates the url.
 
Constructor Summary
Pdf()
          Initializes a new instance of the Pdf class for Evaluation License.
Pdf(BinaryFileStream docStream)
          Initializes a new instance of the Pdf class for Evaluation License.
 
Method Summary
 void bindPCL(java.lang.String pclFileName)
          Binds an PCL document to the Pdf object.
 void bindXML(java.io.InputStream xmlFile, java.io.InputStream xslFile)
          Binds an xml/xsl document to the Pdf object.
 void bindXML(java.lang.String xmlFile, java.lang.String xslFile)
          Binds an xml/xsl document to the Pdf object.
 void bindXML(TextFileStream xmlStream, TextFileStream xslStream)
          Binds an xml/xsl stream to the Pdf object.
 void bindXML(XMLDocument xmlDoc, java.lang.String xslFile)
          Binds an xml/xsl document to the Pdf object.
 void checkWatermark(Sections sections)
          Represents a checkWatermark action.
 void close()
          Close the document.
static java.lang.Object CreateObjFromXml(java.lang.String xmlFile, java.lang.String xslFile)
          Create object from an xml/xsl document.
static java.lang.Object CreateObjFromXml(TextFileStream xmlStream, TextFileStream xslStream)
          Create object from an xml/xsl stream.
static java.lang.Object createObjFromXml(XMLDocument xmlDoc, XslTransform xsl)
          Reads object info from a xml document.
static MemStream CreateTruetypeFontMapStream()
          Creates the TrueType font map stream.
 AssignInfo getAssignInfo()
          Gets a AssignInfo value that indicates the page assignment info.
 void getAssignInfo(AssignInfo value)
          Sets a BinaryFileStream value that indicates the page assignment info.
 java.lang.String getAuthor()
          Gets a string that indicates the author of the Pdf document.
 Color getBackgroundColor()
          Gets a Color object that indicates the background color of the pdf.
 Section getBackupSection()
          It is use to store the header and footer on odder page of mirror margin
 TextInfo getBackupTextInfo()
          Gets the TextInfo object that indicates the backup TextInfo of the document.
 int getBookMarkLevel()
          Gets a int value that indicates how many levels of Heading of the pdf document is to be bookmarked.
 Bookmarks getBookmarks()
          Gets a Bookmarks object that indicates the bookmarks in the PDF.
 byte[] getBuffer()
          Gets the data buffer used to generate the pdf document in memory.
 int getCompressionLevel()
          Gets an int value that indicates the compression level.
 PdfConformance getConformance()
          
NOTE: This is beta version of PdfA.
 int getConsecutiveHyphens()
          Gets the number of consecutive hyphens.
 void getConsecutiveHyphens(int value)
          Gets the number of consecutive hyphens.
 int getConsecutiveHyphensLimits()
          Gets an integer value that indicates the consecutive hyphens limits.
 java.lang.String getCreator()
          Gets a String that indicates the creator of the Pdf document.
 Text getCurrentTextInAll()
          Gets a Text object that indicates the current Text
 TextInfo getCurSegTextInfo()
          Gets a TextInfo object that indicates the TextInfo of the current Segment
 CustomFonts getCustomFonts()
          Gets a CustomFonts object that indicates the custom fonts of the document.
 java.util.Locale getCustomLocale()
          Gets the custom locale information.
 java.lang.String getDefaultFontName()
          Gets a string that indicates the default font name.
 DestinationType getDestinationType()
          Gets or sets a DestinationType value that indicates the document open action.
 BinaryFileStream getDocStream()
          Gets a BinaryFileStream value that indicates the stream of the document.
 DocumentAttachments getDocumentAttachments()
          Gets a DocumentAttachments which will be added upon the PDF document.
 void getDocumentAttachments(DocumentAttachments value)
          Sets a DocumentAttachments which will be added upon the PDF document.
 int getEndNoteNumberInDoc()
          Gets an integer value that indicates the endnote number in this document
 Heading getFirstHeading()
          Represents a Heading object that indicates the first heading in this document.
 boolean getFirstItemInOL()
          Gets a boolean value that indicates the object is first item in OL or not.
 int getFirstLineIndent()
          Gets an int value that indicates the indent of the first line.
 aspose.pdf.xml.Substitute getFirstSubstitute()
          Gets a Substitute object that indicates the first substitutor in the document.
 int getFootNoteNumberInDoc()
          Gets an integer value that indicates the footnote number in this document
 GeneratorBase getGeneratorBase()
          Gets the GeneratorBase object that indicates the GeneratorBase of the document.
 GraphInfo getGraphInfo()
          Gets a GraphInfo object that indicates the graph info in the Pdf document.
 HeadingInfoArray getHeadingInfos()
          Gets a HeadingInfoArray object that indicates the heading info.
 aspose.pdf.html.HtmlInfo getHtmlInfo()
          Gets a aspose.pdf.html.HtmlInfo object that indicates the necessary info when converting
 java.lang.String getHyphenationDictionaryPath()
          Gets a string that indicates the hyphenation dictionary path.
 float getHyphenationZoneWidth()
          Gets a float value that indicates the hyphenation area width.
 aspose.pdf.pdftext.Hashmap getHyphenDicMap()
          Gets the number of consecutive hyphens.
 XMLDocument getHyphenDictionary()
          Gets a hyphenation Dictionary file.
 aspose.pdf.pdftext.Hashmap getImagePath()
          Gets a Hashmap object that indicates the Image path.
 boolean getIsAutoFontAdjusted()
          Gets a boolean value that indicates whether allow to adjust fonts automatically.
 void getIsAutoFontAdjusted(boolean value)
          Gets a boolean value that indicates whether allow to adjust fonts automatically.
 boolean getIsAutoHyphenated()
          Gets a bool value that indicates whether the text is hyphenated automatically.
 boolean getIsBookmarked()
          Gets a bool value that indicates whether the pdf document is bookmarked when generating PDF document.
 boolean getIsBuffered()
          Gets a bool value that indicates whether memory buffer is used when generating PDF document.
 boolean getIsCoreFontUsed()
          Gets a bool value that indicates whether PDF core fonts are used.
 boolean getIsFirstPageCreated()
          Gets a boolean value that indicates whether this is the first page or not.
 boolean getIsFontMapCreated()
          Gets a boolean value that indicates whether the font map has been created or not.
 boolean getIsFontNotFoundExceptionThrown()
          Gets a bool value that indicates whether throw out exception when font is not found.
 boolean getIsImagesInXmlDeleteNeeded()
          Gets a bool value that indicates whether images used in XML be deleted when the PDF document is generated.
 boolean getIsLandscape()
          Gets a bool value that indicates whether the page orientation is landscape.
 boolean getIsPageNumberForDocument()
          Gets a bool value that indicates whether the "image not found" error is ignored or not.
 boolean getIsPageNumberRestarted()
          Gets a bool value that indicates whether the page number is restarted in new section.
 boolean getIsRightToLeft()
          Gets a bool value that indicates whether the text or heading appear in the pdf is right-to-left aligned.
 boolean getIsRtlInSegmentMode()
          Gets a bool value that indicates whether the text or heading is processed in segment mode.
 boolean getIsSaveState()
          Gets the boolean value that indicates whether the document is in saving state.
 boolean getIsSegmentMerged()
          Gets a bool value that indicates whether the segments with same format are merged into one.
 boolean getIsSpaced()
          Gets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown.
 boolean getIsTruetypeFontMapCached()
          Gets a bool value that indicates whether truetype font map be cached on disk.
 boolean getIsWatermarkOnTop()
          Gets a bool value that indicates if the watermark is on top of the page.
 boolean getIsWidowOrphanControlEnabled()
          Gets a bool value that indicates whether the Widow/Orphan control is enabled.
 boolean getIsXmlSchemaCheckedOnBind()
          Gets a bool value that indicates whether the error is ignored when unknown elements or attributes are used in xml file.
 JavaScripts getJavaScripts()
          Gets a JavaScripts object that indicates the JavaScripts to be added into the PDF.
 java.lang.String getKeywords()
          Gets a string that indicates key words of the Pdf document.
 float getLabelWidth()
          Gets a float value that indicates the width of the heading label.
 aspose.pdf.xml.Substitute getLastSubstitute()
          Gets a Substitute object that indicates the last substitutor in the document.
 boolean getLinearized()
          Gets a bool value that indicates if the document needs to be linearized (optimization for web access) .
 ListSection getListOfFigures()
          Gets a ListSection object that indicates the list of figures.
 ListSection getListOfTables()
          Gets a ListSection object that indicates the list of table.
 java.lang.Object getObjectByID(java.lang.String ID)
          Gets a object with specified ID in the document.
 OpenType getOpenType()
          Gets a OpenType that indicates the document open type.
 int getPageCount()
          Gets a int value that indicates the pages count of the generated PDF.
 int getPageDuration()
          Gets a int value that indicates the duration in seconds for the current page.
 int GetPageNumber(java.lang.String ID)
          Gets the page number of a paragraph when the PDF is generated.
 PageNumberFormatType getPageNumberFormat()
          Gets a PageNumberFormatType value that indicates the format of the page number .
 aspose.pdf.xml.Page getPages()
          Gets a Page object that indicates the pages chain contains in this document.
 PageSetup getPageSetup()
          Gets a PageSetup object that indicates the page setup info in the Pdf document.
 int getPagesNumber()
          Represents an int value that indicates the current pages number.
 PageTransitionType getPageTransitionType()
          Gets a PageTransitionType that indicates the pdf document page transition type.
 java.lang.String getPdfXslFile()
          Gets a String value that indicates document's xsl file.
 java.lang.String getProducer()
          Gets a string that indicates the producer of the Pdf document.
 int getRefPageID()
          Gets a int value that indicates User access #$REFPAGE the corresponding unique ID.
 Sections getSections()
          Gets a Sections collection that indicates all sections in the Pdf document.
 Security getSecurity()
          Gets a Security object that indicates the document security information.
 float GetStringWidth(java.lang.String str, TextInfo info)
          Gets the string width in PDF with specified text formatting.
 java.lang.String getSubject()
          Gets a string that indicates the subject of the Pdf document.
 ListSection getTableOfContents()
          Gets a ListSection object that indicates the table of contents.
 float getTabStopPosition()
          Gets the tab stop position.
 GeneratorBase getTempGenerator()
          Gets a GeneratorBase object that indicates the temp generator.
 GeneratorBase getTempGenerator1()
          Gets a GeneratorBase object that indicates the temp generator.
 TextInfo getTextInfo()
          Gets a TextInfo object that indicates the text info in the Pdf document.
 void getTextInfo(TextInfo value)
          Sets a TextInfo object that indicates the text info in the Pdf document.
static int getTimeOutOfFileWebRequest()
          Gets the length of time until the request times out for the Pdf document.
 java.lang.String getTitle()
          Gets a string that indicates the creator of the Pdf document.
 java.util.ArrayList getToBeFreed()
          Gets an ArrayList that indicates The resources need to be released after the PDF is been generated To avoid memory leaks
 java.lang.String getTruetypeFontDirectoryPath()
          Gets a string that indicates the path of the truetype font directory.
 java.lang.String getTruetypeFontMapPath()
          Gets a string that indicates the path of the truetype font map file.
 MemStream getTruetypeFontMapStream()
          Gets a memory stream that indicates the TrueType font map stream.
 void getTruetypeFontMapStream(MemStream value)
          Sets a memory stream that indicates the TrueType font map stream.
 Watermarks getWatermarks()
          Gets a Watermarks which will be added upon each page of the PDF document.
 java.lang.String getXmlFilePath()
          Gets a String value that indicates the xml file path.
 XmpMetadata getXmpMetadata()
          Gets a XmpMetadata Object that indicates the XMP metadata to be added into the PDF document.
 void PdfInit()
          Complete the initiation of the pdf document.
 void pdfInitForMultiSave()
          Complete the initiation of the pdf document for multiple save.
 void ProcessLists()
          Add Lists to the pdf document if the user has specified the list.
 void save(BasicStream stream)
          Generates Pdf document and put it to a BasicStream object.
 void save(java.io.OutputStream stream)
          Generates Pdf document and put it to a OutputStream object.
 void save(java.lang.String pdfFile)
          Generates Pdf document and saves it.
 void save(java.lang.String fileName, SaveType saveType, aspose.pdf.HttpResponse response)
          Generates Pdf document and sends it to the client browser.
 void setAuthor(java.lang.String value)
          Sets a string that indicates the author of the Pdf document.
 void setBackgroundColor(Color value)
          Sets a Color object that indicates the background color of the pdf.
 void setBackupSection(Section value)
          It is use to store the header and footer on odder page of mirror margin
 void setBackupTextInfo(TextInfo value)
          Sets the TextInfo object that indicates the backup TextInfo of the document.
 void setBookmarkLevel(int value)
          Gets a int value that indicates how many levels of Heading of the pdf document is to be bookmarked.
 void setBookMarkLevel(int value)
          Deprecated. Obsolete. Will be deleted in 12 months, Date: May 15, 2012. Use setBookmarkLevel(int) instead.
 void setBookmarks(Bookmarks value)
          Sets a Bookmarks object that indicates the bookmarks in the PDF.
 void setCompressionLevel(int value)
          Sets an int value that indicates the compression level.
 void setConformance(PdfConformance value)
          
NOTE: This is beta version of PdfA.
 void setConsecutiveHyphens(int ch)
          Sets the number of consecutive hyphens.
 void setConsecutiveHyphensLimits(int value)
          Sets an integer value that indicates the consecutive hyphens limits.
 void setCreator(java.lang.String value)
          Sets a String that indicates the creator of the Pdf document.
 void setCurrentTextInAll(Text CurrentTextInAll)
          Sets a Text object that indicates the current Text
 void setCurSegTextInfo(TextInfo curSegTextInfo)
          Sets a TextInfo object that indicates the TextInfo of the current Segment
 void setCustomFonts(CustomFonts value)
          Sets a Security object that indicates the custom fonts of the document.
 void setDefaultFontName(java.lang.String value)
          Sets a string that indicates the default font name.
 void setDestinationType(DestinationType value)
          Sets or sets a DestinationType value that indicates the document open action.
 void setDocStream(BinaryFileStream value)
          Sets a BinaryFileStream value that indicates the stream of the document.
 void setEndNoteNumberInDoc(int value)
          Sets an integer value that indicates the endnote number in this document
 void setFirstHeading(Heading value)
          Sets the Heading object that indicates the first heading in this document.
 void setFirstItemInOL(boolean fio)
          Sets a boolean value that indicates the object is first item in OL or not.
 void setFirstLineIndent(int value)
          Sets an int value that indicates the indent of the first line.
 void setFirstSubstitute(aspose.pdf.xml.Substitute value)
          Sets a Substitute object that indicates the first substitutor in the document.
 void setFootNoteNumberInDoc(int value)
          Sets an integer value that indicates the footnote number in this document
 void setGeneratorBase(GeneratorBase value)
          Sets the GeneratorBase object that indicates the GeneratorBase of the document.
 void setGraphInfo(GraphInfo value)
          Sets a GraphInfo object that indicates the graph info in the Pdf document.
 void setHeadingInfos(aspose.pdf.xml.HeadingInfoArray value)
          Sets a HeadingInfoArray object that indicates the heading info.
 void setHtmlInfo(aspose.pdf.html.HtmlInfo value)
          Sets a aspose.pdf.html.HtmlInfo object that indicates the necessary info when converting
 void setHyphenationDictionaryPath(java.lang.String value)
          Sets a string that indicates the hyphenation dictionary path.
 void setHyphenationZoneWidth(float value)
          Sets a float value that indicates the hyphenation area width.
 void setHyphenDicMap(aspose.pdf.pdftext.Hashmap value)
          Sets the number of consecutive hyphens.
 void setHyphenDictionary(XMLDocument value)
          Sets a hyphenation Dictionary file.
 void setImagePath(aspose.pdf.pdftext.Hashmap ImagePath)
          Sets a Hashmap object that indicates the Image path.
 void setIsAutoHyphenated(boolean value)
          Sets a bool value that indicates whether the text is hyphenated automatically.
 void setIsBookmarked(boolean value)
          Sets a bool value that indicates whether the pdf document is bookmarked when generating PDF document.
 void setIsBuffered(boolean value)
          Sets a bool value that indicates whether memory buffer is used when generating PDF document.
 void setIsCoreFontUsed(boolean value)
          Sets a bool value that indicates whether PDF core fonts are used.
 void setIsFirstPageCreated(boolean IsFirstPageCreated)
          Gets a boolean value that indicates whether this is the first page or not.
 void setIsFontMapCreated(boolean value)
          Sets a boolean value that indicates whether the font map has been created or not.
 void setIsFontNotFoundExceptionThrown(boolean value)
          Sets a bool value that indicates whether throw out exception when font is not found.
 void setIsImagesInXmlDeleteNeeded(boolean value)
          Sets a bool value that indicates whether images used in XML be deleted when the PDF document is generated.
 void setIsLandscape(boolean value)
          Sets a bool value that indicates whether the page orientation is landscape.
 void setIsPageNumberForDocument(boolean value)
          Sets a bool value that indicates whether the "image not found" error is ignored or not.
 void setIsPageNumberRestarted(boolean value)
          Sets a bool value that indicates whether the page number is restarted in new section.
 void setIsRightToLeft(boolean value)
          Sets a bool value that indicates whether the text or heading appear in the pdf is right-to-left aligned.
 void setIsRtlInSegmentMode(boolean value)
          Sets a bool value that indicates whether the text or heading is processed in segment mode.
 void setIsSaveState(boolean IsSaveState)
          Sets the boolean value that indicates whether the document is in saving state.
 void setIsSegmentMerged(boolean value)
          Sets a bool value that indicates whether the segments with same format are merged into one.
 void setIsSpaced(boolean value)
          Sets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown.
 void setIsTruetypeFontMapCached(boolean value)
          Sets a bool value that indicates whether truetype font map be cached on disk.
 void setIsWatermarkOnTop(boolean value)
          Sets a bool value that indicates if the watermark is on top of the page.
 void setIsWidowOrphanControlEnabled(boolean value)
          Sets a bool value that indicates whether the Widow/Orphan control is enabled.
 void setIsXmlSchemaCheckedOnBind(boolean value)
          Sets a bool value that indicates whether the error is ignored when unknown elements or attributes are used in xml file.
 void setJavaScripts(JavaScripts value)
          Sets a JavaScripts object that indicates the JavaScripts to be added into the PDF.
 void setKeywords(java.lang.String value)
          Sets a string that indicates key words of the Pdf document.
 void setLabelWidth(float value)
          Sets a float value that indicates the width of the heading label.
 void setLastSubstitute(aspose.pdf.xml.Substitute value)
          Sets a Substitute object that indicates the last substitutor in the document.
static void setLicense(java.lang.String licenseFile)
          Obsolete.
 void setLinearized(boolean value)
          Sets a bool value that indicates if the document needs to be linearized (optimization for web access) .
 void setOpenType(OpenType value)
          Sets a OpenType that indicates the document open type.
 void setPageDuration(int value)
          Sets a int value that indicates the duration in seconds for the current page.
 void setPageNumberFormat(PageNumberFormatType value)
          Sets a PageNumberFormatType value that indicates the format of the page number .
 void setPages(aspose.pdf.xml.Page value)
          Sets a Page object that indicates the pages chain contains in this document.
 void setPageSetup(PageSetup value)
          Sets a PageSetup object that indicates the page setup info in the Pdf document.
 void setPagesNumber(int value)
          Represents an int value that indicates the current pages number.
 void setPageTransitionType(PageTransitionType value)
          Sets a PageTransitionType that indicates the pdf document page transition type.
 void setPdfXslFile(java.lang.String value)
          Sets a String value that indicates document's xsl file.
 void setProducer(java.lang.String value)
          Sets a string that indicates the producer of the Pdf document.
 void setRefPageID(int rd)
          Sets a int value that indicates User access #$REFPAGE the corresponding unique ID.
 void setSections(Sections value)
          Sets a Sections collection that indicates all sections in the Pdf document.
 void setSecurity()
          Set security of the document.
 void setSecurity(Security value)
          Sets a Security object that indicates the document security information.
 void setSubject(java.lang.String value)
          Sets a string that indicates the subject of the Pdf document.
 void setTabStopPosition(float value)
          Sets the tab stop position.
 void setTempGenerator(GeneratorBase value)
          Sets a GeneratorBase object that indicates the temp generator.
 void setTempGenerator1(GeneratorBase TempGenerator1)
          Sets a GeneratorBase object that indicates the temp generator.
static void setTimeOutOfFileWebRequest(int value)
          Sets the length of time until the request times out for the Pdf document.
static void setTimeOutOfFileWebRequest(java.net.URI url)
          Sets the FileWebRequest.Timeout property for the web images.
 void setTitle(java.lang.String value)
          Sets a string that indicates the creator of the Pdf document.
 void setToBeFreed(java.util.ArrayList ToBeFreed)
          Sets an ArrayList that indicates The resources need to be released after the PDF is been generated To avoid memory leaks
 void setTruetypeFontDirectoryPath(java.lang.String value)
          Sets a string that indicates the path of the truetype font directory.
 void setTruetypeFontMapPath(java.lang.String value)
          Sets a string that indicates the path of the truetype font map file.
 void SetUnicode()
          Sets all fonts in the document to be unicode.
 void setWatermarks(Watermarks value)
          Sets a Watermarks which will be added upon each page of the PDF document.
 void setXmlFilePath(java.lang.String value)
          Sets a String value that indicates the xml file path.
 void setXmpMetadata(XmpMetadata value)
          Sets a XmpMetadata Object that indicates the XMP metadata to be added into the PDF document.
static java.lang.String version()
          Deprecated. @see BuildVersionInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OriginalLocale

public java.util.Locale OriginalLocale
Indicates default original locale.


CustomLocale

public java.util.Locale CustomLocale
Indicates the custom locale as the value Locale.US.


preParagraph

public Paragraph preParagraph
Indicates the previous paragraph.


parsedObject

public java.util.ArrayList<Paragraph> parsedObject
Indicates the parsed objects.


IsContainsTable

public boolean IsContainsTable
Indicates the pdf contains table or not.


Url

public java.lang.String Url
Indicates the url.


curSegTextInfo

public TextInfo curSegTextInfo
Indicates the TextInfo of the current Segment.


currentTextInAll

public Text currentTextInAll
Indicates the current Text.


pre1

public Heading pre1
Indicates the Heading object.


firstItem

public boolean firstItem
Indicates the object is first item or not.


firstItemInOL

public boolean firstItemInOL
Indicates the object is first item in OL or not.


footnoteParas

public Paragraphs footnoteParas
Indicates the footnote Paragraph arrays.


FootNotePageBottom

public float FootNotePageBottom
Indicates the footnote page bottom.


FootNoteCurPosInMultiSegProcessing

public float FootNoteCurPosInMultiSegProcessing
Indicates the current position of the footnote in multiple segments.


bkFootNotes

public Paragraphs bkFootNotes
Indicates the backup footnote paragraphs.


FootNoteHeightSum

public float FootNoteHeightSum
Indicates the footnote height.


isSamePage

public boolean isSamePage
Indicates this is same page or not.


PageHaveFootLine

public boolean PageHaveFootLine
Indicates the page have footline or not.


tempNumberOfFootNoteInDoc

public int tempNumberOfFootNoteInDoc
Indicates the temp number of the footnote in this document.


IsFromHtml

public boolean IsFromHtml
Indicates the document is from html or not.


IsSaveCalled

public boolean IsSaveCalled
Indicates whether save has been called or not.


CurrentBookmarkIds

public int[] CurrentBookmarkIds
Indicates the array used to store the current bookmark Ids.


TempGenerator1

public GeneratorBase TempGenerator1
Initializes a new instance of the GeneratorBase class.


ImagePath

public aspose.pdf.pdftext.Hashmap ImagePath
ImagePath is used to save all of the paths of Image ,in order to delete these files. The reason is to facilitate the use of hashmap to find and additional


IsFirstPageCreated

public boolean IsFirstPageCreated
Indicates whether this is the first page or not.


RefPageID

public int RefPageID
User access #$REFPAGE the corresponding unique ID. After each time to obtain the value plus 1, to ensure that only.


IsFirstPage

public boolean IsFirstPage
Indicates the page is the first page or not.


ToBeFreed

public java.util.ArrayList ToBeFreed
The resources need to be released after the PDF is been generated To avoid memory leaks


IsSaveState

public boolean IsSaveState
Indicates whether the document is in saving state. *


IsSecuritySet

public boolean IsSecuritySet
Indicates whether the security of the document has been set.


IsFromRS

public boolean IsFromRS
Indicates the document is from Rs or not.


IsRowBrokenForFixedHeight

public boolean IsRowBrokenForFixedHeight
Indicates whether break the row by fixed height or not.

Constructor Detail

Pdf

public Pdf()
Initializes a new instance of the Pdf class for Evaluation License.

Remarks: It can be used in both Windows Forms applications and Web Forms applications when the license type is Evaluation License.


Pdf

public Pdf(BinaryFileStream docStream)
Initializes a new instance of the Pdf class for Evaluation License. You can use SetLicense method to set license if you have purchased license.If you use this constructor,the component will work in direct-to-file or direct-to-stream mode. That means all paragraphs will be rendered into pdf file or stream without being saved in the document object model. Less memory will be consumed in this mode,but you can't access the paragraphs that be added into the document any more, so some of the advanced features such as combination of XML and API,hyperlink to specified paragraph,total page number in footer,etc.,is not available.

Parameters:
docStream - The stream to write the document.
Method Detail

version

public static java.lang.String version()
Deprecated. @see BuildVersionInfo

Gets the version of Aspose Pdf.


getCustomLocale

public java.util.Locale getCustomLocale()
Gets the custom locale information.


getCurSegTextInfo

public TextInfo getCurSegTextInfo()
Gets a TextInfo object that indicates the TextInfo of the current Segment

Returns:
A TextInfo object.

setCurSegTextInfo

public void setCurSegTextInfo(TextInfo curSegTextInfo)
Sets a TextInfo object that indicates the TextInfo of the current Segment

Parameters:
curSegTextInfo -

getCurrentTextInAll

public Text getCurrentTextInAll()
Gets a Text object that indicates the current Text

Returns:
the current Text.

setCurrentTextInAll

public void setCurrentTextInAll(Text CurrentTextInAll)
Sets a Text object that indicates the current Text

Parameters:
CurrentTextInAll -

getFirstItemInOL

public boolean getFirstItemInOL()
Gets a boolean value that indicates the object is first item in OL or not.


setFirstItemInOL

public void setFirstItemInOL(boolean fio)
Sets a boolean value that indicates the object is first item in OL or not.

Parameters:
fio -

getHyphenDicMap

public aspose.pdf.pdftext.Hashmap getHyphenDicMap()
Gets the number of consecutive hyphens. Default value is 0.


setHyphenDicMap

public void setHyphenDicMap(aspose.pdf.pdftext.Hashmap value)
Sets the number of consecutive hyphens. Default value is 0.

Parameters:
value -

setConsecutiveHyphens

public void setConsecutiveHyphens(int ch)
Sets the number of consecutive hyphens. Default value is 0.


getConsecutiveHyphens

public int getConsecutiveHyphens()
Gets the number of consecutive hyphens. Default value is 0.


getConsecutiveHyphens

public void getConsecutiveHyphens(int value)
Gets the number of consecutive hyphens. Default value is 0.


getHyphenDictionary

public XMLDocument getHyphenDictionary()
Gets a hyphenation Dictionary file.


setHyphenDictionary

public void setHyphenDictionary(XMLDocument value)
Sets a hyphenation Dictionary file.

Parameters:
value -

getIsAutoHyphenated

public boolean getIsAutoHyphenated()
Gets a bool value that indicates whether the text is hyphenated automatically. Default value is false.

Returns:
[Java] Pdf pdf1 = new Pdf(); pdf1.setIsAutoHyphenated(true); pdf1.setHyphenationZoneWidth(0); pdf1.setConsecutiveHyphensLimits(0); pdf1.setHyphenationDictionaryPath("c:/temp/Hyphen.xml"); pdf1.bindXML("C:/xml/Test.xml",null); pdf1.save(....);

setIsAutoHyphenated

public void setIsAutoHyphenated(boolean value)
Sets a bool value that indicates whether the text is hyphenated automatically. Default value is false.

Parameters:
value -

getHyphenationDictionaryPath

public java.lang.String getHyphenationDictionaryPath()
Gets a string that indicates the hyphenation dictionary path.


setHyphenationDictionaryPath

public void setHyphenationDictionaryPath(java.lang.String value)
Sets a string that indicates the hyphenation dictionary path.

Parameters:
value -

getHyphenationZoneWidth

public float getHyphenationZoneWidth()
Gets a float value that indicates the hyphenation area width. Default value is 12 points.


setHyphenationZoneWidth

public void setHyphenationZoneWidth(float value)
Sets a float value that indicates the hyphenation area width. Default value is 12 points.

Parameters:
value -

getConsecutiveHyphensLimits

public int getConsecutiveHyphensLimits()
Gets an integer value that indicates the consecutive hyphens limits. Default value is zero that means no limits.


setConsecutiveHyphensLimits

public void setConsecutiveHyphensLimits(int value)
Sets an integer value that indicates the consecutive hyphens limits. Default value is zero that means no limits.

Parameters:
value -

getPdfXslFile

public java.lang.String getPdfXslFile()
Gets a String value that indicates document's xsl file.


setPdfXslFile

public void setPdfXslFile(java.lang.String value)
Sets a String value that indicates document's xsl file.

Parameters:
value -

getFootNoteNumberInDoc

public int getFootNoteNumberInDoc()
Gets an integer value that indicates the footnote number in this document


setFootNoteNumberInDoc

public void setFootNoteNumberInDoc(int value)
Sets an integer value that indicates the footnote number in this document

Parameters:
value -

getEndNoteNumberInDoc

public int getEndNoteNumberInDoc()
Gets an integer value that indicates the endnote number in this document


setEndNoteNumberInDoc

public void setEndNoteNumberInDoc(int value)
Sets an integer value that indicates the endnote number in this document

Parameters:
value -

getPageNumberFormat

public PageNumberFormatType getPageNumberFormat()
Gets a PageNumberFormatType value that indicates the format of the page number .


setPageNumberFormat

public void setPageNumberFormat(PageNumberFormatType value)
Sets a PageNumberFormatType value that indicates the format of the page number .

Parameters:
value -

PdfInit

public void PdfInit()
Complete the initiation of the pdf document.


pdfInitForMultiSave

public void pdfInitForMultiSave()
Complete the initiation of the pdf document for multiple save.


getDocStream

public BinaryFileStream getDocStream()
Gets a BinaryFileStream value that indicates the stream of the document.


setDocStream

public void setDocStream(BinaryFileStream value)
Sets a BinaryFileStream value that indicates the stream of the document.

Parameters:
value -

getAssignInfo

public AssignInfo getAssignInfo()
Gets a AssignInfo value that indicates the page assignment info.


getAssignInfo

public void getAssignInfo(AssignInfo value)
Sets a BinaryFileStream value that indicates the page assignment info.

Parameters:
value -

close

public void close()
Close the document. This method is used for direct-to-file mode only.


setLicense

public static void setLicense(java.lang.String licenseFile)
Obsolete. Licenses this component to use in a Windows application.

Remarks: Use this class for licenses purchased before 2005/01/22. Aspose has upgraded to a new licensing system, please use License. License.setLicense(java.io.InputStream) for licenses purchased after that date.

Parameters:
licenseFile - The license filename with its path.

getGeneratorBase

public GeneratorBase getGeneratorBase()
Gets the GeneratorBase object that indicates the GeneratorBase of the document.


setGeneratorBase

public void setGeneratorBase(GeneratorBase value)
Sets the GeneratorBase object that indicates the GeneratorBase of the document.

Parameters:
value -

getBackupSection

public Section getBackupSection()
It is use to store the header and footer on odder page of mirror margin


setBackupSection

public void setBackupSection(Section value)
It is use to store the header and footer on odder page of mirror margin


getBackupTextInfo

public TextInfo getBackupTextInfo()
Gets the TextInfo object that indicates the backup TextInfo of the document.


setBackupTextInfo

public void setBackupTextInfo(TextInfo value)
Sets the TextInfo object that indicates the backup TextInfo of the document.

Parameters:
value -

setTimeOutOfFileWebRequest

public static void setTimeOutOfFileWebRequest(java.net.URI url)
Sets the FileWebRequest.Timeout property for the web images.

Parameters:
url - Uri object

save

public void save(java.lang.String pdfFile)
Generates Pdf document and saves it.

Parameters:
pdfFile - The file path and name to save the Pdf document.

Typical usages are the following:

[Java] Pdf pdf = new Pdf(); pdf.bindXML("C:/xml/Test.xml",null); pdf.save(....);

getBackgroundColor

public Color getBackgroundColor()
Gets a Color object that indicates the background color of the pdf.


setBackgroundColor

public void setBackgroundColor(Color value)
Sets a Color object that indicates the background color of the pdf.

Parameters:
value -

save

public void save(java.lang.String fileName,
                 SaveType saveType,
                 aspose.pdf.HttpResponse response)
Generates Pdf document and sends it to the client browser.

Parameters:
fileName - The name for the document that will appear at the client browser. The name should not contain path. If you use SaveType.OpenInBrowser, the file name is of no use.
saveType - Specifies how the document is presented at the client browser.
response - The HttpResponse object to put the pdf to.

save

public void save(java.io.OutputStream stream)
          throws java.io.IOException
Generates Pdf document and put it to a OutputStream object.

Parameters:
stream - The OutputStream object to which the document writes.
Throws:
java.io.IOException

save

public void save(BasicStream stream)
Generates Pdf document and put it to a BasicStream object.

Parameters:
stream - The BasicStream object to which the document writes.

setSecurity

public void setSecurity()
Set security of the document.


bindXML

public void bindXML(XMLDocument xmlDoc,
                    java.lang.String xslFile)
Binds an xml/xsl document to the Pdf object.

Parameters:
xmlDoc - The xml document.
xslFile - The xsl documnet file name if XSLT is used.

bindXML

public void bindXML(java.io.InputStream xmlFile,
                    java.io.InputStream xslFile)
             throws java.io.IOException
Binds an xml/xsl document to the Pdf object.

Parameters:
xmlFile - The xml InputStream stream.
xslFile - The xsl InputStream stream if XSLT is used
Throws:
java.io.IOException

bindXML

public void bindXML(java.lang.String xmlFile,
                    java.lang.String xslFile)
Binds an xml/xsl document to the Pdf object.

Parameters:
xmlFile - The xml file.
xslFile - The xsl file if XSLT is used

bindXML

public void bindXML(TextFileStream xmlStream,
                    TextFileStream xslStream)
Binds an xml/xsl stream to the Pdf object.

Parameters:
xmlStream - The xml stream.
xslStream - The xsl stream. This parameter can be null if no xml is used.

bindPCL

public void bindPCL(java.lang.String pclFileName)
Binds an PCL document to the Pdf object.

Parameters:
pclFileName - The PCL file.

getBuffer

public byte[] getBuffer()

Gets the data buffer used to generate the pdf document in memory.

Returns:
The data buffer.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); pdf1.bindXML("C:/xml/Test.xml",null); byte[] buf = pdf1.getBuffer();

getPageSetup

public PageSetup getPageSetup()
Gets a PageSetup object that indicates the page setup info in the Pdf document.


setPageSetup

public void setPageSetup(PageSetup value)
Sets a PageSetup object that indicates the page setup info in the Pdf document.

Parameters:
value -

getTextInfo

public TextInfo getTextInfo()
Gets a TextInfo object that indicates the text info in the Pdf document.


getTextInfo

public void getTextInfo(TextInfo value)
Sets a TextInfo object that indicates the text info in the Pdf document.

Parameters:
value -

getGraphInfo

public GraphInfo getGraphInfo()
Gets a GraphInfo object that indicates the graph info in the Pdf document.


setGraphInfo

public void setGraphInfo(GraphInfo value)
Sets a GraphInfo object that indicates the graph info in the Pdf document.

Parameters:
value -

getPages

public aspose.pdf.xml.Page getPages()
Gets a Page object that indicates the pages chain contains in this document.


setPages

public void setPages(aspose.pdf.xml.Page value)
Sets a Page object that indicates the pages chain contains in this document.

Parameters:
value -

getPagesNumber

public int getPagesNumber()
Represents an int value that indicates the current pages number.


setPagesNumber

public void setPagesNumber(int value)
Represents an int value that indicates the current pages number.

Parameters:
value -

getSections

public Sections getSections()
Gets a Sections collection that indicates all sections in the Pdf document.


setSections

public void setSections(Sections value)
Sets a Sections collection that indicates all sections in the Pdf document.

Parameters:
value -

getFirstLineIndent

public int getFirstLineIndent()
Gets an int value that indicates the indent of the first line.


setFirstLineIndent

public void setFirstLineIndent(int value)
Sets an int value that indicates the indent of the first line.

Parameters:
value -

getIsSpaced

public boolean getIsSpaced()
Gets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown. For the following XML:

Returns:
[Java] <Text> <Segment>The first line, The second line.</Segment> </Text> If IsSpaced is false, the result will be: The first line,The second line. If IsSpaced is true, the result will be: The first line, The second line.

setIsSpaced

public void setIsSpaced(boolean value)
Sets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown. For the following XML: [Java] <Text> <Segment>The first line, The second line.</Segment> </Text> If IsSpaced is false, the result will be: The first line,The second line. If IsSpaced is true, the result will be: The first line, The second line.


getHeadingInfos

public HeadingInfoArray getHeadingInfos()
Gets a HeadingInfoArray object that indicates the heading info.


setHeadingInfos

public void setHeadingInfos(aspose.pdf.xml.HeadingInfoArray value)
Sets a HeadingInfoArray object that indicates the heading info.

Parameters:
value -

getFirstHeading

public Heading getFirstHeading()
Represents a Heading object that indicates the first heading in this document.


setFirstHeading

public void setFirstHeading(Heading value)
Sets the Heading object that indicates the first heading in this document.

Parameters:
value -

getLabelWidth

public float getLabelWidth()
Gets a float value that indicates the width of the heading label.


setLabelWidth

public void setLabelWidth(float value)
Sets a float value that indicates the width of the heading label.

Parameters:
value -

getFirstSubstitute

public aspose.pdf.xml.Substitute getFirstSubstitute()
Gets a Substitute object that indicates the first substitutor in the document.


setFirstSubstitute

public void setFirstSubstitute(aspose.pdf.xml.Substitute value)
Sets a Substitute object that indicates the first substitutor in the document.

Parameters:
value -

getLastSubstitute

public aspose.pdf.xml.Substitute getLastSubstitute()
Gets a Substitute object that indicates the last substitutor in the document.


setLastSubstitute

public void setLastSubstitute(aspose.pdf.xml.Substitute value)
Sets a Substitute object that indicates the last substitutor in the document.

Parameters:
value -

getCompressionLevel

public int getCompressionLevel()
Gets an int value that indicates the compression level. It can be between 0 (the least compression) and 9 (the most compression) and the default value is 6.


setCompressionLevel

public void setCompressionLevel(int value)
Sets an int value that indicates the compression level. It can be between 0 (the least compression) and 9 (the most compression) and the default value is 6.

Parameters:
value -

getDestinationType

public DestinationType getDestinationType()
Gets or sets a DestinationType value that indicates the document open action.


setDestinationType

public void setDestinationType(DestinationType value)
Sets or sets a DestinationType value that indicates the document open action.


getOpenType

public OpenType getOpenType()
Gets a OpenType that indicates the document open type.


setOpenType

public void setOpenType(OpenType value)
Sets a OpenType that indicates the document open type.

Parameters:
value -

getAuthor

public java.lang.String getAuthor()
Gets a string that indicates the author of the Pdf document.


setAuthor

public void setAuthor(java.lang.String value)
Sets a string that indicates the author of the Pdf document.

Parameters:
value -

getTimeOutOfFileWebRequest

public static int getTimeOutOfFileWebRequest()
Gets the length of time until the request times out for the Pdf document.


setTimeOutOfFileWebRequest

public static void setTimeOutOfFileWebRequest(int value)
Sets the length of time until the request times out for the Pdf document.

Parameters:
value -

getTitle

public java.lang.String getTitle()
Gets a string that indicates the creator of the Pdf document.


setTitle

public void setTitle(java.lang.String value)
Sets a string that indicates the creator of the Pdf document.

Parameters:
value -

getCreator

public java.lang.String getCreator()
Gets a String that indicates the creator of the Pdf document.


setCreator

public void setCreator(java.lang.String value)
Sets a String that indicates the creator of the Pdf document.

Parameters:
value -

getProducer

public java.lang.String getProducer()
Gets a string that indicates the producer of the Pdf document.


setProducer

public void setProducer(java.lang.String value)
Sets a string that indicates the producer of the Pdf document.

Parameters:
value -

getKeywords

public java.lang.String getKeywords()
Gets a string that indicates key words of the Pdf document.


setKeywords

public void setKeywords(java.lang.String value)
Sets a string that indicates key words of the Pdf document.

Parameters:
value -

getSubject

public java.lang.String getSubject()
Gets a string that indicates the subject of the Pdf document.


setSubject

public void setSubject(java.lang.String value)
Sets a string that indicates the subject of the Pdf document.

Parameters:
value -

getPageTransitionType

public PageTransitionType getPageTransitionType()
Gets a PageTransitionType that indicates the pdf document page transition type.


setPageTransitionType

public void setPageTransitionType(PageTransitionType value)
Sets a PageTransitionType that indicates the pdf document page transition type.

Parameters:
value -

getPageDuration

public int getPageDuration()
Gets a int value that indicates the duration in seconds for the current page. This property is used when using auto advancing in presentation mode.


setPageDuration

public void setPageDuration(int value)
Sets a int value that indicates the duration in seconds for the current page. This property is used when using auto advancing in presentation mode.


getSecurity

public Security getSecurity()
Gets a Security object that indicates the document security information.


setSecurity

public void setSecurity(Security value)
Sets a Security object that indicates the document security information.

Parameters:
value -

getCustomFonts

public CustomFonts getCustomFonts()
Gets a CustomFonts object that indicates the custom fonts of the document.


setCustomFonts

public void setCustomFonts(CustomFonts value)
Sets a Security object that indicates the custom fonts of the document.

Parameters:
value -

getTempGenerator

public GeneratorBase getTempGenerator()
Gets a GeneratorBase object that indicates the temp generator.


setTempGenerator

public void setTempGenerator(GeneratorBase value)
Sets a GeneratorBase object that indicates the temp generator.

Parameters:
value -

getTempGenerator1

public GeneratorBase getTempGenerator1()
Gets a GeneratorBase object that indicates the temp generator.


setTempGenerator1

public void setTempGenerator1(GeneratorBase TempGenerator1)
Sets a GeneratorBase object that indicates the temp generator.

Parameters:
TempGenerator1 -

getIsImagesInXmlDeleteNeeded

public boolean getIsImagesInXmlDeleteNeeded()
Gets a bool value that indicates whether images used in XML be deleted when the PDF document is generated.

Reamrks: This property is used when integration with Aspose.Word. When converting Word document to PDF,Aspose.Word will save images in Word document as file and add the file name into XML. If this property is set to true,Aspose.Pdf will delete these image files used in XML.


setIsImagesInXmlDeleteNeeded

public void setIsImagesInXmlDeleteNeeded(boolean value)
Sets a bool value that indicates whether images used in XML be deleted when the PDF document is generated.


getImagePath

public aspose.pdf.pdftext.Hashmap getImagePath()
Gets a Hashmap object that indicates the Image path.


setImagePath

public void setImagePath(aspose.pdf.pdftext.Hashmap ImagePath)
Sets a Hashmap object that indicates the Image path.

Parameters:
ImagePath -

getIsFontMapCreated

public boolean getIsFontMapCreated()
Gets a boolean value that indicates whether the font map has been created or not.


setIsFontMapCreated

public void setIsFontMapCreated(boolean value)
Sets a boolean value that indicates whether the font map has been created or not.

Parameters:
value -

getIsBuffered

public boolean getIsBuffered()
Gets a bool value that indicates whether memory buffer is used when generating PDF document. The default value is true. If this property is set to false, Aspose.Pdf will write document directly to PDF file and the getBuffer() method can't be used.


setIsBuffered

public void setIsBuffered(boolean value)
Sets a bool value that indicates whether memory buffer is used when generating PDF document. The default value is true. If this property is set to false, Aspose.Pdf will write document directly to PDF file and the getBuffer() method can't be used.


getObjectByID

public java.lang.Object getObjectByID(java.lang.String ID)
Gets a object with specified ID in the document.

Parameters:
ID - The object ID.
Returns:
The object with specified ID. Null if the ID is not found.

getTableOfContents

public ListSection getTableOfContents()
Gets a ListSection object that indicates the table of contents.


getListOfTables

public ListSection getListOfTables()
Gets a ListSection object that indicates the list of table.


getListOfFigures

public ListSection getListOfFigures()
Gets a ListSection object that indicates the list of figures.


ProcessLists

public void ProcessLists()
Add Lists to the pdf document if the user has specified the list.


getIsBookmarked

public boolean getIsBookmarked()
Gets a bool value that indicates whether the pdf document is bookmarked when generating PDF document. The default value is false. If this property is set to true, Aspose.Pdf will create bookmarks for all the Headings in the PDF if the relative property BookMarkLevel is not set.


setIsBookmarked

public void setIsBookmarked(boolean value)
Sets a bool value that indicates whether the pdf document is bookmarked when generating PDF document. The default value is false. If this property is set to true, Aspose.Pdf will create bookmarks for all the Headings in the PDF if the relative property BookMarkLevel is not set.

Parameters:
value -

getBookMarkLevel

public int getBookMarkLevel()
Gets a int value that indicates how many levels of Heading of the pdf document is to be bookmarked. The default value is 0, which means every heading of the PDF is to be taged as a bookmark. Only when the relative property IsBookmarked is set as true, this property is valid. If IsBookmarked is true and this property is set to a non-integer value levelNumber, Aspose.Pdf will create bookmarks for the corresponding Headings of level 1 to level levelNumber.


setBookMarkLevel

public void setBookMarkLevel(int value)
Deprecated. Obsolete. Will be deleted in 12 months, Date: May 15, 2012. Use setBookmarkLevel(int) instead.

Gets a int value that indicates how many levels of Heading of the pdf document is to be bookmarked. The default value is 0, which means every heading of the PDF is to be taged as a bookmark. Only when the relative property IsBookmarked is set as true, this property is valid. If IsBookmarked is true and this property is set to a non-integer value levelNumber, Aspose.Pdf will create bookmarks for the corresponding Headings of level 1 to level levelNumber.

Parameters:
value - the level to set

setBookmarkLevel

public void setBookmarkLevel(int value)
Gets a int value that indicates how many levels of Heading of the pdf document is to be bookmarked. The default value is 0, which means every heading of the PDF is to be taged as a bookmark. Only when the relative property IsBookmarked is set as true, this property is valid. If IsBookmarked is true and this property is set to a non-integer value levelNumber, Aspose.Pdf will create bookmarks for the corresponding Headings of level 1 to level levelNumber.

Parameters:
value - the level to set

getTabStopPosition

public float getTabStopPosition()
Gets the tab stop position. Default value is 36 points (0.5inch).


setTabStopPosition

public void setTabStopPosition(float value)
Sets the tab stop position. Default value is 36 points (0.5inch).

Parameters:
value -

getXmlFilePath

public java.lang.String getXmlFilePath()
Gets a String value that indicates the xml file path.


setXmlFilePath

public void setXmlFilePath(java.lang.String value)
Sets a String value that indicates the xml file path.

Parameters:
value -

getHtmlInfo

public aspose.pdf.html.HtmlInfo getHtmlInfo()
Gets a aspose.pdf.html.HtmlInfo object that indicates the necessary info when converting


setHtmlInfo

public void setHtmlInfo(aspose.pdf.html.HtmlInfo value)
Sets a aspose.pdf.html.HtmlInfo object that indicates the necessary info when converting

Parameters:
value -

getIsPageNumberRestarted

public boolean getIsPageNumberRestarted()
Gets a bool value that indicates whether the page number is restarted in new section. Default is false.


setIsPageNumberRestarted

public void setIsPageNumberRestarted(boolean value)
Sets a bool value that indicates whether the page number is restarted in new section. Default is false.

Parameters:
value -

getIsCoreFontUsed

public boolean getIsCoreFontUsed()
Gets a bool value that indicates whether PDF core fonts are used. Default is true. If this property is set to false, PDF core fonts will be ignored and all font will be used as TrueType font.


setIsCoreFontUsed

public void setIsCoreFontUsed(boolean value)
Sets a bool value that indicates whether PDF core fonts are used. Default is true. If this property is set to false, PDF core fonts will be ignored and all font will be used as TrueType font.

Parameters:
value -

getIsXmlSchemaCheckedOnBind

public boolean getIsXmlSchemaCheckedOnBind()
Gets a bool value that indicates whether the error is ignored when unknown elements or attributes are used in xml file. Default is false.


setIsXmlSchemaCheckedOnBind

public void setIsXmlSchemaCheckedOnBind(boolean value)
Sets a bool value that indicates whether the error is ignored when unknown elements or attributes are used in xml file. Default is false.

Parameters:
value -

getIsPageNumberForDocument

public boolean getIsPageNumberForDocument()
Gets a bool value that indicates whether the "image not found" error is ignored or not.


setIsPageNumberForDocument

public void setIsPageNumberForDocument(boolean value)
Sets a bool value that indicates whether the "image not found" error is ignored or not.

Parameters:
value -

getIsTruetypeFontMapCached

public boolean getIsTruetypeFontMapCached()
Gets a bool value that indicates whether truetype font map be cached on disk. Truetype font map is a font name to font file name map which is used when using unicode. If unicode is used, setting this property to true can make your application run fast. If this property is set to true and the system's fonts are changed (for example, new fonts are installed), delete the font map file (Aspose.Pdf.TruetypeFontMap.xml) and it will be generated again automatically.


setIsTruetypeFontMapCached

public void setIsTruetypeFontMapCached(boolean value)
Sets a bool value that indicates whether truetype font map be cached on disk. Truetype font map is a font name to font file name map which is used when using unicode. If unicode is used, setting this property to true can make your application run fast. If this property is set to true and the system's fonts are changed (for example, new fonts are installed), delete the font map file (Aspose.Pdf.TruetypeFontMap.xml) and it will be generated again automatically.

Parameters:
value -

getTruetypeFontMapPath

public java.lang.String getTruetypeFontMapPath()
Gets a string that indicates the path of the truetype font map file. This property is valid only when the "IsTruetypeFontMapCached" property is set to true.


setTruetypeFontMapPath

public void setTruetypeFontMapPath(java.lang.String value)
Sets a string that indicates the path of the truetype font map file. This property is valid only when the "IsTruetypeFontMapCached" property is set to true.

Parameters:
value -

setTruetypeFontDirectoryPath

public void setTruetypeFontDirectoryPath(java.lang.String value)
Sets a string that indicates the path of the truetype font directory.
Instead, you can start your app with java -Daspose.pdf.fontpath=c:/windows/fonts setted

Parameters:
value -

getTruetypeFontDirectoryPath

public java.lang.String getTruetypeFontDirectoryPath()
Gets a string that indicates the path of the truetype font directory.


getTruetypeFontMapStream

public MemStream getTruetypeFontMapStream()
Gets a memory stream that indicates the TrueType font map stream. This property is valid only when the "IsTruetypeFontMapCached" property is set to true. Normally you should use "TruetypeFontMapPath" instead of this property. But in some server, it is not permitted to create file on disk so you can use TrueType font map stream. You need to create the font map stream only once when you application is running.


getTruetypeFontMapStream

public void getTruetypeFontMapStream(MemStream value)
Sets a memory stream that indicates the TrueType font map stream. This property is valid only when the "IsTruetypeFontMapCached" property is set to true. Normally you should use "TruetypeFontMapPath" instead of this property. But in some server, it is not permitted to create file on disk so you can use TrueType font map stream. You need to create the font map stream only once when you application is running.

Parameters:
value -

CreateTruetypeFontMapStream

public static MemStream CreateTruetypeFontMapStream()
Creates the TrueType font map stream. The stream can be used to set the "TruetypeFontMapStream" property.


getIsFirstPageCreated

public boolean getIsFirstPageCreated()
Gets a boolean value that indicates whether this is the first page or not.


setIsFirstPageCreated

public void setIsFirstPageCreated(boolean IsFirstPageCreated)
Gets a boolean value that indicates whether this is the first page or not.

Parameters:
IsFirstPageCreated -

getIsSegmentMerged

public boolean getIsSegmentMerged()
Gets a bool value that indicates whether the segments with same format are merged into one. This property is used when converting Word document into PDF. Aspose.Words may export one word into more than one segments which makes the line warpping bad.


setIsSegmentMerged

public void setIsSegmentMerged(boolean value)
Sets a bool value that indicates whether the segments with same format are merged into one. This property is used when converting Word document into PDF. Aspose.Words may export one word into more than one segments which makes the line warpping bad.

Parameters:
value -

getRefPageID

public int getRefPageID()
Gets a int value that indicates User access #$REFPAGE the corresponding unique ID. After each time to obtain the value plus 1, to ensure that only.


setRefPageID

public void setRefPageID(int rd)
Sets a int value that indicates User access #$REFPAGE the corresponding unique ID. After each time to obtain the value plus 1, to ensure that only.

Parameters:
rd -

getPageCount

public int getPageCount()
Gets a int value that indicates the pages count of the generated PDF. You can only get the value of this property when the save method is called.


GetStringWidth

public float GetStringWidth(java.lang.String str,
                            TextInfo info)
Gets the string width in PDF with specified text formatting.

Parameters:
str - The string.
info - The text formatting info.
Returns:
The width of the string in PDF. The unit is point.

Typical usages are the following:

[Java] Pdf pdf = new Pdf(); TextInfo textinfo = new TextInfo(); textinfo.setFontName("Arial"); textinfo.setFontSize(14); float width = pdf.GetStringWidth("Hello world", textinfo);

getWatermarks

public Watermarks getWatermarks()
Gets a Watermarks which will be added upon each page of the PDF document.


setWatermarks

public void setWatermarks(Watermarks value)
Sets a Watermarks which will be added upon each page of the PDF document.

Parameters:
value -

checkWatermark

public void checkWatermark(Sections sections)
Represents a checkWatermark action.

Parameters:
sections -

getDocumentAttachments

public DocumentAttachments getDocumentAttachments()
Gets a DocumentAttachments which will be added upon the PDF document.


getDocumentAttachments

public void getDocumentAttachments(DocumentAttachments value)
Sets a DocumentAttachments which will be added upon the PDF document.


getIsFontNotFoundExceptionThrown

public boolean getIsFontNotFoundExceptionThrown()
Gets a bool value that indicates whether throw out exception when font is not found. The default value is false.In this case,if user specified font is not found,default font works.


setIsFontNotFoundExceptionThrown

public void setIsFontNotFoundExceptionThrown(boolean value)
Sets a bool value that indicates whether throw out exception when font is not found. The default value is false.In this case,if user specified font is not found,default font works.

Parameters:
value -

getToBeFreed

public java.util.ArrayList getToBeFreed()
Gets an ArrayList that indicates The resources need to be released after the PDF is been generated To avoid memory leaks


setToBeFreed

public void setToBeFreed(java.util.ArrayList ToBeFreed)
Sets an ArrayList that indicates The resources need to be released after the PDF is been generated To avoid memory leaks

Parameters:
ToBeFreed -

getIsWatermarkOnTop

public boolean getIsWatermarkOnTop()
Gets a bool value that indicates if the watermark is on top of the page.


setIsWatermarkOnTop

public void setIsWatermarkOnTop(boolean value)
Sets a bool value that indicates if the watermark is on top of the page.

Parameters:
value -

getIsLandscape

public boolean getIsLandscape()
Gets a bool value that indicates whether the page orientation is landscape. The default is false, portrait.


setIsLandscape

public void setIsLandscape(boolean value)
Sets a bool value that indicates whether the page orientation is landscape. The default is false, portrait.

Parameters:
value -

CreateObjFromXml

public static java.lang.Object CreateObjFromXml(java.lang.String xmlFile,
                                                java.lang.String xslFile)
Create object from an xml/xsl document.

Parameters:
xmlFile - The xml file.
xslFile - The xsl file if XSLT is used.
Returns:

Remarks: Section, Text, Graph, Image, Segment, Table, Attachment, FloatingBox objects are supported.

Typical usages are the following:

Pdf pdf1 = new Pdf(); Text text = (aspose.pdf.Text) Pdf.CreateObjFromXml("testText.xml", null); Section sec = pdf1.getSections().add(); sec.getParagraphs().add(); pdf1.save(....);

CreateObjFromXml

public static java.lang.Object CreateObjFromXml(TextFileStream xmlStream,
                                                TextFileStream xslStream)
Create object from an xml/xsl stream.

Parameters:
xmlStream - The xml stream.
xslStream - The xsl stream. This parameter can be null if no xml is used.
Returns:
Section, Text, Graph, Image, Segment, Table, Attachment,FloatingBox objects are supported.

Typical usages are the following:

[Java] Pdf pdf = new Pdf(); BinaryFileStream fs = new BinaryFileStream(); fs.setCanWrite(true); fs.setouput("testText.xml"); Text text = (aspose.pdf.Text)Pdf.CreateObjFromXml(fs, null); Section sec = pdf.getSections().add(); sec.getParagraphs().add(text); pdf.save(....);

createObjFromXml

public static java.lang.Object createObjFromXml(XMLDocument xmlDoc,
                                                XslTransform xsl)
Reads object info from a xml document.

Parameters:
xmlDoc - The xml document.
xsl - The XslTransform object if XSLT is used.

Remarks: Section, Text, Graph, Image, Segment, Table, Attachment, FloatingBox objects are supported.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); XMLDocument xmlDoc = new XMLDocument(); xmlDoc.load("D:\\CSharp\\Pdf\\Aspose.Pdf.Test\\input\\testText.xml"); Text text = (aspose.pdf.Text)Pdf.CreateObjFromXml(xmlDoc, null); Section sec = pdf1.getSections().add(); sec.getParagraphs().add(text); pdf1.save(....);

getIsSaveState

public boolean getIsSaveState()
Gets the boolean value that indicates whether the document is in saving state.


setIsSaveState

public void setIsSaveState(boolean IsSaveState)
Sets the boolean value that indicates whether the document is in saving state.

Parameters:
IsSaveState -

GetPageNumber

public int GetPageNumber(java.lang.String ID)
Gets the page number of a paragraph when the PDF is generated.

Parameters:
ID - The ID of the paragraph.
Returns:
The page number of the paragraph. If the paragraph is not found, 0 will be returned.

getJavaScripts

public JavaScripts getJavaScripts()
Gets a JavaScripts object that indicates the JavaScripts to be added into the PDF.

Returns:

Typical usages are the following:

[Java] Pdf pdf = new Pdf(); pdf.setJavaScripts(new JavaScripts()); pdf.getJavaScripts().add(new JavaScript("this.print(true);")); pdf.getJavaScripts().add("this.print(true)"); pdf.getJavaScripts().add("app.alert(\"hello world\");"); pdf.save(....);

setJavaScripts

public void setJavaScripts(JavaScripts value)
Sets a JavaScripts object that indicates the JavaScripts to be added into the PDF.

Parameters:
value -

Typical usages are the following:

[Java] Pdf pdf = new Pdf(); pdf.setJavaScripts(new JavaScripts()); pdf.getJavaScripts().add(new JavaScript("this.print(true);")); pdf.getJavaScripts().add("this.print(true)"); pdf.getJavaScripts().add("app.alert(\"hello world\");"); pdf.save(....);

getXmpMetadata

public XmpMetadata getXmpMetadata()
Gets a XmpMetadata Object that indicates the XMP metadata to be added into the PDF document.

Returns:

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Text text = new Text("This is a test for XMP Metadata"); sec1.getParagraphs().add(text); pdf1.setXmpMetadata(new XmpMetadata()); pdf1.getXmpMetadata().addCreationDate((new java.util.Date()).toString()); pdf1.getXmpMetadata().addUserProperty("xmlns:dc=\"http://purl.org/dc/elements/1.1/\"","dc:contributor","Aspose"); pdf1.save(....); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <XmpMetadata> <MetadataItem Name="CreationDate" Value="2007-7-15 10:51:55" /> <MetadataItem XmlNamespace="xmlns:dc='http://purl.org/dc/elements/1.1/'" Name="dc:contributor" Value="Aspose" /> </XmpMetadata> <Section> <Text> <Segment>This is a test for XMP Metadata</Segment> </Text> </Section> </Pdf>

setXmpMetadata

public void setXmpMetadata(XmpMetadata value)
Sets a XmpMetadata Object that indicates the XMP metadata to be added into the PDF document.

Parameters:
value -

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Text text = new Text("This is a test for XMP Metadata"); sec1.getParagraphs().add(text); pdf1.setXmpMetadata(new XmpMetadata()); pdf1.getXmpMetadata().addCreationDate((new java.util.Date()).toString()); pdf1.getXmpMetadata().addUserProperty("xmlns:dc=\"http://purl.org/dc/elements/1.1/\"","dc:contributor","Aspose"); pdf1.save(....); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <XmpMetadata> <MetadataItem Name="CreationDate" Value="2007-7-15 10:51:55" /> <MetadataItem XmlNamespace="xmlns:dc='http://purl.org/dc/elements/1.1/'" Name="dc:contributor" Value="Aspose" /> </XmpMetadata> <Section> <Text> <Segment>This is a test for XMP Metadata</Segment> </Text> </Section> </Pdf>

SetUnicode

public void SetUnicode()
Sets all fonts in the document to be unicode. This method should be called just before the Save method.

Remarks: When converting Word to Pdf, some font is needed to be set to unicode in Aspose.Pdf. This method is used to set all fonts to unicode. The font subset will then be embedded.


getDefaultFontName

public java.lang.String getDefaultFontName()
Gets a string that indicates the default font name. When font name is not set or the font is not found, this font will be used. The default value is "Times-Roman".


setDefaultFontName

public void setDefaultFontName(java.lang.String value)
Sets a string that indicates the default font name. When font name is not set or the font is not found, this font will be used. The default value is "Times-Roman".

Parameters:
value -

getIsRightToLeft

public boolean getIsRightToLeft()
Gets a bool value that indicates whether the text or heading appear in the pdf is right-to-left aligned. If it is true, all the texts and headings will be processed as right-to-left language previously. If text or heading don't contain any right-to-left lanuage character, they will be processed as usual( left-to-right). This property is used for right-to-left aligned language such as Arabic and Hebrew.


setIsRightToLeft

public void setIsRightToLeft(boolean value)
Sets a bool value that indicates whether the text or heading appear in the pdf is right-to-left aligned. If it is true, all the texts and headings will be processed as right-to-left language previously. If text or heading don't contain any right-to-left lanuage character, they will be processed as usual( left-to-right). This property is used for right-to-left aligned language such as Arabic and Hebrew.

Parameters:
value -

getIsRtlInSegmentMode

public boolean getIsRtlInSegmentMode()
Gets a bool value that indicates whether the text or heading is processed in segment mode. If it is true(default),segment in text will be processed one by one. If false, all segments in text will be put together, reorder in arabic rule. We recommend set it true when rendering rtl and non-rtl mixed texts.


setIsRtlInSegmentMode

public void setIsRtlInSegmentMode(boolean value)
Sets a bool value that indicates whether the text or heading is processed in segment mode. If it is true(default),segment in text will be processed one by one. If false, all segments in text will be put together, reorder in arabic rule. We recommend set it true when rendering rtl and non-rtl mixed texts.

Parameters:
value -

getIsWidowOrphanControlEnabled

public boolean getIsWidowOrphanControlEnabled()
Gets a bool value that indicates whether the Widow/Orphan control is enabled. Default is true. If it is true, Widow/Orphan control is enabled and Widows/orphans themselves are eliminated (disabled).


setIsWidowOrphanControlEnabled

public void setIsWidowOrphanControlEnabled(boolean value)
Sets a bool value that indicates whether the Widow/Orphan control is enabled. Default is true. If it is true, Widow/Orphan control is enabled and Widows/orphans themselves are eliminated (disabled).

Parameters:
value -

getIsAutoFontAdjusted

public boolean getIsAutoFontAdjusted()
Gets a boolean value that indicates whether allow to adjust fonts automatically. Each font has a set of supported characters. Sometimes, users may assign a font to a Segment paragraph which doesn't support every character appear in the Segment. If this boolean value is true, it will assign proper font to Segment paragraph according to its contents in this case. Default is false.


getIsAutoFontAdjusted

public void getIsAutoFontAdjusted(boolean value)
Gets a boolean value that indicates whether allow to adjust fonts automatically. Each font has a set of supported characters. Sometimes, users may assign a font to a Segment paragraph which doesn't support every character appear in the Segment. If this boolean value is true, it will assign proper font to Segment paragraph according to its contents in this case. Default is false.

Parameters:
value -

getBookmarks

public Bookmarks getBookmarks()
Gets a Bookmarks object that indicates the bookmarks in the PDF.


setBookmarks

public void setBookmarks(Bookmarks value)
Sets a Bookmarks object that indicates the bookmarks in the PDF.

Parameters:
value -

getLinearized

public boolean getLinearized()
Gets a bool value that indicates if the document needs to be linearized (optimization for web access) . you need to set this property before Save method is called .


setLinearized

public void setLinearized(boolean value)
Sets a bool value that indicates if the document needs to be linearized (optimization for web access) . The default value is false . you need to set this property before Save method is called .


getConformance

public PdfConformance getConformance()
NOTE: This is beta version of PdfA.
Gets a PdfConformance object that indicates the conformance in the PDF. The default value is PdfConformance.None . you need to set this property before Save method is called . Notice that PdfConformance.PdfA1B and PdfConformance.PdfA1A currently only support TrueType fonts and RGB color space , specify a wrong font name or a CMYK color name will cause exception.


setConformance

public void setConformance(PdfConformance value)
NOTE: This is beta version of PdfA.
Sets a PdfConformance object that indicates the conformance in the PDF. The default value is PdfConformance.None . you need to set this property before Save method is called . Notice that PdfConformance.PdfA1B and PdfConformance.PdfA1A currently only support TrueType fonts and RGB color space , specify a wrong font name or a CMYK color name will cause exception.

Parameters:
value -