add document download support (fixes #5)