Extract Text From PDF


PdfDocument pdf = PdfDocument.renderUrlAsPdf("https://unsplash.com/");
String text = pdf.extractAllText();
System.out.println("Text extracted from the website: " + text);
mvn install
Extract Text From PDF

Extract Text From PDF

作為IronPDF的廣泛PDF建立和編輯功能的一部分,IronPDF透過其內容提取方法也能促成對PDF文件內容的精細處理。

在所有extractAllText方法。 String包含PDF中每頁的所有文字。

此方法是對包含多頁的PDF進行文件層級文字提取的便捷方法。 如需在頁面層級提取文字(即僅從一組特定頁面提取),可使用extractTextFromPage方法。

下面的簡短程式碼片段從PDF文件的第一頁提取文字。

Explore the extractAllText Method in IronPDF Java Docs
在 GitHub 查看

準備好開始了嗎?

版本:2026.10剛剛發布