Class PdfFileManager

java.lang.Object
com.shaft.tools.io.PdfFileManager

public class PdfFileManager extends Object
  • Constructor Details

    • PdfFileManager

      public PdfFileManager(String folderName, String fileName, int numberOfRetries)
    • PdfFileManager

      public PdfFileManager(String pdfFilePath)
  • Method Details

    • readFileContent

      public static String readFileContent(String relativeFilePath, boolean... deleteFileAfterReading)
      Read PDF file content given relative path and optionally delete the file after reading it
      Parameters:
      relativeFilePath - relative path to the PDF file
      deleteFileAfterReading - optional boolean to delete the file after reading it or not, default is to leave the file as is
      Returns:
      a string value representing the entire content of the pdf file
    • readFileContent

      public String readFileContent()
    • readPDFContentFromDownloadedPDF

      public String readPDFContentFromDownloadedPDF(int startPageNumber, int endPageNumber, PdfFileManager.DeleteFileAfterValidationStatus deleteFileAfterValidationStatus)
      Parameters:
      startPageNumber - the starting page for the document to be validated
      endPageNumber - the ending page for the document to be validated
      deleteFileAfterValidationStatus - the status of deleting the file after get the document text
      Returns:
      returns the pdf content in string so that can be validated
    • readPDFContentFromDownloadedPDF

      public String readPDFContentFromDownloadedPDF(PdfFileManager.DeleteFileAfterValidationStatus deleteFileAfterValidationStatus)