bugfix for pdf preview