2004-04-09 13:05:39 +00:00
|
|
|
|
|
|
|
|
/* ====================================================================
|
2006-12-22 19:18:16 +00:00
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
2004-04-09 13:05:39 +00:00
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
==================================================================== */
|
2020-12-26 00:08:19 +00:00
|
|
|
|
2004-04-09 11:45:38 +00:00
|
|
|
package org.apache.poi.util;
|
|
|
|
|
|
2015-05-11 18:59:10 +00:00
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
2015-09-08 00:04:12 +00:00
|
|
|
import java.io.OutputStreamWriter;
|
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
|
import java.nio.charset.Charset;
|
2015-05-11 18:59:10 +00:00
|
|
|
|
2004-04-09 11:45:38 +00:00
|
|
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
2005-05-01 11:26:18 +00:00
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
2018-08-31 00:25:50 +00:00
|
|
|
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
2016-07-03 07:20:47 +00:00
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
2004-04-09 11:45:38 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Dump out the aggregated escher records
|
|
|
|
|
*/
|
2018-08-31 00:25:50 +00:00
|
|
|
public final class DrawingDump {
|
|
|
|
|
private DrawingDump() {
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-08 00:04:12 +00:00
|
|
|
public static void main( String[] args ) throws IOException {
|
2020-12-26 00:08:19 +00:00
|
|
|
try (OutputStreamWriter osw = new OutputStreamWriter(System.out, Charset.defaultCharset());
|
|
|
|
|
PrintWriter pw = new PrintWriter(osw);
|
|
|
|
|
POIFSFileSystem fs = new POIFSFileSystem(new File(args[0]));
|
|
|
|
|
HSSFWorkbook wb = new HSSFWorkbook(fs)) {
|
|
|
|
|
|
2015-09-08 00:04:12 +00:00
|
|
|
pw.println( "Drawing group:" );
|
2014-11-09 17:53:10 +00:00
|
|
|
wb.dumpDrawingGroupRecords(true);
|
2020-12-26 00:08:19 +00:00
|
|
|
|
2016-07-03 07:20:47 +00:00
|
|
|
int i = 1;
|
|
|
|
|
for (Sheet sheet : wb)
|
2014-11-09 17:53:10 +00:00
|
|
|
{
|
2016-07-03 07:20:47 +00:00
|
|
|
pw.println( "Sheet " + i + "(" + sheet.getSheetName() + "):" );
|
|
|
|
|
((HSSFSheet) sheet).dumpDrawingRecords(true, pw);
|
2014-11-09 17:53:10 +00:00
|
|
|
}
|
2005-05-01 11:26:18 +00:00
|
|
|
}
|
2004-04-09 11:45:38 +00:00
|
|
|
}
|
|
|
|
|
}
|