Class MetadataCleanerPdf

java.lang.Object
sk.iway.iwcm.system.metadata.MetadataCleanerPdf

public class MetadataCleanerPdf extends Object
Utility class for cleaning sensitive metadata from generated files. Currently supports PDF files generated by PD4ML (pdf-gen).
  • Method Details

    • removeMetadata

      public static void removeMetadata(ByteArrayOutputStream pdfOut, OutputStream output) throws IOException
      Post-process a generated PDF to override Creator and Producer metadata fields, preventing disclosure of the PD4ML library name and version in PDF metadata. The replacement value is taken from the pdfAuthorName configuration constant.
      Parameters:
      pdfOut - the ByteArrayOutputStream containing the generated PDF bytes
      output - the final OutputStream to write the processed PDF to
      Throws:
      IOException - if reading or writing fails