fixed misc bugs in the hslf how-to doc

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@530029 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2007-04-18 14:21:40 +00:00
parent 01e84ba7f0
commit f9a0dbf4a4
1 changed files with 13 additions and 12 deletions

View File

@ -54,7 +54,7 @@
//save changes in a file //save changes in a file
FileOutputStream out = new FileOutputStream("slideshow.ppt"); FileOutputStream out = new FileOutputStream("slideshow.ppt");
wb.write(out); ppt.write(out);
out.close(); out.close();
</source> </source>
</section> </section>
@ -71,7 +71,7 @@
ppt.setPageSize(new java.awt.Dimension(1024, 768)); ppt.setPageSize(new java.awt.Dimension(1024, 768));
//save changes //save changes
FileOutputStream out = new FileOutputStream("slideshow.ppt"); FileOutputStream out = new FileOutputStream("slideshow.ppt");
wb.write(out); ppt.write(out);
out.close(); out.close();
</source> </source>
</section> </section>
@ -123,8 +123,8 @@
of the upper left corner of the bounding box for the shape relative to the upper left of the upper left corner of the bounding box for the shape relative to the upper left
corner of the slide. Distances in the drawing layer are measured in points (72 points = 1 inch). corner of the slide. Distances in the drawing layer are measured in points (72 points = 1 inch).
</p> </p>
<source> <source>
SlideShow ppt = new SlideShow(); SlideShow ppt = new SlideShow();
Slide slide = ppt.createSlide(); Slide slide = ppt.createSlide();
@ -132,7 +132,7 @@
Line line = new Line(); Line line = new Line();
line.setAnchor(new java.awt.Rectangle(50, 50, 100, 20)); line.setAnchor(new java.awt.Rectangle(50, 50, 100, 20));
line.setLineColor(new Color(0, 128, 0)); line.setLineColor(new Color(0, 128, 0));
line.setLineStyle(Line.LineDashDotSys); line.setLineStyle(Line.LINE_DOUBLE);
slide.addShape(line); slide.addShape(line);
//TextBox //TextBox
@ -141,7 +141,7 @@
txt.setAnchor(new java.awt.Rectangle(300, 100, 300, 50)); txt.setAnchor(new java.awt.Rectangle(300, 100, 300, 50));
//use RichTextRun to work with the text format //use RichTextRun to work with the text format
RichTextRun rt = txt.getRichTextRuns()[0]; RichTextRun rt = txt.getTextRun().getRichTextRuns()[0];
rt.setFontSize(32); rt.setFontSize(32);
rt.setFontName("Arial"); rt.setFontName("Arial");
rt.setBold(true); rt.setBold(true);
@ -166,8 +166,9 @@
slide.addShape(sh2); slide.addShape(sh2);
FileOutputStream out = new FileOutputStream("slideshow.ppt"); FileOutputStream out = new FileOutputStream("slideshow.ppt");
ppt.write(out); ppt.write(out);
out.close(); out.close();
</source> </source>
</section> </section>
<anchor id="Pictures"/> <anchor id="Pictures"/>
@ -228,9 +229,9 @@
for (int i = 0; i &lt; sh.length; i++){ for (int i = 0; i &lt; sh.length; i++){
if (sh[i] instanceof Picture){ if (sh[i] instanceof Picture){
Picture pict = (Picture)sh[i]; Picture pict = (Picture)sh[i];
PictureData data = pict.getPictureData(); PictureData pictData = pict.getPictureData();
byte[] data = pict.getData(); byte[] data = pictData.getData();
int type = pict.getType(); int type = pictData.getType();
if (type == Picture.JPEG){ if (type == Picture.JPEG){
FileOutputStream out = new FileOutputStream("slide0_"+i+".jpg"); FileOutputStream out = new FileOutputStream("slide0_"+i+".jpg");
out.write(data); out.write(data);
@ -244,7 +245,7 @@
} }
FileOutputStream out = new FileOutputStream("slideshow.ppt"); FileOutputStream out = new FileOutputStream("slideshow.ppt");
wb.write(out); ppt.write(out);
out.close(); out.close();
</source> </source>
@ -259,7 +260,7 @@
//save changes //save changes
FileOutputStream out = new FileOutputStream("slideshow.ppt"); FileOutputStream out = new FileOutputStream("slideshow.ppt");
wb.write(out); ppt.write(out);
out.close(); out.close();
</source> </source>
<p> <p>