@@ -230,13 +230,23 @@ impl Pdf {
230230 }
231231 }
232232
233+ /// Set the file identifier for the document.
234+ ///
235+ /// The file identifier is a pair of two byte strings that shall be used to
236+ /// uniquely identify a particular file. The first string should always stay
237+ /// the same for a document, the second should change for each revision. It
238+ /// is optional, but recommended. PDF 1.1+.
239+ pub fn set_file_id ( & mut self , id : ( Vec < u8 > , Vec < u8 > ) ) {
240+ self . file_id = Some ( id) ;
241+ }
242+
233243 /// Start writing the document catalog. Required.
234244 ///
235245 /// This will also register the document catalog with the file trailer,
236246 /// meaning that you don't need to provide the given `id` anywhere else.
237247 pub fn catalog ( & mut self , id : Ref ) -> Catalog < ' _ > {
238248 self . catalog_id = Some ( id) ;
239- self . chunk . indirect ( id) . start ( )
249+ self . indirect ( id) . start ( )
240250 }
241251
242252 /// Start writing the document information.
@@ -246,17 +256,7 @@ impl Pdf {
246256 /// anywhere else.
247257 pub fn document_info ( & mut self , id : Ref ) -> DocumentInfo < ' _ > {
248258 self . info_id = Some ( id) ;
249- self . chunk . indirect ( id) . start ( )
250- }
251-
252- /// Set the file identifier for the document.
253- ///
254- /// The file identifier is a pair of two byte strings that shall be used to
255- /// uniquely identify a particular file. The first string should always stay
256- /// the same for a document, the second should change for each revision. It
257- /// is optional, but recommended. PDF 1.1+.
258- pub fn file_id ( & mut self , id : ( Vec < u8 > , Vec < u8 > ) ) {
259- self . file_id = Some ( id) ;
259+ self . indirect ( id) . start ( )
260260 }
261261
262262 /// Write the cross-reference table and file trailer and return the
0 commit comments