packages feed

pdf-toolbox-core 0.0.1.1 → 0.0.2.0

raw patch · 4 files changed

+8/−4 lines, 4 files

Files

lib/Pdf/Toolbox/Core/Object/Types.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE GeneralizedNewtypeDeriving #-}  -- | Module contains definitions of pdf objects --@@ -17,6 +18,7 @@ ) where +import Data.Monoid import Data.String import Data.ByteString (ByteString) @@ -32,9 +34,9 @@  -- | Names usually are used as keys in dictionaries ----- They starts with \'/\', but we strip it out, see 'Text.Pdf.Parser.Object.parseName'+-- They starts with \'/\', but we strip it out, see 'Pdf.Toolbox.Core.Parsers.Object.parseName' newtype Name = Name ByteString-  deriving (Eq, Show)+  deriving (Eq, Show, Ord, Monoid)  -- | Set of key/value pairs newtype Dict = Dict [(Name, Object ())]
lib/Pdf/Toolbox/Core/Parsers/Object.hs view
@@ -113,8 +113,9 @@                  _ -> do                    ch1 <- P.anyChar                    ch2 <- P.anyChar-                   takeStr lvl (toEnum (fromEnum ch' * 64 + fromEnum ch1 * 8 + fromEnum ch2) : res)+                   takeStr lvl (toEnum (charToInt ch' * 64 + charToInt ch1 * 8 + charToInt ch2) : res)       _ -> takeStr lvl (ch : res)+  charToInt ch = fromEnum ch - 48  -- | -- >>> parseOnly parseHexStr "<68656C6C6F>"
lib/Pdf/Toolbox/Core/Parsers/XRef.hs view
@@ -79,6 +79,7 @@ parseTrailerAfterTable = do   _ <- P.string "trailer"   endOfLine+  P.skipSpace   parseDict  -- | Parse XRef table entry. Returns offset, generation and whether the object is free.
pdf-toolbox-core.cabal view
@@ -1,5 +1,5 @@ name:                pdf-toolbox-core-version:             0.0.1.1+version:             0.0.2.0 synopsis:            A collection of tools for processing PDF files. license:             BSD3 license-file:        LICENSE