Skip to content
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

Add Catalog method for writing the associated files array #39

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Cargo.lock
_things
.DS_Store
.idea/
12 changes: 10 additions & 2 deletions src/structure.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::color::SeparationInfo;

use super::*;
use crate::color::SeparationInfo;

/// Writer for a _document catalog dictionary_.
///
Expand Down Expand Up @@ -136,6 +135,15 @@ impl<'a> Catalog<'a> {
pub fn output_intents(&mut self) -> TypedArray<'_, Dict> {
self.insert(Name(b"OutputIntents")).array().typed()
}

/// Start writing the `/AF` array to specify the
/// associated files of the document. PDF 2.0+.
///
/// Each entry in the array is a reference to a [file specification
/// dictionary.](writers::FileSpec)
pub fn associated_files(&mut self) -> TypedArray<'_, Ref> {
laurmaedje marked this conversation as resolved.
Show resolved Hide resolved
self.insert(Name(b"AF")).array().typed()
}
}

deref!('a, Catalog<'a> => Dict<'a>, dict);
Expand Down