add state control to main test page
ported retina display code from current pdf viewer