Search in sources :

Example 6 with XmlVisioDocument

use of org.apache.poi.xdgf.usermodel.XmlVisioDocument in project poi by apache.

the class TestXDGFVisioExtractor method setUp.

@Before
public void setUp() throws Exception {
    pkg = OPCPackage.open(SAMPLES.openResourceAsStream("test_text_extraction.vsdx"));
    xml = new XmlVisioDocument(pkg);
}
Also used : XmlVisioDocument(org.apache.poi.xdgf.usermodel.XmlVisioDocument) Before(org.junit.Before)

Example 7 with XmlVisioDocument

use of org.apache.poi.xdgf.usermodel.XmlVisioDocument in project poi by apache.

the class TestXDGFVisioExtractor method testVisioConnects.

//the point of this is to trigger the addition of
//some common visio classes -- ConnectsType
@Test
public void testVisioConnects() throws IOException {
    InputStream is = SAMPLES.openResourceAsStream("60489.vsdx");
    XmlVisioDocument document = new XmlVisioDocument(is);
    is.close();
    XDGFVisioExtractor extractor = new XDGFVisioExtractor(document);
    String text = extractor.getText();
    assertContains(text, "Arrears");
    extractor.close();
}
Also used : InputStream(java.io.InputStream) XmlVisioDocument(org.apache.poi.xdgf.usermodel.XmlVisioDocument) Test(org.junit.Test)

Aggregations

XmlVisioDocument (org.apache.poi.xdgf.usermodel.XmlVisioDocument)7 Test (org.junit.Test)3 InputStream (java.io.InputStream)2 FileInputStream (java.io.FileInputStream)1 OPCPackage (org.apache.poi.openxml4j.opc.OPCPackage)1 ShapeDebuggerRenderer (org.apache.poi.xdgf.usermodel.shape.ShapeDebuggerRenderer)1 ShapeRenderer (org.apache.poi.xdgf.usermodel.shape.ShapeRenderer)1 Before (org.junit.Before)1