FreeHEP API
Version current

org.freehep.graphicsio.pdf
Class PDFStream

java.lang.Object
  extended byorg.freehep.graphicsio.pdf.PDFDictionary
      extended byorg.freehep.graphicsio.pdf.PDFStream
All Implemented Interfaces:
PDFConstants

public class PDFStream
extends PDFDictionary
implements PDFConstants

This class allows you to write/print into a PDFStream. Several methods are available to specify the content of a page, image. This class performs some error checking, while writing the stream.

The stream allows to write dictionary entries. The /Length entry is written automatically, referencing an object which will also be written just after the stream is closed and the length is calculated.

Version:
$Id: PDFStream.java,v 1.11 2003/05/27 22:35:43 duns Exp $
Author:
Mark Donszelmann
Source Code:
PDFStream.java

Field Summary
 
Fields inherited from class org.freehep.graphicsio.pdf.PDFDictionary
out, pdf
 
Fields inherited from interface org.freehep.graphicsio.pdf.PDFConstants
CAP_BUTT, CAP_ROUND, CAP_SQUARE, dateFormat, EOL, JOIN_BEVEL, JOIN_MITTER, JOIN_ROUND, MODE_CLIP, MODE_FILL, MODE_FILL_CLIP, MODE_FILL_STROKE, MODE_FILL_STROKE_CLIP, MODE_INVISIBLE, MODE_STROKE, MODE_STROKE_CLIP
 
Method Summary
 void beginCompatibility()
           
 void beginText()
           
 void cap(int capStyle)
           
 void charSpace(double charSpace)
           
 void clip()
           
 void clipEvenOdd()
           
 void closeAndStroke()
           
 void closeFillAndStroke()
           
 void closeFillEvenOddAndStroke()
           
 void closePath()
           
 void colorSpace(double g)
           
 void colorSpace(double[] color)
           
 void colorSpace(double[] color, PDFName name)
           
 void colorSpace(double r, double g, double b)
           
 void colorSpace(double c, double m, double y, double k)
           
 void colorSpace(PDFName colorSpace)
           
 void colorSpaceStroke(double g)
           
 void colorSpaceStroke(double[] color)
           
 void colorSpaceStroke(double[] color, PDFName name)
           
 void colorSpaceStroke(double r, double g, double b)
           
 void colorSpaceStroke(double c, double m, double y, double k)
           
 void colorSpaceStroke(PDFName colorSpace)
           
 void comment(String comment)
           
 void cubic(double x1, double y1, double x2, double y2, double x3, double y3)
           
 void cubicV(double x2, double y2, double x3, double y3)
           
 void cubicY(double x1, double y1, double x3, double y3)
           
 void dash(double[] dash, double phase)
           
 void dash(int[] dash, double phase)
           
 boolean drawPath(Shape s)
          Draws the points of the shape using path construction operators.
 void endCompatibility()
           
 void endPath()
           
 void endText()
           
 void fill()
           
 void fillAndStroke()
           
 void fillEvenOdd()
           
 void fillEvenOddAndStroke()
           
 void flatness(double flatness)
           
 void font(PDFName fontName, double size)
           
 int getLength()
           
 void glyph(double wx, double wy)
           
 void glyph(double wx, double wy, double llx, double lly, double urx, double ury)
           
 void image(RenderedImage image, Color bkg, String[] encode)
          Image convenience function (see Table 4.35).
 void imageMask(RenderedImage image, String[] encode)
           
 void inlineImage(RenderedImage image, Color bkg, String[] encode)
          Inline Image convenience function (see Table 4.39 and 4.40).
 void join(int joinStyle)
           
 void leading(double leading)
           
 void line(double x, double y)
           
 void matrix(AffineTransform xform)
           
 void matrix(double m00, double m10, double m01, double m11, double m02, double m12)
           
 void mitterLimit(double limit)
           
 void move(double x, double y)
           
 void print(String s)
           
 void println(String s)
           
 void rectangle(double x, double y, double width, double height)
           
 void rendering(int mode)
           
 void restore()
           
 void rise(double rise)
           
 void save()
           
 void scale(double scale)
           
 void shade(PDFName name)
           
 void show(Object[] array)
           
 void show(String text)
           
 void showLine(double wordSpace, double charSpace, String text)
           
 void showLine(String text)
           
 void state(PDFName stateDictionary)
           
 void stroke()
           
 void text(double x, double y)
           
 void textLeading(double x, double y)
           
 void textLine()
           
 void textMatrix(double a, double b, double c, double d, double e, double f)
           
 void width(double width)
           
 void wordSpace(double wordSpace)
           
 void xObject(PDFName name)
           
 
