Clear PDF Metadata
Contents
[
Hide
]
Clear PDF metadata
Use this workflow when you need to remove stored document information before sharing or archiving a PDF.
Steps
- Create a
PdfFileInfoobject for the input PDF. - Call
clearInfo()to remove document metadata. - Save the result to a new file with
save(). - Close the
PdfFileInfoinstance.
Java example
public static void clearPdfMetadata(Path inputFile, Path outputFile) {
PdfFileInfo pdfInfo = new PdfFileInfo(inputFile.toString());
pdfInfo.clearInfo();
pdfInfo.save(outputFile.toString());
pdfInfo.close();
}