jfig.utils
Class ItextPDFWriter

java.lang.Object
  extended byjfig.utils.ItextPDFWriter

public class ItextPDFWriter
extends java.lang.Object

convert FIG to PDF using the iText PDF library. See www.lowagie.com/iText/ for details and docs.


Field Summary
static double _72_DPI
           
static double _75_DPI
           
static int A4_HEIGHT
           
static int A4_WIDTH
           
 
Constructor Summary
ItextPDFWriter(com.lowagie.text.Document document, com.lowagie.text.pdf.FontMapper mapper, java.awt.Graphics2D pdf2D)
           
 
Method Summary
 int getStringWidthPoints(int fontIndex, int ptSize, java.lang.String s)
           
static void main(java.lang.String[] args)
           
 void msg(java.lang.String s)
           
 void paintOneObject(FigObject tmp)
           
 void paintOneTextObject(FigText textObject)
          paint one text object to the PDF file.
 void setDocument(com.lowagie.text.Document document)
           
 void setFontMapper(com.lowagie.text.pdf.FontMapper mapper)
           
 void setOrigTrafo(FigTrafo2D origTrafo)
           
 void setPageNumber(int p)
           
 void setPageOffsets(float dx, float dy)
          e.g., used for FigImages in 4-up mode pages...
 void setPageOffsets(float dx, float dy, float w, float h)
           
 void setTrafo(FigTrafo2D trafo)
           
static void usage()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

A4_WIDTH

public static final int A4_WIDTH
See Also:
Constant Field Values

A4_HEIGHT

public static final int A4_HEIGHT
See Also:
Constant Field Values

_72_DPI

public static final double _72_DPI
See Also:
Constant Field Values

_75_DPI

public static final double _75_DPI
See Also:
Constant Field Values
Constructor Detail

ItextPDFWriter

public ItextPDFWriter(com.lowagie.text.Document document,
                      com.lowagie.text.pdf.FontMapper mapper,
                      java.awt.Graphics2D pdf2D)
Method Detail

setFontMapper

public void setFontMapper(com.lowagie.text.pdf.FontMapper mapper)

setDocument

public void setDocument(com.lowagie.text.Document document)

setTrafo

public void setTrafo(FigTrafo2D trafo)

setOrigTrafo

public void setOrigTrafo(FigTrafo2D origTrafo)

setPageNumber

public void setPageNumber(int p)

setPageOffsets

public void setPageOffsets(float dx,
                           float dy)
e.g., used for FigImages in 4-up mode pages...


setPageOffsets

public void setPageOffsets(float dx,
                           float dy,
                           float w,
                           float h)

paintOneObject

public void paintOneObject(FigObject tmp)

paintOneTextObject

public void paintOneTextObject(FigText textObject)
paint one text object to the PDF file. This method is based on the stuff in jfig.java2d.FigTextRenderer. We need special handling here, because the font widths used for on-screen rendering (e.g. Lucida fonts) might be different for the font widths used in the PDF file (e.g. Times/Helvetica/Courier).


getStringWidthPoints

public int getStringWidthPoints(int fontIndex,
                                int ptSize,
                                java.lang.String s)

msg

public void msg(java.lang.String s)

usage

public static void usage()

main

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