Loading TOC...

pdf:make-toc

pdf:make-toc(
   $toc as element()?
) as element()?

Summary

Clean and normalize the TOC produced by raw conversion.

Parameters
toc The raw TOC element.

Example

  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 )
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.