PDF에서 텍스트 추출 - Facades
Contents
[
Hide
]
문서의 모든 페이지에서 텍스트 추출
PDF 문서의 모든 페이지에서 텍스트를 추출하기 위해, **Aspose.PDF for C++**는 Facades 네임스페이스 아래에 PdfExtractor 클래스를 제공합니다. PDF 문서에서 모든 텍스트를 추출하여 MemoryStream 객체에 저장하고, 추가 조작을 위해 문자열로 가져올 수 있습니다. 다음 코드 스니펫은 PDF 문서의 모든 페이지에서 텍스트를 추출하기 위해 PdfExtractor 클래스를 사용하는 방법을 보여줍니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-C | |
auto extractor = MakeObject<Facades::PdfExtractor>(); | |
extractor->BindPdf(L"..\\Data\\Text\\input.pdf"); | |
extractor->ExtractText(); | |
auto memStream = MakeObject<IO::MemoryStream>(); | |
extractor->GetText(memStream); | |
auto unicode = System::Text::Encoding::get_Unicode(); | |
String allText = unicode->GetString(memStream->ToArray()); | |
Console::WriteLine(allText); |