}\r
}\r
\r
- try\r
+ if(file!=null)\r
{\r
- out = new FileOutputStream(file);\r
+ try\r
+ {\r
+ out = new FileOutputStream(file);\r
\r
- if (type == EPS)\r
- setupEPS(width, height, EPStitle);\r
- else\r
- setupPNG(width, height);\r
- }\r
- catch (Exception ex)\r
- {\r
- System.out.println("Error creating " + (type == EPS ? "EPS" : "PNG") +\r
- " file.");\r
+ if (type == EPS)\r
+ setupEPS(width, height, EPStitle);\r
+ else\r
+ setupPNG(width, height);\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ System.out.println("Error creating " + (type == EPS ? "EPS" : "PNG") +\r
+ " file.");\r
+ }\r
}\r
}\r
\r