Skip to content

Commit e9eb937

Browse files
Bump org.apache.pdfbox:pdfbox from 2.0.27 to 3.0.0 (#33)
* Bump org.apache.pdfbox:pdfbox from 2.0.27 to 3.0.0 Bumps org.apache.pdfbox:pdfbox from 2.0.27 to 3.0.0. --- updated-dependencies: - dependency-name: org.apache.pdfbox:pdfbox dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * change way of loading pdf using pdfbox --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Stefan Bratanov <stefan.bratanov93@gmail.com>
1 parent f4a00fa commit e9eb937

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ dependencies {
5151
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
5252
implementation("org.apache.commons:commons-math3:3.6.1")
5353
implementation("org.jsoup:jsoup:1.16.1")
54-
implementation("org.apache.pdfbox:pdfbox:2.0.27")
54+
implementation("org.apache.pdfbox:pdfbox:3.0.0")
5555
implementation("me.xdrop:fuzzywuzzy:1.4.0")
5656
implementation("com.cloudinary:cloudinary-http44:1.34.0")
5757
implementation("org.seleniumhq.selenium:selenium-java:4.9.0")

src/main/kotlin/com/stefanbratanov/sofiasupermarketsapi/interfaces/PdfProductsExtractor.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ package com.stefanbratanov.sofiasupermarketsapi.interfaces
22

33
import com.stefanbratanov.sofiasupermarketsapi.model.Product
44
import java.nio.file.Path
5+
import org.apache.pdfbox.Loader
6+
import org.apache.pdfbox.io.RandomAccessReadBufferedFile
57
import org.apache.pdfbox.pdmodel.PDDocument
68

79
interface PdfProductsExtractor {
810

911
fun extract(pdf: Path): List<Product>
1012

1113
fun getPDocument(pdf: Path): PDDocument {
12-
return PDDocument.load(pdf.toFile())
14+
return Loader.loadPDF(RandomAccessReadBufferedFile(pdf.toFile()))
1315
}
1416
}

0 commit comments

Comments
 (0)