Skip to content

Fix ParagraphManager unconditionally printing PDF outline to stdout#6600

Open
pavan542935 wants to merge 1 commit into
spring-projects:mainfrom
pavan542935:fix/paragraph-manager-stdout-logging
Open

Fix ParagraphManager unconditionally printing PDF outline to stdout#6600
pavan542935 wants to merge 1 commit into
spring-projects:mainfrom
pavan542935:fix/paragraph-manager-stdout-logging

Conversation

@pavan542935

Copy link
Copy Markdown

Fixes #6599

Problem

ParagraphManager constructor calls printParagraph(this.rootParagraph, System.out)
unconditionally at line 67, printing the entire PDF Table of Contents to stdout
every time a ParagraphPdfDocumentReader is created. There is no way to suppress
this output through logging configuration.

Fix

Wrapped the printParagraph call with a logger.isDebugEnabled() guard using
Commons Logging — consistent with the pattern already used in
PagePdfDocumentReader and ForkPDFLayoutTextStripper.

Changes

  • Added Log and LogFactory imports to ParagraphManager.java
  • Added private static final Log logger = LogFactory.getLog(ParagraphManager.class)
  • Wrapped printParagraph call with if (logger.isDebugEnabled())

Signed-off-by: pavan <saipavan542935@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParagraphPdfDocumentReader unconditionally prints PDF Table of Contents to stdout

2 participants