Class Text_Api


  • public final class Text_Api
    extends Object
    The type Text api.
    • Constructor Detail

      • Text_Api

        public Text_Api()
    • Method Detail

      • extractAllText

        public static String extractAllText​(InternalPdfDocument internalPdfDocument)
        Extracts the written text content from the PDF and returns it as a string.

        Pages are separated by 4 consecutive Environment.NewLines

        Parameters:
        internalPdfDocument - the internal pdf document
        Returns:
        All text in the PDF as a string.
      • extractAllText

        public static String extractAllText​(InternalPdfDocument internalPdfDocument,
                                            List<Integer> pageIndexes)
        Extracts the written text content from the PDF and returns it as a string.

        Pages are separated by 4 consecutive Environment.NewLines

        Parameters:
        internalPdfDocument - the internal pdf document
        pageIndexes - page indexes to extract text (defaults to all pages)
        Returns:
        All text in the PDF as a string.
      • replaceTextOnPage

        public static void replaceTextOnPage​(InternalPdfDocument internalPdfDocument,
                                             int pageIndex,
                                             String oldText,
                                             String newText)
        Replace the specified old text with new text on a given page
        Parameters:
        internalPdfDocument - the internal pdf document
        pageIndex - Page index to search for old text to replace
        oldText - Old text to remove
        newText - New text to add