diff --git a/changelog.md b/changelog.md
new file mode 100644
--- /dev/null
+++ b/changelog.md
@@ -0,0 +1,6 @@
+
+0.0.4.0
+
+* extracting text: try to insert spaces and newlines
+* fix attoparsec module deprication warnings
+* fix AMP warnings
diff --git a/lib/Pdf/Toolbox/Document/Page.hs b/lib/Pdf/Toolbox/Document/Page.hs
--- a/lib/Pdf/Toolbox/Document/Page.hs
+++ b/lib/Pdf/Toolbox/Document/Page.hs
@@ -13,10 +13,12 @@
 )
 where
 
+import Data.Monoid
 import Data.Functor
 import qualified Data.Traversable as Traversable
 import Data.Text (Text)
-import qualified Data.Text as Text
+import qualified Data.Text.Lazy as TextL
+import qualified Data.Text.Lazy.Builder as TextB
 import qualified Data.Map as Map
 import Control.Monad
 
@@ -94,8 +96,8 @@
 
 -- | Extract text from the page
 --
--- Right now it doesn't even try to insert additional spaces or newlines,
--- and returns text as it is embeded. But someday it will.
+-- It tries to add spaces between chars if they don't present
+-- as actual characters in content stream.
 pageExtractText :: (MonadPdf m, MonadIO m) => Page -> PdfE m Text
 pageExtractText page = do
   -- load fonts and create glyph decoder
@@ -125,8 +127,30 @@
   let loop p = do
         next <- readNextOperator is
         case next of
-          Nothing -> return $ Text.concat $ mapMaybe glyphText $ concat $ prGlyphs p
           Just op -> processOp op p >>= loop
+          Nothing -> return $ glyphsToText (prGlyphs p)
   loop $ mkProcessor {
     prGlyphDecoder = glyphDecoder
     }
+
+-- | Convert glyphs to text, trying to add spaces and newlines
+--
+-- It takes list of spans. Each span is a list of glyphs that are outputed in one shot.
+-- So we don't need to add space inside span, only between them.
+glyphsToText :: [[Glyph]] -> Text
+glyphsToText = TextL.toStrict . TextB.toLazyText . snd . foldl step ((Vector 0 0, False), mempty)
+  where
+  step acc [] = acc
+  step ((Vector lx2 ly2, wasSpace), res) sp =
+    let Vector x1 y1 = glyphTopLeft (head sp)
+        Vector x2 _ = glyphBottomRight (last sp)
+        Vector _ y2 = glyphTopLeft (last sp)
+        space =
+          if abs (ly2 - y1) < 1.8
+            then  if wasSpace || abs (lx2 - x1) < 1.8
+                    then mempty
+                    else TextB.singleton ' '
+            else TextB.singleton '\n'
+        txt = TextB.fromLazyText $ TextL.fromChunks $ mapMaybe glyphText sp
+        endWithSpace = glyphText (last sp) == Just " "
+    in ((Vector x2 y2, endWithSpace), mconcat [res, space, txt])
diff --git a/lib/Pdf/Toolbox/Document/Pdf.hs b/lib/Pdf/Toolbox/Document/Pdf.hs
--- a/lib/Pdf/Toolbox/Document/Pdf.hs
+++ b/lib/Pdf/Toolbox/Document/Pdf.hs
@@ -27,6 +27,7 @@
 import qualified Data.ByteString as BS
 import Data.Map (Map)
 import qualified Data.Map as Map
+import Control.Applicative
 import Control.Monad
 import Control.Monad.Trans.Class
 import Control.Monad.Trans.State
@@ -51,7 +52,7 @@
 
 -- | Basic implementation of pdf monad
 newtype Pdf' m a = Pdf' (StateT PdfState m a)
-  deriving (Monad, Functor, MonadIO, MonadTrans)
+  deriving (Monad, Functor, Applicative, MonadIO, MonadTrans)
 
 -- | Convenient type alias
 type Pdf m = PdfE (Pdf' m)
diff --git a/pdf-toolbox-document.cabal b/pdf-toolbox-document.cabal
--- a/pdf-toolbox-document.cabal
+++ b/pdf-toolbox-document.cabal
@@ -1,15 +1,16 @@
 name:                pdf-toolbox-document
-version:             0.0.3.0
+version:             0.0.4.0
 synopsis:            A collection of tools for processing PDF files.
 license:             BSD3
 license-file:        LICENSE
 author:              Yuras Shumovich
 maintainer:          Yuras Shumovich <shumovichy@gmail.com>
-copyright:           Copyright (c) Yuras Shumovich 2012-2013
+copyright:           Copyright (c) Yuras Shumovich 2012-2014
 category:            PDF
 build-type:          Simple
 cabal-version:       >=1.8
 homepage:            https://github.com/Yuras/pdf-toolbox
+extra-source-files:  changelog.md
 description:
   Mid level tools for processing PDF files.
   .
@@ -42,5 +43,5 @@
                        io-streams,
                        cipher-rc4,
                        cryptohash,
-                       pdf-toolbox-core ==0.0.2.*,
+                       pdf-toolbox-core >=0.0.2 && <0.0.4,
                        pdf-toolbox-content ==0.0.3.*
