Skip to content

Commit e396dcb

Browse files
committed
feat: update version to 5.3.2 and implement duplicate text removal in PdfReader and PdfReaderLegacy
1 parent 3a201b3 commit e396dcb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@snowfluke/ppu-pdf",
3-
"version": "5.3.1",
3+
"version": "5.3.2",
44
"license": "MIT",
55
"exports": "./src/index.ts",
66
"publish": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ppu-pdf",
3-
"version": "5.3.1",
3+
"version": "5.3.2",
44
"description": "Easily extract text from digital PDF files with coordinate and font size included, and optionally group text by lines or render scanned pdf to canvas/png.",
55
"keywords": [
66
"pdf-reader",

src/pdf-reader-legacy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class PdfReaderLegacy extends PdfReaderCommon {
187187
const scale = x / token.transform[4];
188188

189189
const pdfWord: PdfWord = {
190-
text: token.str,
190+
text: this.options.raw ? token.str : this.removeDuplicates(token.str),
191191
bbox: {
192192
x0: x,
193193
y0: y - token.height * scale,

src/pdf-reader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class PdfReader extends PdfReaderCommon {
186186
const font = item.font;
187187

188188
const pdfWord: PdfWord = {
189-
text: item.text,
189+
text: this.options.raw ? item.text : this.removeDuplicates(item.text),
190190
bbox: {
191191
x0: x,
192192
y0: y,

0 commit comments

Comments
 (0)