Class Text_Api
java.lang.Object
com.ironsoftware.ironpdf.internal.staticapi.Text_Api
The type Text api.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
extractAllText
(InternalPdfDocument internalPdfDocument) Extracts the written text content from the PDF and returns it as a string.static String
extractAllText
(InternalPdfDocument internalPdfDocument, Iterable<Integer> pageIndexes) Extracts the written text content from the PDF and returns it as a string.static void
replaceTextOnPage
(InternalPdfDocument internalPdfDocument, int pageIndex, String oldText, String newText) Replace the specified old text with new text on a given page
-
Constructor Details
-
Text_Api
public Text_Api()
-
-
Method Details
-
extractAllText
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, Iterable<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 documentpageIndexes
- 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 documentpageIndex
- Page index to search for old text to replaceoldText
- Old text to removenewText
- New text to add
-