Methods inherited from class org.freehep.graphicsio.pdf.PDFDictionary
close, entry, entry, entry, entry, entry, entry, entry, entry, entry, entry, entry, openDictionary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLength

public int getLength()

print

public void print(String s)
           throws IOException
Throws:
IOException

println

public void println(String s)
             throws IOException
Throws:
IOException

comment

public void comment(String comment)
             throws IOException
Throws:
IOException

save

public void save()
          throws IOException
Throws:
IOException

restore

public void restore()
             throws IOException
Throws:
IOException

matrix

public void matrix(AffineTransform xform)
            throws IOException
Throws:
IOException

matrix

public void matrix(double m00,
                   double m10,
                   double m01,
                   double m11,
                   double m02,
                   double m12)
            throws IOException
Throws:
IOException

width

public void width(double width)
           throws IOException
Throws:
IOException

cap

public void cap(int capStyle)
         throws IOException
Throws:
IOException

join

public void join(int joinStyle)
          throws IOException
Throws:
IOException

mitterLimit

public void mitterLimit(double limit)
                 throws IOException
Throws:
IOException

dash

public void dash(int[] dash,
                 double phase)
          throws IOException
Throws:
IOException

dash

public void dash(double[] dash,
                 double phase)
          throws IOException
Throws:
IOException

flatness

public void flatness(double flatness)
              throws IOException
Throws:
IOException

state

public void state(PDFName stateDictionary)
           throws IOException
Throws:
IOException

cubic

public void cubic(double x1,
                  double y1,
                  double x2,
                  double y2,
                  double x3,
                  double y3)
           throws IOException
Throws:
IOException

cubicV

public void cubicV(double x2,
                   double y2,
                   double x3,
                   double y3)
            throws IOException
Throws:
IOException

cubicY

public void cubicY(double x1,
                   double y1,
                   double x3,
                   double y3)
            throws IOException
Throws:
IOException

move

public void move(double x,
                 double y)
          throws IOException
Throws:
IOException

line

public void line(double x,
                 double y)
          throws IOException
Throws:
IOException

closePath

public void closePath()
               throws IOException
Throws:
IOException

rectangle

public void rectangle(double x,
                      double y,
                      double width,
                      double height)
               throws IOException
Throws:
IOException

stroke

public void stroke()
            throws IOException
Throws:
IOException

closeAndStroke

public void closeAndStroke()
                    throws IOException
Throws:
IOException

fill

public void fill()
          throws IOException
Throws:
IOException

fillEvenOdd

public void fillEvenOdd()
                 throws IOException
Throws:
IOException

fillAndStroke

public void fillAndStroke()
                   throws IOException
Throws:
IOException

fillEvenOddAndStroke

public void fillEvenOddAndStroke()
                          throws IOException
Throws:
IOException

closeFillAndStroke

public void closeFillAndStroke()
                        throws IOException
Throws:
IOException

closeFillEvenOddAndStroke

public void closeFillEvenOddAndStroke()
                               throws IOException
Throws:
IOException

endPath

public void endPath()
             throws IOException
Throws:
IOException

clip

public void clip()
          throws IOException
Throws:
IOException

clipEvenOdd

public void clipEvenOdd()
                 throws IOException
Throws:
IOException

beginText

public void beginText()
               throws IOException
Throws:
IOException

endText

public void endText()
             throws IOException
Throws:
IOException

charSpace

public void charSpace(double charSpace)
               throws IOException
Throws:
IOException

wordSpace

public void wordSpace(double wordSpace)
               throws IOException
