summaryrefslogtreecommitdiff
path: root/apps/pdfapp.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-04-24 18:44:23 +0200
committerTor Andersson <tor@ghostscript.com>2010-04-24 18:44:23 +0200
commit3f705395e393735af12553a2499632d5106d7fa8 (patch)
treefe2031b0a2ce49f4c5ceb1500530d2007285e9eb /apps/pdfapp.c
parent5d07ed68ae0651cb90f5bb8074a9399e96024fbb (diff)
downloadmupdf-3f705395e393735af12553a2499632d5106d7fa8.tar.xz
Calculate bounding boxes for text in the text extraction device.
Diffstat (limited to 'apps/pdfapp.c')
-rw-r--r--apps/pdfapp.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c
index 79edfe4c..2eb3e395 100644
--- a/apps/pdfapp.c
+++ b/apps/pdfapp.c
@@ -622,7 +622,7 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen)
{
ucsbuf[0] = 0;
fz_textspan *ln;
- int x, y, c;
+ int y, c;
int i, p;
int x0 = app->image->x + app->selr.x0 - app->panx;
@@ -638,28 +638,19 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen)
y = y0 - 1;
for (i = 0; i < ln->len; i++)
{
-#if 0
int bx0, bx1, by0, by1;
bx0 = ln->text[i].bbox.x0;
bx1 = ln->text[i].bbox.x1;
by0 = ln->text[i].bbox.y0;
by1 = ln->text[i].bbox.y1;
+
c = ln->text[i].c;
if (c < 32)
c = '?';
if (bx1 >= x0 && bx0 <= x1 && by1 >= y0 && by0 <= y1)
if (p < ucslen - 1)
ucsbuf[p++] = c;
-#endif
- c = ln->text[i].c;
- x = ln->text[i].x;
- y = ln->text[i].y;
- if (c < 32)
- c = '?';
- if (x >= x0 && x <= x1 && y >= y0 && y <= y1)
- if (p < ucslen - 1)
- ucsbuf[p++] = c;
}
if (y >= y0 && y <= y1)