macro_rules! pdf_key {
($(($ident:ident,$value:literal)),+$(,)?) => {
pub(crate) mod pdf_key {
$(
/// PDF key constant.
pub(crate) const $ident: &str = $value;
)+
}
pub(crate) fn is_key(str:&str)->bool{
match str {
$(
$value => true,
)+
_ => false
}
}
}
}
pdf_key!(
(TRAILER,"trailer"),
(XREF,"xref"),
(R,"R"),
(OBJ,"obj"),
(START_XREF,"startxref"),
(TURE,"true"),
(FALSE,"false"),
(NULL,"null"),
(END_OBJ,"endobj"),
(STREAM,"stream"),
(END_STREAM,"endstream")
);
pub(crate) const KIDS: &str = "Kids";
pub(crate) const TYPE: &str = "Type";
pub(crate) const PREV: &str = "Prev";
pub(crate) const SIZE: &str = "Size";
pub(crate) const ROOT: &str = "Root";
pub(crate) const COUNT: &str = "Count";
pub(crate) const PAGES: &str = "Pages";
pub(crate) const CATALOG: &str = "Catalog";
pub(crate) const OUTLINES: &str = "Outlines";
pub(crate) const LENGTH: &str = "Length";
pub(crate) const FIRST: &str = "First";
pub(crate) const LAST: &str = "Last";
pub(crate) const NEXT: &str = "Next";
pub(crate) const INFO: &str = "Info";
pub(crate) const PRODUCER: &str = "Producer";
pub(crate) const CREATOR: &str = "Creator";
pub(crate) const CREATION_DATE: &str = "CreationDate";
pub(crate) const AUTHOR: &str = "Author";
pub(crate) const TITLE: &str = "Title";
pub(crate) const MOD_DATE:&str = "ModDate";
pub(crate) const CONTENTS:&str = "Contents";
pub(crate) const FILTER:&str = "Filter";