Actually, the spec calls 'catalog' what we call 'origin' — use 'catalog' for more clarity in regard to the spec
This commit is contained in:
parent
6d265633e4
commit
729e312f90
2 changed files with 6 additions and 6 deletions
|
@ -13,7 +13,7 @@ import PDF.Box (Box(..))
|
|||
import PDF.Layer (Layer(..), unify)
|
||||
import PDF.Object (Object(..))
|
||||
import PDF.Object.Navigation (
|
||||
Clear(..), Raw(..), (//), objectById, origin
|
||||
Clear(..), Raw(..), (//), objectById, catalog
|
||||
)
|
||||
import PDF.Output (Output)
|
||||
import qualified PDF.Output as Output (render)
|
||||
|
@ -38,12 +38,12 @@ display getter (Document {eolStyle, layers}) =
|
|||
Output.render eolStyle <$> runError (runReaderT getter (unify layers))
|
||||
|
||||
parse :: [String] -> IO (FilePath, Document -> Either String ByteString)
|
||||
parse [inputFile] = return (inputFile, display origin)
|
||||
parse [inputFile] = return (inputFile, display catalog)
|
||||
parse [inputFile, key] =
|
||||
return (inputFile, clear . maybe (byPath key) byId $ readMaybe key)
|
||||
where
|
||||
byId = objectById . Id
|
||||
byPath path = origin // (explode path)
|
||||
byPath path = catalog // (explode path)
|
||||
explode "" = []
|
||||
explode path =
|
||||
case break (== '.') path of
|
||||
|
|
|
@ -15,7 +15,7 @@ module PDF.Object.Navigation (
|
|||
, getDictionary
|
||||
, getKey
|
||||
, objectById
|
||||
, origin
|
||||
, catalog
|
||||
) where
|
||||
|
||||
import Codec.Compression.Zlib (compress, decompress)
|
||||
|
@ -77,8 +77,8 @@ castObject directObject = return $ Direct directObject
|
|||
(>//) :: PDFContent m => Object -> [Component] -> m Object
|
||||
(>//) object = (return object //)
|
||||
|
||||
origin :: PDFContent m => m Object
|
||||
origin = Direct . Dictionary . trailer . docStructure <$> ask
|
||||
catalog :: PDFContent m => m Object
|
||||
catalog = Direct . Dictionary . trailer . docStructure <$> ask
|
||||
|
||||
data Clear = Clear
|
||||
data Raw = Raw
|
||||
|
|
Loading…
Reference in a new issue