ATuin

Show PDF Bookmars with Scala[z]

May 17th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.54 KB | None | 0 0
  1. package com.logikujo.literoj.testBookTree
  2.  
  3. import com.logikujo.spdf.Implicits._
  4. import com.logikujo.spdf.pdfoperator._
  5. import PDFOperator._
  6.  
  7. import com.logikujo.utils.Treeable._
  8.  
  9. import scalaz._
  10. import Scalaz._
  11.  
  12. object TestBookTree {
  13.   def main(args:Array[String]) {
  14.     val comp = for {
  15.       doc <- pdfGetDocument
  16.       tree <- pdfBookmarksTree(doc)
  17.       _ <- pdfClose(doc)
  18.     } yield tree.toOption >>= identity
  19.  
  20.     (comp ! PDF("testPDF.pdf")).
  21.       some((t) => println(t.drawTree)).
  22.       none(println("No hay bookmarks"))
  23.   }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment