Add a parameter to allow user to skip the pdf generation for error page.

1) Purpose
Add a parameter to allow user to skip the pdf generation for the response page with error code.

2) Impact
Stick on open-closed principle. All the original behaviour is kept and this new parameter is optional and configurable.

Please email to wushaobo.china@gmail.com if any question to the code, I will be happy to explain it.