Fixes the issues for export

Earlier was not able to open pdf file. Fixed that issue and also now .pdf/.xml/.jpg is appended itself if not mentioned in file name