fix: use temp files for PDF when getting entries

This commit is contained in:
Gauthier Roebroeck 2022-01-31 11:57:13 +08:00
parent f602218315
commit deb8e5fff4

View File

@ -34,7 +34,7 @@ class PdfExtractor : MediaContainerExtractor {
override fun mediaTypes(): List<String> = listOf("application/pdf")
override fun getEntries(path: Path, analyzeDimensions: Boolean): List<MediaContainerEntry> =
PDDocument.load(path.toFile()).use { pdf ->
PDDocument.load(path.toFile(), MemoryUsageSetting.setupTempFileOnly()).use { pdf ->
(0 until pdf.numberOfPages).map { index ->
val page = pdf.getPage(index)
val scale = page.getScale()