Almost working copy. except pdf featrure