From df1ed7e09146a3ef945cd6be357e2943448e7a67 Mon Sep 17 00:00:00 2001 From: Eric Johnson Date: Wed, 1 Jun 2022 13:07:19 -0500 Subject: [PATCH] Testing PDF text overlay problem. [#182287388] --- build.gradle | 2 +- .../org/codeforamerica/shiba/output/pdf/PDFBoxFieldFiller.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index ff4d90b35..469040aa5 100644 --- a/build.gradle +++ b/build.gradle @@ -122,7 +122,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-security") implementation("org.springframework.boot:spring-boot-starter-oauth2-client") implementation("com.google.crypto.tink:tink:1.6.1") - implementation("org.flywaydb:flyway-core:8.5.11") + implementation("org.flywaydb:flyway-core:8.5.12") implementation("org.springframework.boot:spring-boot-starter-webflux") implementation("com.mixpanel:mixpanel-java:1.5.0") implementation("org.springframework.boot:spring-boot-starter-validation") diff --git a/src/main/java/org/codeforamerica/shiba/output/pdf/PDFBoxFieldFiller.java b/src/main/java/org/codeforamerica/shiba/output/pdf/PDFBoxFieldFiller.java index d4ef1f5ae..85b123768 100644 --- a/src/main/java/org/codeforamerica/shiba/output/pdf/PDFBoxFieldFiller.java +++ b/src/main/java/org/codeforamerica/shiba/output/pdf/PDFBoxFieldFiller.java @@ -67,8 +67,9 @@ private PDDocument fillOutPdfs(Collection fields, Resource pdfResource try { PDDocument loadedDoc = PDDocument.load(pdfResource.getInputStream()); PDAcroForm acroForm = loadedDoc.getDocumentCatalog().getAcroForm(); - acroForm.setNeedAppearances(true); + acroForm.setNeedAppearances(false); fillAcroForm(fields, acroForm); + acroForm.flatten(); return loadedDoc; } catch (IOException e) { throw new RuntimeException(e);