Home » pdfbox-1.1.0-src » org.apache.pdfbox.pdmodel.edit » [javadoc | source]
org.apache.pdfbox.pdmodel.edit
public class: PDPageContentStream [javadoc | source]
java.lang.Object
   org.apache.pdfbox.pdmodel.edit.PDPageContentStream
This class will is a convenience for creating page content streams. You MUST call close() when you are finished with this object.
Constructor:
 public PDPageContentStream(PDDocument document,
    PDPage sourcePage) throws IOException 
    Create a new PDPage content stream.
    Parameters:
    document - The document the page is part of.
    sourcePage - The page to write the contents to.
    Throws:
    IOException - If there is an error writing to the page contents.
 public PDPageContentStream(PDDocument document,
    PDPage sourcePage,
    boolean appendContent,
    boolean compress) throws IOException 
    Create a new PDPage content stream.
    Parameters:
    document - The document the page is part of.
    sourcePage - The page to write the contents to.
    appendContent - Indicates whether content will be overwritten. If false all previous content is deleted.
    compress - Tell if the content stream should compress the page contents.
    Throws:
    IOException - If there is an error writing to the page contents.
Method from org.apache.pdfbox.pdmodel.edit.PDPageContentStream Summary:
appendRawCommands,   appendRawCommands,   appendRawCommands,   beginText,   close,   drawImage,   drawLine,   drawString,   drawXObject,   endText,   fillRect,   moveTextPositionByAmount,   setFont,   setLineWidth,   setNonStrokingColor,   setNonStrokingColor,   setNonStrokingColor,   setNonStrokingColor,   setNonStrokingColor,   setNonStrokingColor,   setNonStrokingColor,   setNonStrokingColorSpace,   setStrokingColor,   setStrokingColor,   setStrokingColor,   setStrokingColor,   setStrokingColor,   setStrokingColor,   setStrokingColor,   setStrokingColorSpace,   setTextMatrix,   setTextRotation,   setTextScaling,   setTextTranslation
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.pdmodel.edit.PDPageContentStream Detail:
 public  void appendRawCommands(String commands) throws IOException 
    This will append raw commands to the content stream.
 public  void appendRawCommands(byte[] commands) throws IOException 
    This will append raw commands to the content stream.
 public  void appendRawCommands(int data) throws IOException 
    This will append raw commands to the content stream.
 public  void beginText() throws IOException 
    Begin some text operations.
 public  void close() throws IOException 
    Close the content stream. This must be called when you are done with this object.
 public  void drawImage(PDXObjectImage image,
    float x,
    float y) throws IOException 
    Draw an image at the x,y coordinates, with the default size of the image.
 public  void drawLine(float xStart,
    float yStart,
    float xEnd,
    float yEnd) throws IOException 
    Draw a line on the page using the current non stroking color and the current line width.
 public  void drawString(String text) throws IOException 
    This will draw a string at the current location on the screen.
 public  void drawXObject(PDXObject xobject,
    float x,
    float y,
    float width,
    float height) throws IOException 
    Draw an xobject(form or image) at the x,y coordinates and a certain width and height.
 public  void endText() throws IOException 
    End some text operations.
 public  void fillRect(float x,
    float y,
    float width,
    float height) throws IOException 
    Draw a rectangle on the page using the current non stroking color.
 public  void moveTextPositionByAmount(float x,
    float y) throws IOException 
    The Td operator. A current text matrix will be replaced with a new one (1 0 0 1 x y).
 public  void setFont(PDFont font,
    float fontSize) throws IOException 
    Set the font to draw text with.
 public  void setLineWidth(float lineWidth) throws IOException 
    Set linewidth to the given value.
 public  void setNonStrokingColor(Color color) throws IOException 
    Set the non stroking color, specified as RGB.
 public  void setNonStrokingColor(float[] components) throws IOException 
    Set the color components of current non stroking colorspace.
 public  void setNonStrokingColor(int g) throws IOException 
    Set the non stroking color, specified as grayscale, 0-255.
 public  void setNonStrokingColor(double g) throws IOException 
    Set the non stroking color, specified as Grayscale 0.0-1.0.
 public  void setNonStrokingColor(int r,
    int g,
    int b) throws IOException 
    Set the non stroking color, specified as RGB, 0-255.
 public  void setNonStrokingColor(int c,
    int m,
    int y,
    int k) throws IOException 
    Set the non stroking color, specified as CMYK, 0-255.
 public  void setNonStrokingColor(double c,
    double m,
    double y,
    double k) throws IOException 
    Set the non stroking color, specified as CMYK, 0.0-1.0.
 public  void setNonStrokingColorSpace(PDColorSpace colorSpace) throws IOException 
    Set the stroking color space. This will add the colorspace to the PDResources if necessary.
 public  void setStrokingColor(float[] components) throws IOException 
    Set the color components of current stroking colorspace.
 public  void setStrokingColor(Color color) throws IOException 
    Set the stroking color, specified as RGB.
 public  void setStrokingColor(int g) throws IOException 
    Set the stroking color, specified as grayscale, 0-255.
 public  void setStrokingColor(double g) throws IOException 
    Set the stroking color, specified as Grayscale 0.0-1.0.
 public  void setStrokingColor(int r,
    int g,
    int b) throws IOException 
    Set the stroking color, specified as RGB, 0-255.
 public  void setStrokingColor(int c,
    int m,
    int y,
    int k) throws IOException 
    Set the stroking color, specified as CMYK, 0-255.
 public  void setStrokingColor(double c,
    double m,
    double y,
    double k) throws IOException 
    Set the stroking color, specified as CMYK, 0.0-1.0.
 public  void setStrokingColorSpace(PDColorSpace colorSpace) throws IOException 
    Set the stroking color space. This will add the colorspace to the PDResources if necessary.
 public  void setTextMatrix(double a,
    double b,
    double c,
    double d,
    double e,
    double f) throws IOException 
    The Tm operator. Sets the text matrix to the given values. A current text matrix will be replaced with the new one.
 public  void setTextRotation(double angle,
    double tx,
    double ty) throws IOException 
    The Tm operator. Sets the text matrix to the given rotation and translation values. A current text matrix will be replaced with the new one.
 public  void setTextScaling(double sx,
    double sy,
    double tx,
    double ty) throws IOException 
    The Tm operator. Sets the text matrix to the given scaling and translation values. A current text matrix will be replaced with the new one.
 public  void setTextTranslation(double tx,
    double ty) throws IOException 
    The Tm operator. Sets the text matrix to the given translation values. A current text matrix will be replaced with the new one.