Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5269

Consider making LegacyPDFStreamEngine a public class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.0.24
    • None
    • Text extraction
    • None

    Description

      Please consider making Please consider making LegacyPDFStreamEngine public.

      This will allow extending the class. 

      At the moment, one needs to copy the entire class sources into their own local version and making a public version of the copy if one wishes to extend it. 

      This also in turn makes creating a local copy of PDFTextStripper necessary so it can inherit from the local copy of LegacyPDFStreamEngine.

      One reason someone would want to extend it (my example):For my needs, I have had to change the implementation of:

          public void processPage(PDPage page):    

      in my case I have had to change the implementation (this is particular to my needs, but hopefully highlights the usefulness, and why it would potentially be needed):           

       

      try {        
         super.processPage(page);        
      }
      catch(MissingOperandException e) {        
          // we need to catch this, because it is acceptable, we will deal with this particular error by cleaning the PDF.        
          throw new PdfLoadingException(e.getMessage(), e);        
      }
      catch(Exception e) {    
          //we ignore all other errors and keep going because we are OK with that for our purposes.        
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            alistairo Alistair Oldfield
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: