Changes between Version 5 and Version 6 of Usage


Ignore:
Timestamp:
Dec 2, 2010, 8:58:17 PM (8 years ago)
Author:
Erich Seifert
Comment:

Usage of getBytes() method for output

Legend:

Unmodified
Added
Removed
Modified
  • Usage

    v5 v6  
    2020    public static void main(String[] args) throws IOException {
    2121        // Create a new PDF document with a width of 210 and a height of 297
    22         Graphics2D g = new PDFGraphics2D(0.0, 0.0, 210.0, 297.0);
     22        PDFGraphics2D g = new PDFGraphics2D(0.0, 0.0, 210.0, 297.0);
    2323
    2424        // Draw a red ellipse at the position (20, 30) with a width of 100 and a height of 150
     
    2929        FileOutputStream file = new FileOutputStream("ellipse.pdf");
    3030        try {
    31             file.write(g.toString().getBytes("iso-8859-1"));
     31            file.write(g.getBytes());
    3232        } finally {
    3333            file.close();
     
    5656    public static void main(String[] args) throws IOException {
    5757        // Create a new PDF document with a width of 210 and a height of 297
    58         Graphics2D g = new SVGGraphics2D(0.0, 0.0, 210.0, 297.0);
     58        SVGGraphics2D g = new SVGGraphics2D(0.0, 0.0, 210.0, 297.0);
    5959
    6060        // Only draw in a ellipse at the position (20, 30) with a width of 100 and a height of 150
     
    6969        FileOutputStream file = new FileOutputStream("clipping.svg");
    7070        try {
    71             file.write(g.toString().getBytes());
     71            file.write(g.getBytes());
    7272        } finally {
    7373            file.close();