jfig.utils
Class PresentationPDFWriter

java.lang.Object
  extended byjfig.utils.PresentationPDFWriter

public class PresentationPDFWriter
extends java.lang.Object

use the PDFWriter and PDFGraphics2D classes from the Freehep project to export a given jfig presentation (in JAR format) to PDF format. Usage: go to the base directory of the presentation, then run java jfig.utils.PresentationPDFWriter 00presentation.jpt and wait...


Field Summary
(package private)  FigAttribs attributes
           
(package private)  java.awt.Rectangle bounds
           
(package private)  FigObjectList objectList
           
(package private)  java.io.OutputStream outputStream
           
(package private)  FigParser parser
           
(package private)  PDFGraphics2D pdf2D
           
(package private)  PresentationParser presentationParser
           
(package private)  java.util.Properties props
           
static int SLEEP_MILLIS
           
(package private)  FigTrafo2D trafo
           
 
Constructor Summary
PresentationPDFWriter()
          construct a PresentationPDFWriter relying on the FreeHEP graphicsio.pdf classes.
 
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)
           
 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 FreeHEP PDFGraphics2D (version 1.2).
 void writeOnePage()
           
 void writePDF()
          write a multipage PDF document consisting of header, PDF objects for each slide in the jfig presentation, and the PDF trailer.
 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

pdf2D

PDFGraphics2D pdf2D

bounds

java.awt.Rectangle bounds

props

java.util.Properties props

SLEEP_MILLIS

public static final int SLEEP_MILLIS
See Also:
Constant Field Values
Constructor Detail

PresentationPDFWriter

public PresentationPDFWriter()
construct a PresentationPDFWriter relying on the FreeHEP graphicsio.pdf classes. 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 embedde 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 FreeHEP PDFGraphics2D (version 1.2). Note that we have to use the properties-based API introduced in version 1.2 instead of simple direct calls.

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()
                  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)

main

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