Throws:
IOException

scale

public void scale(double scale)
           throws IOException
Throws:
IOException

leading

public void leading(double leading)
             throws IOException
Throws:
IOException

font

public void font(PDFName fontName,
                 double size)
          throws IOException
Throws:
IOException

rendering

public void rendering(int mode)
               throws IOException
Throws:
IOException

rise

public void rise(double rise)
          throws IOException
Throws:
IOException

text

public void text(double x,
                 double y)
          throws IOException
Throws:
IOException

textLeading

public void textLeading(double x,
                        double y)
                 throws IOException
Throws:
IOException

textMatrix

public void textMatrix(double a,
                       double b,
                       double c,
                       double d,
                       double e,
                       double f)
                throws IOException
Throws:
IOException

textLine

public void textLine()
              throws IOException
Throws:
IOException

show

public void show(String text)
          throws IOException
Throws:
IOException

showLine

public void showLine(String text)
              throws IOException
Throws:
IOException

showLine

public void showLine(double wordSpace,
                     double charSpace,
                     String text)
              throws IOException
Throws:
IOException

show

public void show(Object[] array)
          throws IOException
Throws:
IOException

glyph

public void glyph(double wx,
                  double wy)
           throws IOException
Throws:
IOException

glyph

public void glyph(double wx,
                  double wy,
                  double llx,
                  double lly,
                  double urx,
                  double ury)
           throws IOException
Throws:
IOException

colorSpace

public void colorSpace(PDFName colorSpace)
                throws IOException
Throws:
IOException

colorSpaceStroke

public void colorSpaceStroke(PDFName colorSpace)
                      throws IOException
Throws:
IOException

colorSpace

public void colorSpace(double[] color)
                throws IOException
Throws:
IOException

colorSpaceStroke

public void colorSpaceStroke(double[] color)
                      throws IOException
Throws:
IOException

colorSpace

public void colorSpace(double[] color,
                       PDFName name)
                throws IOException
Throws:
IOException

colorSpaceStroke

public void colorSpaceStroke(double[] color,
                             PDFName name)
                      throws IOException
Throws:
IOException

colorSpace

public void colorSpace(double g)
                throws IOException
Throws:
IOException

colorSpaceStroke

public void colorSpaceStroke(double g)
                      throws IOException
Throws:
IOException

colorSpace

public void colorSpace(double r,
                       double g,
                       double b)
                throws IOException
Throws:
IOException

colorSpaceStroke

public void colorSpaceStroke(double r,
                             double g,
                             double b)
                      throws IOException
Throws:
IOException

colorSpace

public void colorSpace(double c,
                       double m,
                       double y,
                       double k)
                throws IOException
Throws:
IOException

colorSpaceStroke

public void colorSpaceStroke(double c,
                             double m,
                             double y,
                             double k)
                      throws IOException
Throws:
IOException

shade

public void shade(PDFName name)
           throws IOException
Throws:
IOException

image

public void image(RenderedImage image,
                  Color bkg,
                  String[] encode)
           throws IOException
Image convenience function (see Table 4.35). Ouputs the data of the image using "DeviceRGB" colorspace, and the requested encodings

Throws:
IOException

imageMask

public void imageMask(RenderedImage image,
                      String[] encode)
               throws IOException
Throws:
IOException

inlineImage

public void inlineImage(RenderedImage image,
                        Color bkg,
                        String[] encode)
                 throws IOException
Inline Image convenience function (see Table 4.39 and 4.40). Ouputs the data of the image using "DeviceRGB" colorspace, and the requested encoding.

Throws:
IOException

drawPath

public boolean drawPath(Shape s)
                 throws IOException
Draws the points of the shape using path construction operators. The path is neither stroked nor filled.

Returns:
true if even-odd winding rule should be used, false if non-zero winding rule should be used.
Throws:
IOException

xObject

public void xObject(PDFName name)
             throws IOException
Throws:
IOException

beginCompatibility

public void beginCompatibility()
                        throws IOException
Throws:
IOException

endCompatibility

public void endCompatibility()
                      throws IOException
Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.