|
RPG.
I'm trying to figure out how to handle a java interface type object in
The example I'm trying to replicate in RPG is using iText and theI
TextExtractionStrategy interface. How do I define an object to have the
TextExtractionStrategy object type. When I read the javadoc, it doesn't
give me any clues to what to set the class to or even if there is a
constructor to specify.
Here is the java code example that I'm trying to somewhat do within RPG.
get stuck trying to figure out how to define the "strategy" object. This--
code snippet is supposed to extract text within a given area of a PDF and
is taken from the iText website:
PdfReader reader = new PdfReader(pdf);
PrintWriter out = new PrintWriter(new FileOutputStream(txt));
Rectangle rect = new Rectangle(70, 80, 420, 500);
RenderFilter filter = new RegionTextRenderFilter(rect);
TextExtractionStrategy strategy;
for (int i = 1; i <= reader.getNumberOfPages(); i++) {
strategy = new FilteredTextRenderListener(
new LocationTextExtractionStrategy(), filter);
out.println(PdfTextExtractor
.getTextFromPage(reader, i, strategy));
}
out.flush();out.close();
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.