From c8acddb251ca3fd55bbea48f7d3259135fc68ebc Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Sat, 13 Jan 2024 01:05:43 +0000 Subject: [PATCH] Resolve split sections --- .../controller/api/SplitPdfBySectionsController.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/controller/api/SplitPdfBySectionsController.java b/src/main/java/stirling/software/SPDF/controller/api/SplitPdfBySectionsController.java index ab00d719..de3e5a4b 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/SplitPdfBySectionsController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/SplitPdfBySectionsController.java @@ -118,13 +118,12 @@ public class SplitPdfBySectionsController { try (PDPageContentStream contentStream = new PDPageContentStream( - subDoc, subPage, AppendMode.OVERWRITE, true, true)) { + subDoc, subPage, AppendMode.APPEND, true, true)) { // Set clipping area and position float translateX = -subPageWidth * i; - float translateY = height - subPageHeight * (verticalDivisions - j); - - // Code for google Docs pdfs.. - // float translateY = -subPageHeight * (verticalDivisions - 1 - j); + + //float translateY = height - subPageHeight * (verticalDivisions - j); + float translateY = -subPageHeight * (verticalDivisions - 1 - j); contentStream.saveGraphicsState(); contentStream.addRect(0, 0, subPageWidth, subPageHeight);