× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I'm trying to figure out how to handle a java interface type object in RPG.
The example I'm trying to replicate in RPG is using iText and the
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. I
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 thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.