Diff stuff.
1.  PDF output, fix NPE caused by <w:bookmarkEnd />
2.  sample, make docx|pdf output configurable