Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.pdf.elements
Class Pdf

java.lang.Object
  extended bycom.aspose.pdf.elements.Pdf

public class Pdf
extends java.lang.Object

Represents the Pdf document.


Constructor Summary
Pdf()
          Initialize a new instance of the Pdf class.
 
Method Summary
 void bindFo(java.io.InputStream foStream)
          Binds fo file as InputSteam.
 void bindFo(java.io.InputStream xmlStream, java.io.InputStream xsltStream)
          Binds xml file and according xsl file as InputStream to be converted.
 PageSetup getDefaultPageSetup()
          Gets a PageSetup object that indicates the page setup info in the Pdf document.
 int getFirstLineIndent()
          Gets an int value that indicates the indent of the first line.
static java.lang.String getFoImagePath()
          Sets an image path to system image path.
 Sections getSections()
          Gets a Sections collection that indicates all sections in the Pdf document.
 TextInfo getTextInfo()
          Gets a TextInfo object that indicates the text info in the Pdf document.
 boolean isSpaced()
          Gets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown.
 void save(java.io.OutputStream out)
          Saves the converted pdf stream.
 void save(java.io.OutputStream out, java.util.Map metainfo)
          Saves the converted pdf stream.
 void setFirstLineIndent(int indent)
          Sets an int value that indicates the indent of the first line.
static void setFoImagePath(java.lang.String path)
          Sets an image path to system image path.
 void setIsSpaced(boolean isSpaced)
          Sets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown.
 void setPageSetup(PageSetup pageSetup)
          Sets a PageSetup object that indicates the page setup info in the Pdf document.
 void setSections(Sections secs)
          Sets a Sections collection that indicates all sections in the Pdf document.
 void setTextInfo(TextInfo textInfo)
          Sets a TextInfo object that indicates the text info in the Pdf document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pdf

public Pdf()
    throws AsposeBaseException
Initialize a new instance of the Pdf class.

 [SampleCode]
 Pdf pdf = new Pdf();
 Section sec1 = pdf.getSections().add();
 Text text1 = new Text(sec1,"Hello World, this is my first pdf.");
 sec1.getParagraphs().add(text1);
 pdf.save(new FileOutputStream(new File("./HelloWorldExample.pdf")));
 

Method Detail

setFoImagePath

public static void setFoImagePath(java.lang.String path)
Sets an image path to system image path.

Parameters:
path - The path to set.

getFoImagePath

public static java.lang.String getFoImagePath()
Sets an image path to system image path.


bindFo

public void bindFo(java.io.InputStream foStream)
            throws AsposeBaseException
Binds fo file as InputSteam.

 [SampleCode]
 Pdf docConvert = new Pdf();
 docConvert.bindFo(new FileInputStream(new File("../fofile/helloworld.fo")));
 docConvert.save(new FileOutputStream(new File("./helloworld.pdf")));
 

Parameters:
foStream - Format-Object file as InputStream to be converted
Throws:
AsposeBaseException

bindFo

public void bindFo(java.io.InputStream xmlStream,
                   java.io.InputStream xsltStream)
            throws AsposeBaseException
Binds xml file and according xsl file as InputStream to be converted.

 [SampleCode]
 Pdf docConvert = new Pdf();
 docConvert.bindFo(new FileInputStream(new File("../fofile/glossary.xml")),
 new FileInputStream(new File("../fofile/glossary.xsl")));
 docConvert.save(new FileOutputStream(new File("./glossary.pdf")));
 

Parameters:
xmlStream - xml file stream
xsltStream - xslt file stream
Throws:
AsposeBaseException

setSections

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


getSections

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


setPageSetup

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


getDefaultPageSetup

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


getFirstLineIndent

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


setFirstLineIndent

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


isSpaced

public boolean isSpaced()
Gets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown.


setIsSpaced

public void setIsSpaced(boolean isSpaced)
Sets a bool value that indicates whether the spaces at the begin of the text and returns in the text be shown.


getTextInfo

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


setTextInfo

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


save

public void save(java.io.OutputStream out,
                 java.util.Map metainfo)
          throws AsposeBaseException
Saves the converted pdf stream.

Parameters:
out - the OutputStream that the converted result to be saved to.
Throws:
AsposeBaseException

save

public void save(java.io.OutputStream out)
          throws AsposeBaseException
Saves the converted pdf stream.

Throws:
javax.xml.transform.TransformerException
AsposeBaseException