pdf first version & write to db