LoadOptions is used to set the file format or the password of the document, and ParserSettings is used to customize data extraction (for example, logging or an OCR connector).
The following example shows how to load the document from the url:
URLurl=newURL("https://www.bu.edu/csmet/files/2021/03/Getting-Started-with-SQLite.pdf");// Create an instance of Parser class with the url
try(Parserparser=newParser(url)){// Extract a text into the reader
try(TextReaderreader=parser.getText()){// Print a text from the document
// If text extraction isn't supported, a reader is null
System.out.println(reader==null?"Text extraction isn't supported":reader.readToEnd());}}
Note
This constructor makes GroupDocs.Parser download the document itself: the document is read with URL.openStream(), so any protocol supported by the Java runtime (including file:) is accepted. If the URL comes from untrusted input, validate it (for example, allow only https and the expected hosts) before use. See Network access and data privacy for the full list of situations in which the library performs outbound network requests.
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples: