org.pdfbox

Class TextToPDF


public class TextToPDF
extends java.lang.Object

This will take a text file and ouput a pdf with that text.
Version:
$Revision: 1.4 $
Author:
Ben Litchfield

Method Summary

PDDocument
createPDFFromText(Reader text)
Create a PDF document with some text.
PDSimpleFont
getFont()
int
getFontSize()
static void
main(String[] args)
This will create a PDF document with a single image on it.
void
setFont(PDSimpleFont aFont)
void
setFontSize(int aFontSize)

Method Details

createPDFFromText

public PDDocument createPDFFromText(Reader text)
            throws IOException
Create a PDF document with some text.
Parameters:
text - The stream of text data.
Returns:
The document with the text in it.

getFont

public PDSimpleFont getFont()
Returns:
Returns the font.

getFontSize

public int getFontSize()
Returns:
Returns the fontSize.

main

public static void main(String[] args)
            throws IOException
This will create a PDF document with a single image on it.
see usage() for commandline
Parameters:
args - Command line arguments.

setFont

public void setFont(PDSimpleFont aFont)
Parameters:
aFont - The font to set.

setFontSize

public void setFontSize(int aFontSize)
Parameters:
aFontSize - The fontSize to set.