Function register_with
Source pub fn register_with(reg: &mut Registry, options: &PdfOptions)
Expand description
注册 PDF 后端与插件,并注入解析选项(版式模式 / 页数上限)。
14fn engine_with(mode: LayoutMode, max_pages: Option<usize>) -> DocumentEngine {
15 let mut registry = Registry::new();
16 plugins::text::register_defaults(&mut registry);
17 let mut options = PdfOptions::new().with_layout_mode(mode);
18 options.max_pages = max_pages;
19 docparser_pdf::register_with(&mut registry, &options);
21 DocumentEngine::new(registry)
22}