if export as pdf, converts and downloads from the server