File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1586,6 +1586,25 @@ impl NamespaceRoleMap<'_> {
15861586 dict. finish ( ) ;
15871587 self
15881588 }
1589+
1590+ /// Write an entry mapping a custom structure type to an element in the
1591+ /// PDF 2.0 namespace.
1592+ ///
1593+ /// The `pdf_2_ns` parameter is an indirect reference to a PDF 2.0 namespace
1594+ /// dictionary. You can create this dictionary by using [`Chunk::namespace`]
1595+ /// and then calling [`Namespace::pdf_2_ns`] on the returned writer.
1596+ pub fn to_pdf_2_0 (
1597+ & mut self ,
1598+ name : Name ,
1599+ role : StructRole2 ,
1600+ pdf_2_ns : Ref ,
1601+ ) -> & mut Self {
1602+ let mut dict = self . dict . insert ( name) . dict ( ) ;
1603+ dict. pair ( Name ( b"Role" ) , Name ( role. to_name_bytes ( & mut [ 0 ; 6 ] ) ) ) ;
1604+ dict. pair ( Name ( b"NS" ) , pdf_2_ns) ;
1605+ dict. finish ( ) ;
1606+ self
1607+ }
15891608}
15901609
15911610deref ! ( ' a, NamespaceRoleMap <' a> => Dict <' a>, dict) ;
You can’t perform that action at this time.
0 commit comments