jfig.utils
Class ItextPresentationPDFWriter

java.lang.Object
  extended byjfig.utils.ItextPresentationPDFWriter

public class ItextPresentationPDFWriter
extends java.lang.Object

use the PDFWriter and PDFGraphics2D classes from the Itext project to export a given jfig presentation to PDF format. Usage: go to the base directory of the presentation, then run

java jfig.utils.ItextPresentationPDFWriter "indexfile.jpt"
and wait... The output file is always called "hugo.pdf" at the moment.


Field Summary
(package private)  FigAttribs attributes
           
(package private)  com.lowagie.text.Rectangle bounds
           
(package private)  com.lowagie.text.pdf.PdfContentByte cb
           
(package private)  com.lowagie.text.Document document
           
(package private)  com.lowagie.text.pdf.BaseFont font1
           
(package private)  com.lowagie.text.pdf.BaseFont font2
           
(package private)  boolean fourUpMode
           
(package private)  ItextFontMapper mapper
           
(package private)  FigObjectList objectList
           
(package private)  java.io.OutputStream outputStream
           
(package private)  int pagenumber
           
(package private)  FigParser parser
           
(package private)  com.lowagie.text.pdf.PdfWriter pdfWriter
           
(package private)  PresentationParser presentationParser
           
static int SLEEP_MILLIS
           
(package private)  FigTrafo2D trafo
           
 
Constructor Summary
ItextPresentationPDFWriter()
          Create an ItextPresentationPDFWriter.
 
Method Summary
static void main(java.lang.String[] argv)
           
 void makeBufferedImagesWithoutAlpha()
           
static void msg(java.lang.String s)
           
 void openOutputStream(java.lang.String filename)
           
 void openPresentation(java.lang.String filename)
          open and parse the specified jfig presentation index file (.jpt)
 void parseSlide(java.lang.String resourcename)
           
static void usage()
           
 void waitForTheImages_ASYNC()
           
 void waitForTheImages()
          use a MediaTracker to preload all images embedded in the current FIG slide.
 void writeHeader()
          write the PDF header for our multipage PDF document using Itext .
 void writeOnePage(int _pagecount)
           
 void writePDF()
          write a multipage PDF document consisting of header, PDF objects for each slide in the jfig presentation, and the PDF trailer.
 void writeTestPage()
           
 void writeTrailer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectList

FigObjectList objectList

trafo

FigTrafo2D trafo

attributes

FigAttribs attributes

parser

FigParser parser

presentationParser

PresentationParser presentationParser

outputStream

java.io.OutputStream outputStream

mapper

ItextFontMapper mapper

pdfWriter

com.lowagie.text.pdf.PdfWriter pdfWriter

cb

com.lowagie.text.pdf.PdfContentByte cb

document

com.lowagie.text.Document document

bounds

com.lowagie.text.Rectangle bounds

font1

com.lowagie.text.pdf.BaseFont font1

font2

com.lowagie.text.pdf.BaseFont font2

SLEEP_MILLIS

public static final int SLEEP_MILLIS
See Also:
Constant Field Values

fourUpMode

boolean fourUpMode

pagenumber

int pagenumber
Constructor Detail

ItextPresentationPDFWriter

public ItextPresentationPDFWriter()
Create an ItextPresentationPDFWriter. The output page format is currently hardcoded to A4 landscape.

Method Detail

openPresentation

public void openPresentation(java.lang.String filename)
open and parse the specified jfig presentation index file (.jpt)


writePDF

public void writePDF()
              throws java.lang.Exception
write a multipage PDF document consisting of header, PDF objects for each slide in the jfig presentation, and the PDF trailer. For each FIG slide, we parse the FIG file, wait until embedded images are loaded, then render PDF for that file.

Throws:
java.lang.Exception

openOutputStream

public void openOutputStream(java.lang.String filename)
                      throws java.lang.Exception
Throws:
java.lang.Exception

parseSlide

public void parseSlide(java.lang.String resourcename)

writeHeader

public void writeHeader()
                 throws java.lang.Exception
write the PDF header for our multipage PDF document using Itext .

Throws:
java.lang.Exception

waitForTheImages

public void waitForTheImages()
                      throws java.lang.Exception
use a MediaTracker to preload all images embedded in the current FIG slide.

Throws:
java.lang.Exception

waitForTheImages_ASYNC

public void waitForTheImages_ASYNC()
                            throws java.lang.Exception
Throws:
java.lang.Exception

makeBufferedImagesWithoutAlpha

public void makeBufferedImagesWithoutAlpha()

writeOnePage

public void writeOnePage(int _pagecount)
                  throws java.lang.Exception
Throws:
java.lang.Exception

writeTestPage

public void writeTestPage()
                   throws java.lang.Exception
Throws:
java.lang.Exception

writeTrailer

public void writeTrailer()
                  throws java.lang.Exception
Throws:
java.lang.Exception

msg

public static void msg(java.lang.String s)

usage

public static void usage()

main

public static void main(java.lang.String[] argv)