class ResourceDictionaryCleaner implements Consumer<PDDocument> {

    @Override
    public void accept(PDDocument p) {
        LOG.debug("Cleaning resource dictionaries from unused resources");
        clean(p.getPages().streamNodes());
    }

}