pdf:make-toc( $toc as element()? ) as element()?
Clean and normalize the TOC produced by raw conversion.
Parameters | |
---|---|
toc | The raw TOC element. |
xquery version "1.0-ml"; import module namespace pdf = "http://marklogic.com/cpf/pdf" at "/MarkLogic/conversion/pdf.xqy"; let $results := xdmp:pdf-convert( xdmp:get("/myfiles/myfile.pdf"), "myfile.pdf" ) let $manifest := $results[1] let $toc := for $doc at $index in $results[2 to last()] let $name := string($manifest/*[$index]) where fn:matches( $name, "toc.xml" ) return $doc return pdf:make-toc( $toc )