-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add scrub #141
base: master
Are you sure you want to change the base?
[WIP] Add scrub #141
Conversation
// TODO: Implement thumbnail removal | ||
const page = this.loadPage(i); | ||
const pageObj = page.getObject(); | ||
if (pageObj.get("Thumb").isStream()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use pageObj.delete("Thumb")
to remove the thumbnail.
@@ -664,7 +664,8 @@ export class PDFDocument extends mupdf.PDFDocument { | |||
|
|||
// Handle XML metadata | |||
if (xmlMetadata) { | |||
// TODO: Implement XML metadata handling | |||
const root = this.getTrailer().get("Root"); | |||
root.put("Metadata", this.newNull()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
root.delete("Metadata")
new Date(), | ||
new Date() | ||
); | ||
annot.setFileSpec(emptyFileSpec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to replace the attached file with an empty file?
We can also use annot.setFileSpec(null)
to remove the attachment instead.
No description provided.