PDFParser extends AbstractParser implements Initializable { @Field void setIfXFAExtractOnlyXFA(boolean ifXFAExtractOnlyXFA) { defaultConfig.setIfXFAExtractOnlyXFA(ifXFAExtractOnlyXFA); }  Set<MediaType> getSupportedTypes(ParseContext context); void parse(
            InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context); PDFParserConfig getPDFParserConfig(); void setPDFParserConfig(PDFParserConfig config); boolean getEnableAutoSpace(); @Field void setEnableAutoSpace(boolean v); boolean getExtractAnnotationText(); void setExtractAnnotationText(boolean v); boolean getSuppressDuplicateOverlappingText(); @Field void setSuppressDuplicateOverlappingText(boolean v); boolean getSortByPosition(); @Field void setSortByPosition(boolean v); @Field void setOcrStrategy(String ocrStrategyString); @Field void setOcrImageType(String imageType); void setInitializableProblemHandler(InitializableProblemHandler initializableProblemHandler); @Field void setDropThreshold(float dropThreshold); @Field void setMaxMainMemoryBytes(long maxMainMemoryBytes); @Override void initialize(Map<String, Param> params); @Override void checkInitialization(InitializableProblemHandler handler); static final String PASSWORD; }
@Test public void testXFAOnly() throws Exception { ParseContext context = new ParseContext(); PDFParserConfig config = new PDFParserConfig(); config.setIfXFAExtractOnlyXFA(true); context.set(PDFParserConfig.class, config); String xml = getXML("testPDF_XFA_govdocs1_258578.pdf", context).xml; assertContains("<body><div class=\"xfa_content\">", xml); assertContains("<li fieldName=\"Room_1\">Room [1]: my_room1</li>", xml); assertNotContained("Mount Rushmore National Memorial", xml); }