public XDGFVisioExtractor(OPCPackage openPackage) throws IOException { this(new XmlVisioDocument(openPackage)); }
public XmlVisioDocument(OPCPackage pkg) throws IOException { super(pkg, PackageRelationshipTypes.VISIO_CORE_DOCUMENT); VisioDocumentType document; try { document = VisioDocumentDocument1.Factory.parse(getPackagePart().getInputStream()).getVisioDocument(); } catch (XmlException | IOException e) { throw new POIXMLException(e); } _document = new XDGFDocument(document); //build a tree of POIXMLDocumentParts, this document being the root load(new XDGFFactory(_document)); }
public static void printHierarchy(XmlVisioDocument document, String outDirname) throws FileNotFoundException, UnsupportedEncodingException, IOException { File outDir = new File(outDirname); for (XDGFPage page : document.getPages()) { printHierarchy(page, outDir); } }
@Override protected void onDocumentRead() { // by the time this gets called, all other document parts should // have been loaded, so it's safe to build the document structure // note that in other onDocumentRead(), relations/etc may not have // loaded yet, so it's not quite safe for (POIXMLDocumentPart part : getRelations()) { // organize the document pieces if (part instanceof XDGFPages) _pages = (XDGFPages) part; else if (part instanceof XDGFMasters) _masters = (XDGFMasters) part; } if (_masters != null) _masters.onDocumentRead(); _pages.onDocumentRead(); }
@Override protected void onDocumentRead() { // by the time this gets called, all other document parts should // have been loaded, so it's safe to build the document structure // note that in other onDocumentRead(), relations/etc may not have // loaded yet, so it's not quite safe for (POIXMLDocumentPart part : getRelations()) { // organize the document pieces if (part instanceof XDGFPages) _pages = (XDGFPages) part; else if (part instanceof XDGFMasters) _masters = (XDGFMasters) part; } if (_masters != null) _masters.onDocumentRead(); _pages.onDocumentRead(); }
public XmlVisioDocument(OPCPackage pkg) throws IOException { super(pkg, PackageRelationshipTypes.VISIO_CORE_DOCUMENT); VisioDocumentType document; try { document = VisioDocumentDocument1.Factory.parse(getPackagePart().getInputStream()).getVisioDocument(); } catch (XmlException | IOException e) { throw new POIXMLException(e); } _document = new XDGFDocument(document); //build a tree of POIXMLDocumentParts, this document being the root load(new XDGFFactory(_document)); }
public static void renderToPng(XmlVisioDocument document, String outDirname, double scale, ShapeRenderer renderer) throws IOException { File outDir = new File(outDirname); for (XDGFPage page : document.getPages()) { renderToPngDir(page, outDir, scale, renderer); } }
public static void main(String[] args) throws Exception { if (args.length != 2) { System.err.println("Usage: in.vsdx outdir"); System.exit(1); } String inFilename = args[0]; String outDir = args[1]; try (FileInputStream is = new FileInputStream(inFilename)) { XmlVisioDocument doc = new XmlVisioDocument(is); printHierarchy(doc, outDir); } } }
public String getText() { ShapeTextVisitor visitor = new ShapeTextVisitor(); for (XDGFPage page: document.getPages()) { page.getContent().visitShapes(visitor); } return visitor.getText(); }
public static void main(String[] args) throws Exception { if (args.length > 2) { System.err.println("Usage: [--debug] in.vsdx outdir"); System.exit(1); } ShapeRenderer renderer = new ShapeRenderer(); String inFilename = args[0]; String pngDir = args[1]; if (args[0].equals("--debug")) { inFilename = args[1]; pngDir = args[2]; renderer = new ShapeDebuggerRenderer(); } try (FileInputStream is = new FileInputStream(inFilename)) { XmlVisioDocument doc = new XmlVisioDocument(is); renderToPng(doc, pngDir, 2000 / 11.0, renderer); } } }
public static void renderToPng(XmlVisioDocument document, String outDirname, double scale, ShapeRenderer renderer) throws IOException { File outDir = new File(outDirname); for (XDGFPage page : document.getPages()) { renderToPngDir(page, outDir, scale, renderer); } }
public XDGFVisioExtractor(OPCPackage openPackage) throws IOException { this(new XmlVisioDocument(openPackage)); }
public static void printHierarchy(XmlVisioDocument document, String outDirname) throws FileNotFoundException, UnsupportedEncodingException, IOException { File outDir = new File(outDirname); for (XDGFPage page : document.getPages()) { printHierarchy(page, outDir); } }
public static void main(String[] args) throws Exception { if (args.length != 2) { System.err.println("Usage: in.vsdx outdir"); System.exit(1); } String inFilename = args[0]; String outDir = args[1]; try (FileInputStream is = new FileInputStream(inFilename)) { XmlVisioDocument doc = new XmlVisioDocument(is); printHierarchy(doc, outDir); } } }
public String getText() { ShapeTextVisitor visitor = new ShapeTextVisitor(); for (XDGFPage page: document.getPages()) { page.getContent().visitShapes(visitor); } return visitor.getText(); }
public static void main(String[] args) throws Exception { if (args.length > 2) { System.err.println("Usage: [--debug] in.vsdx outdir"); System.exit(1); } ShapeRenderer renderer = new ShapeRenderer(); String inFilename = args[0]; String pngDir = args[1]; if (args[0].equals("--debug")) { inFilename = args[1]; pngDir = args[2]; renderer = new ShapeDebuggerRenderer(); } try (FileInputStream is = new FileInputStream(inFilename)) { XmlVisioDocument doc = new XmlVisioDocument(is); renderToPng(doc, pngDir, 2000 / 11.0, renderer); } } }