Skip to content

Commit

Permalink
pdfrenderer.cpp: Ignore non-text blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdo authored Nov 7, 2022
1 parent 490611e commit 1b38293
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ char *TessPDFRenderer::GetPDFTextObjects(TessBaseAPI *api, double width, double
const std::unique_ptr</*non-const*/ ResultIterator> res_it(api->GetIterator());
while (!res_it->Empty(RIL_BLOCK)) {
if (res_it->IsAtBeginningOf(RIL_BLOCK)) {
auto block_type = res_it->BlockType();
if (!res_it->PTIsTextType(block_type)) {
continue; // ignore non-text blocks
}
pdf_str << "BT\n3 Tr"; // Begin text object, use invisible ink
old_fontsize = 0; // Every block will declare its fontsize
new_block = true; // Every block will declare its affine matrix
Expand Down

0 comments on commit 1b38293

Please sign in to comment.