implementing pdf writer