Index: sansview/perspectives/fitting/report_dialog.py
===================================================================
--- sansview/perspectives/fitting/report_dialog.py	(revision 22963162e77a658f5b9affbe8d77c9cda810b0a3)
+++ sansview/perspectives/fitting/report_dialog.py	(revision dec793eb9cc134ca82b9de1a13a2c3050e20ff99)
@@ -24,4 +24,5 @@
     PANEL_HEIGHT = 700
     FONT_VARIANT = 0
+    ISMAC = False
 else:
     _STATICBOX_WIDTH = 480
@@ -29,4 +30,5 @@
     PANEL_HEIGHT = 700
     FONT_VARIANT = 1
+    ISMAC = True
     
 
@@ -53,4 +55,6 @@
         # font size 
         self.SetWindowVariant(variant=FONT_VARIANT)
+        # check if tit is MAC
+        self.is_mac = ISMAC
         # report string
         self.report_list = list
@@ -64,5 +68,4 @@
                                     "memory:img_fit0.png"
             elif len(list[2]) == 2:
-                #print "self.report_list[0]",self.report_list[0]
                 self.report_html = self.report_list[0] % \
                                     ("memory:img_fit0.png", 
@@ -133,8 +136,17 @@
         Save
         """
+        # pdf supporting only on MAC, not on exe
+        if self.is_mac:
+            wild_card = ' PDF files (*.pdf)|*.pdf|'
+            ind_cor = 0 
+        else:
+            wild_card = ''
+            ind_cor = 1 
+        wild_card += 'HTML files (*.html)|*.html|'
+        wild_card += 'Text files (*.txt)|*.txt'
+
         #todo: complete saving fig file and as a txt file
         dlg = wx.FileDialog(self, "Choose a file",
-                            wildcard='HTML files (*.html)|*.html|'+
-                            'Text files (*.txt)|*.txt',
+                            wildcard=wild_card,
                             style=wx.SAVE|wx.OVERWRITE_PROMPT|wx.CHANGE_DIR)
         dlg.SetFilterIndex(0) #Set .html files to be default
@@ -149,10 +161,54 @@
         #set file extensions 
         img_ext = []
-        if ext_num == 0:
+        pic_fname = []
+        #PDF 
+        if ext_num == (0 + 2 * ind_cor):
+            # TODO: Sort this case out
+            ext = '.pdf'
+            
+            fName = os.path.splitext(fName)[0] + ext
+            dlg.Destroy()
+            #pic (png) file path/name
+            for num in range(self.nimages):
+                im_ext = '_img%s.png' % num
+                #img_ext.append(im_ext)
+                pic_name = os.path.splitext(fName)[0] + im_ext
+                pic_fname.append(pic_name)
+                # save the image for use with pdf writer
+                self.report_list[2][num].savefig(pic_name)
+
+            #put the image path in html string
+            report_frame = self.report_list[0]
+            #put image name strings into the html file
+            #Note:The str for pic_fname shouldn't be removed.
+            if self.nimages == 1:
+                html = report_frame % str(pic_fname[0])
+            elif self.nimages == 2:
+                html = report_frame % (str(pic_fname[0]), str(pic_fname[1]))
+            elif self.nimages == 3:
+                html = report_frame % (str(pic_fname[0]), str(pic_fname[1]),
+                                          str(pic_fname[2]))
+
+            # make/open file in case of absence
+            f = open(fName, 'w')
+            f.close()
+            # write pdf as a pdf file
+            pdf = self.HTML2PDF(data=html, filename=fName)
+            
+            #open pdf
+            if pdf:
+                os.startfile(str(fName))
+            #delete image file
+            for num in range(self.nimages):
+                os.remove(pic_fname[num])
+            return
+        #HTML + png(graph)
+        elif ext_num == (1 - ind_cor):
             ext = '.html'
             for num in range(self.nimages):
                 img_ext.append('_img4html%s.png' % num)
             report_frame = self.report_list[0]
-        elif ext_num == 1:
+        #TEXT + pdf(graph)
+        elif ext_num == (2 - ind_cor):
             ext = '.txt'   
             # changing the image extension actually changes the image
@@ -167,5 +223,5 @@
         fName = os.path.splitext(fName)[0] + ext
         dlg.Destroy()
-        pic_fname = []
+        
         #pic (png) file path/name
         for num in range(self.nimages):
@@ -173,5 +229,5 @@
             pic_fname.append(pic_name)
         #put the image path in html string
-        if ext_num == 0:
+        if ext_num == (1 - ind_cor):
             if self.nimages == 1:
                 report = report_frame % pic_fname[0]
@@ -234,4 +290,5 @@
         # pisa requires some extra packages, see their web-site
         pdf = pisa.CreatePDF(data, f)
+
         # close the file here otherwise it will be open until quitting
         #the application.
