Adding form element to output

Poppler takes care of almost everything, I simply added the form tags at the end of every page.
The source code is kind of messy here, can you tweak it according to other files? 
E.g. https://github.com/coolwanglu/pdf2htmlEX/blob/master/src/HTMLRenderer/general.cc#L210