從 PDF 中提取 OCR(免費線上工具)
光學字元識別,又稱OCR,是一種用於識別圖像中文字的技術。 這項技術被創造出來以掃描印刷文字或圖像文件並在電腦上識別它們。 這是因為今天很多東西都是數位的,例如電子郵件或書籍。 然而,OCR技術已經發展成為一種更先進的技術,具備專業算法,能夠識別多種字體中的文字,即使這些字體被噪音或其他常見扭曲如JPEG壓縮所扭曲。 OCR還可以以98%的準確度讀取紙上的手寫。
使用OCR掃描的文字可以被編輯、索引、搜尋、列印和歸檔。 OCR軟體廣泛應用於醫療保健、製藥、保險和法律行業。 它有助於將紙質文件轉換成數位文件,使之更容易被重複使用並與他人共享。
讓我們看看如何使用不同的工具來對PDF文件進行OCR。
Adobe Acrobat Pro
Adobe是最初開發PDF的公司。 他們提供了一種快速、高效的OCR引擎,能夠編輯任何您提供的PDF文件。 這是市場上最強大的OCR引擎之一,如果您有大量PDF需要編輯,Adobe Acrobat DC是您應該購買的。 這款軟體設計時採用了高精度的方法,能夠將任何基於文字的文件轉換成PDF格式。 它還使用其自訂字體生成器保留原始文件的字體。
讓我們看看如何使用Adobe Acrobat進行PDF OCR:
- 在Adobe Acrobat Pro DC中打開文件。
-
點擊右側面板中的"編輯PDF"選項。
- 它將利用其OCR功能將PDF文件轉換為可編輯的PDF。
-
現在,您可以輕鬆編輯任何文字並更改文件中的圖像文件。
- 您可以通過選擇"文件 > 另存為"並為新PDF文件命名來保存文件。
您可以輕鬆同時對多個掃描的PDF文件執行OCR。
Sejda
Sejda是支持OCR的PDF編輯軟體,可以在雲中託管或作為桌面應用程式下載到macOS、Windows或Linux上。 Sejda允許使用者壓縮、編輯、數位簽名、合併和填寫PDF文件。 包括JPEG和Excel在內的各種格式的文件都可以轉換為PDF文件。 PDF可同樣轉換為其他格式,如Word和PowerPoint文件。 讓我們看看如何使用Sejda OCR執行PDF文件的OCR。
- Open Sejda OCR website.
- 點擊"上傳PDF文件"按鈕以上傳文件,或從您的電腦中拖放文件。
-
上傳後,您將看到上傳的文件名。 選擇文件的語言。
-
選擇語言後,您必須選擇輸出格式。 您可以選擇"PDF"或"文字"。 設置輸出格式後,點擊"識別所有頁面的文字"按鈕。 它將開始提取文字。
-
當過程完成後,您可以下載提取的文字。
SodaPDF
SodaPDF OCR是免費的線上OCR軟體,可以從圖像中提取文字。 這是一個PDF OCR轉換工具,將掃描的文件、傳真和其他列印輸出轉換為可編輯文字、PDF和可搜尋的PDF。 SodaPDF OCR最常見的使用案例是將掃描的文件或傳真轉換為可編輯的文件。 它是免費的線上OCR軟體。 所有上傳的文件在一段時間後會自動從伺服器中刪除。它具有多種功能,如將PDF轉換為Word,然後可用Microsoft Word打開。
讓我們看看如何使用SodaPDF在PDF上執行OCR:
- Open the SodaPDF website.
- 點擊"選擇文件"按鈕並選擇要上傳的PDF文件。
-
上傳後,它將為您提供一個用於編輯PDF文字和圖像的使用者介面。 您可以使用下載按鈕下載文件。
IronOCR: .NET OCR Library
IronOCR是一個針對.NET Framework的強大OCR程式庫。 它提供了一個強大的API來處理文字和圖像,並提供像實時識別、欄位檢測和掃描PDF文件的光學字元識別等功能。 IronPDF也可以編輯掃描的文件。
IronOCR讓開發者在他們的應用程式中擁有文字識別的能力。 它可以用於各種用途,比如將掃描的文件轉換成數位格式或識別圖像上的字幕。 IronOCR .NET Library提供一個易於使用的低級介面給IronOCR SDK。 除此之外,它還包括一個圖像處理管道,可以自動處理低DPI圖像並從PDF文件中提取文字。
讓我們看看如何使用OCR工具對PDF文件進行OCR:
整個PDF文件的OCR
以下程式碼可以對整個PDF文件執行OCR。
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add the entire PDF document for OCR processing
Input.AddPdf("example.pdf", "password");
var Result = Ocr.Read(Input);
// Print the extracted text to the console
Console.WriteLine(Result.Text);
}
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add the entire PDF document for OCR processing
Input.AddPdf("example.pdf", "password");
var Result = Ocr.Read(Input);
// Print the extracted text to the console
Console.WriteLine(Result.Text);
}
Imports IronOcr
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
' Add the entire PDF document for OCR processing
Input.AddPdf("example.pdf", "password")
Dim Result = Ocr.Read(Input)
' Print the extracted text to the console
Console.WriteLine(Result.Text)
End Using
選擇的PDF頁面的OCR
您可以使用AddPdfPages函式在選擇的PDF頁面上執行OCR。
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add specific pages of the PDF document for OCR processing
Input.AddPdfPages("example.pdf", new [] { 1, 2, 3 }, "password");
var Result = Ocr.Read(Input);
// Print the extracted text to the console
Console.WriteLine(Result.Text);
}
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add specific pages of the PDF document for OCR processing
Input.AddPdfPages("example.pdf", new [] { 1, 2, 3 }, "password");
var Result = Ocr.Read(Input);
// Print the extracted text to the console
Console.WriteLine(Result.Text);
}
Imports IronOcr
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
' Add specific pages of the PDF document for OCR processing
Input.AddPdfPages("example.pdf", { 1, 2, 3 }, "password")
Dim Result = Ocr.Read(Input)
' Print the extracted text to the console
Console.WriteLine(Result.Text)
End Using
將PDF轉換為可搜尋的PDF
您可以使用IronOCR通過SaveAsSearchablePdf函式將PDF文件轉換為可搜尋的PDF文件。
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add the PDF for processing and specify the password if any
Input.AddPdf("scan.pdf", "password");
// Correct twisted or skewed pages
Input.Deskew();
var Result = Ocr.Read(Input);
// Save the processed result as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
using IronOcr;
var Ocr = new IronTesseract();
using (var Input = new OcrInput())
{
// Add the PDF for processing and specify the password if any
Input.AddPdf("scan.pdf", "password");
// Correct twisted or skewed pages
Input.Deskew();
var Result = Ocr.Read(Input);
// Save the processed result as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
Imports IronOcr
Private Ocr = New IronTesseract()
Using Input = New OcrInput()
' Add the PDF for processing and specify the password if any
Input.AddPdf("scan.pdf", "password")
' Correct twisted or skewed pages
Input.Deskew()
Dim Result = Ocr.Read(Input)
' Save the processed result as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf")
End Using
結論
我們已經探索了一些很棒的軟體工具來進行光學字元識別。 這些工具允許您通過編程方式識別文字並建立可搜尋和可編輯的PDF。
如果是在.NET Framework中編寫,IronOCR是我們的推薦。 IronOCR允許您在.NET Framework中輕鬆進行OCR; 它非常強大,即使在原始文件被損壞或扭曲,如受水損害,也可以輕鬆使用。
另一個使用案例是將用手填寫的舊紙質表單,例如發票和銷售收據,轉換為數位版本。 這允許這些文件由會計軟體自動處理,從而提高準確性和效率。




