Remove pdf metadata
In order to remove metadata from PDF documents we will use the exiftool_vendored gem. The following line: Exiftool.new(attachment_path, "-overwrite_original -all:all=") Overwrites the original file with another file without metadata. So far this is the best solution we have found to perform this metadata deletion. When using Exiftool an exception is thrown, so we added a rescue to handle it. Here is a task created where this problem is discussed in issue 28 in the https://github.com/exiftool-rb/exiftool.rb/ repository. We'll wait to see if this will be fixed in future versions.
This commit is contained in:
@@ -209,6 +209,10 @@ GEM
|
||||
multi_json (>= 1.3)
|
||||
rake
|
||||
execjs (2.8.1)
|
||||
exiftool (1.2.4)
|
||||
json
|
||||
exiftool_vendored (12.60.0)
|
||||
exiftool (>= 0.7.0)
|
||||
factory_bot (6.2.0)
|
||||
activesupport (>= 5.0.0)
|
||||
factory_bot_rails (6.2.0)
|
||||
@@ -705,6 +709,7 @@ DEPENDENCIES
|
||||
devise-security (~> 0.18.0)
|
||||
email_spec (~> 2.2.2)
|
||||
erb_lint (~> 0.5.0)
|
||||
exiftool_vendored (~> 12.60.0)
|
||||
factory_bot_rails (~> 6.2.0)
|
||||
faker (~> 3.2.1)
|
||||
file_validators (~> 3.0.0)
|
||||
|
||||
Reference in New Issue
Block a user