@Test
    public void testInitializationViaConfig() throws Exception {
        try (InputStream is = getResourceAsStream(
                "/org/apache/tika/parser/pdf/tika-config.xml")) {
            assertNotNull(is);
            TikaConfig tikaConfig = new TikaConfig(is);
            Parser p = new AutoDetectParser(tikaConfig);

            String text =
                    getText(getResourceAsStream("/test-documents/testPDFTwoTextBoxes.pdf"), p);
            text = text.replaceAll("\\s+", " ");

            // Column text is now interleaved:
            assertContains(
                    "Left column line 1 Right column line 1 " +
                            "Left colu mn line 2 Right column line 2",
                    text);

            //test overriding underlying settings with PDFParserConfig
            ParseContext pc = new ParseContext();
            PDFParserConfig config = new PDFParserConfig();
            config.setSortByPosition(false);
            pc.set(PDFParserConfig.class, config);
            text = getText("testPDFTwoTextBoxes.pdf", p, new Metadata(), pc);
            text = text.replaceAll("\\s+", " ");
            // Column text is not interleaved:
            assertContains("Left column line 1 Left column line 2 ", text);

            //test a new PDFParserConfig and setting another value
            //this tests that the underlying "sortByPosition" as set
            //in the config file is still operative
            config = new PDFParserConfig();
            config.setOcrDPI(10000);
            config.setOcrStrategy(PDFParserConfig.OCR_STRATEGY.NO_OCR);
            pc.set(PDFParserConfig.class, config);
            text = getText("testPDFTwoTextBoxes.pdf", p, new Metadata(), pc);
            text = text.replaceAll("\\s+", " ");

            // Column text is now interleaved:
            assertContains(
                    "Left column line 1 Right column line 1 Left " +
                            "colu mn line 2 Right column line 2",
                    text);
        }
    }
Test to ensure that Links are extracted from the text
<p/>
Note - the PDF contains the text "This is a hyperlink" which
a hyperlink annotation, linking to the tika site, on it. This
test will need updating when we're able to apply the annotation
to the text itself, rather than following on afterwards as now
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/test/java/org/apache/tika/parser/pdf/PDFParserTest.java