public static void main( String[] args )
    {
        // suppress the Dock icon on OS X
        System.setProperty("apple.awt.UIElement", "true");

        int exitCode = new CommandLine(new ExtractText()).execute(args);
        System.exit(exitCode);
    }
@Test
    void testPDFBoxRepeatableSubcommandAddFileNameOutfile(@TempDir Path tempDir) throws Exception
    {
        Path path = null;
        try
        {
            path = tempDir.resolve("outfile.txt");
            Files.deleteIfExists(path);
        }
        catch (InvalidPathException ipe)
        {
            System.err.println(
                    "Error creating temporary test file in " + this.getClass().getSimpleName());
        }
        assertNotNull(path);

        PDFBox.main(new String[] { "export:text", "-i", testfile1, "-encoding", "UTF-8",
                "-addFileName", "-o", path.toString(), //
                "export:text", "-i", testfile2, "-encoding", "UTF-8", //
                "-addFileName", "-o", path.toString() });

        String result = new String(Files.readAllBytes(path), "UTF-8");
        assertFalse(result.contains("PDF1"));
        assertFalse(result.contains("PDF2"));
        assertFalse(result.contains("PDF file: " + filename1));
        assertTrue(result.contains("Hello"));
        assertTrue(result.contains("World."));
        assertTrue(result.contains("PDF file: " + filename2));
    }