Fixes scale calculation to correct pdf rendering failures.