Package org.apache.pdfbox
Class TextToPDF
java.lang.Object
org.apache.pdfbox.TextToPDF
This will take a text file and ouput a pdf with that text.
- Version:
- $Revision: 1.4 $
- Author:
- Ben Litchfield
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePDFFromText(Reader text) Create a PDF document with some text.voidcreatePDFFromText(PDDocument doc, Reader text) Create a PDF document with some text.getFont()intbooleanTells the paper orientation.static voidThis will create a PDF document with some text in it.voidsetFont(PDSimpleFont aFont) voidsetFontSize(int aFontSize) voidsetLandscape(boolean landscape) Sets paper orientation.
-
Constructor Details
-
TextToPDF
public TextToPDF()
-
-
Method Details
-
createPDFFromText
Create a PDF document with some text.- Parameters:
text- The stream of text data.- Returns:
- The document with the text in it.
- Throws:
IOException- If there is an error writing the data.
-
createPDFFromText
Create a PDF document with some text.- Parameters:
doc- The PDF document that shall content the text.text- The stream of text data.- Throws:
IOException- If there is an error writing the data.
-
main
This will create a PDF document with some text in it.
see usage() for commandline- Parameters:
args- Command line arguments.- Throws:
IOException- If there is an error with the PDF.
-
getFont
- Returns:
- Returns the font.
-
setFont
- Parameters:
aFont- The font to set.
-
getFontSize
public int getFontSize()- Returns:
- Returns the fontSize.
-
setFontSize
public void setFontSize(int aFontSize) - Parameters:
aFontSize- The fontSize to set.
-
isLandscape
public boolean isLandscape()Tells the paper orientation.- Returns:
-
setLandscape
public void setLandscape(boolean landscape) Sets paper orientation.- Parameters:
landscape-
-