Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 9190)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 9191)
@@ -360,4 +360,26 @@
         return
 
+class ExportPDFAdmissionSlipPage(UtilityView, grok.View):
+    """Deliver a PDF Admission slip.
+    """
+    grok.context(IStudent)
+    grok.name('admission_slip.pdf')
+    grok.require('waeup.viewStudent')
+    prefix = 'form'
+
+    form_fields = grok.AutoFields(IStudentBase).select('student_id', 'reg_number')
+
+    @property
+    def label(self):
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        return translate(_('Admission Letter of'),
+            'waeup.kofa', target_language=portal_language) \
+            + ' %s' % self.context.display_fullname
+
+    def render(self):
+        students_utils = getUtility(IStudentsUtils)
+        return students_utils.renderPDFAdmissionLetter(self,
+            self.context.student)
+
 class StudentBaseManageFormPage(KofaEditFormPage):
     """ View to manage student base data
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9190)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 9191)
@@ -1192,5 +1192,5 @@
         self.assertTrue(
             'You logged in.' in self.browser.contents)
-        # Student can upload a passport picture
+        # Admitted student can upload a passport picture
         self.browser.open(self.student_path + '/change_portrait')
         ctrl = self.browser.getControl(name='passportuploadedit')
@@ -1203,5 +1203,11 @@
             '<img align="middle" height="125px" src="passport.jpg" />'
             in self.browser.contents)
+        # Students can open admission letter
+        self.browser.getLink("Base Data").click()
+        self.browser.getLink("Download admission letter").click()
+        self.assertEqual(self.browser.headers['Status'], '200 Ok')
+        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
         # Student can view the clearance data
+        self.browser.open(self.student_path)
         self.browser.getLink("Clearance Data").click()
         # Student can't open clearance edit form before starting clearance
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 9190)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 9191)
@@ -138,5 +138,24 @@
         f_label = formatted_label(size=12) % _('Study Course')
         f_label = Paragraph(f_label, style["Normal"])
-        f_text = formatted_text(studentview.context.certcode, size=12)
+        f_text = formatted_text(
+            studentview.context['studycourse'].certificate.longtitle(), size=12)
+        f_text = Paragraph(f_text, style["Normal"])
+        data_right.append([f_label,f_text])
+
+        f_label = formatted_label(size=12) % _('Department')
+        f_label = Paragraph(f_label, style["Normal"])
+        f_text = formatted_text(
+            studentview.context[
+            'studycourse'].certificate.__parent__.__parent__.longtitle(),
+            size=12)
+        f_text = Paragraph(f_text, style["Normal"])
+        data_right.append([f_label,f_text])
+
+        f_label = formatted_label(size=12) % _('Faculty')
+        f_label = Paragraph(f_label, style["Normal"])
+        f_text = formatted_text(
+            studentview.context[
+            'studycourse'].certificate.__parent__.__parent__.__parent__.longtitle(),
+            size=12)
         f_text = Paragraph(f_text, style["Normal"])
         data_right.append([f_label,f_text])
@@ -401,4 +420,55 @@
         return available_beds[0]
 
+    def renderPDFAdmissionLetter(self, view, student=None):
+        """Render pdf admission letter.
+        """
+        # XXX: we have to fix the import problems here.
+        from waeup.kofa.browser.interfaces import IPDFCreator
+        from waeup.kofa.browser.pdf import format_html, NOTE_STYLE
+        if student is None:
+            return
+        style = getSampleStyleSheet()
+        creator = getUtility(IPDFCreator)
+        data = []
+        doc_title = view.label
+        author = '%s (%s)' % (view.request.principal.title,
+                              view.request.principal.id)
+        footer_text = view.label
+        if getattr(student, 'student_id', None) is not None:
+            footer_text = "%s - %s - " % (student.student_id, footer_text)
+
+        # Admission text
+        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+        inst_name = grok.getSite()['configuration'].name
+        text = trans(_(
+            'This is to inform you that you have been provisionally'
+            ' admitted into ${a} as follows:', mapping = {'a': inst_name}),
+            portal_language)
+        html = format_html(text)
+        data.append(Paragraph(html, NOTE_STYLE))
+        data.append(Spacer(1, 20))
+
+        # Student data
+        data.append(render_student_data(view))
+
+        # Insert history
+        data.append(Spacer(1, 20))
+        datelist = student.history.messages[0].split()[0].split('-')
+        creation_date = u'%s/%s/%s' % (datelist[2], datelist[1], datelist[0])
+        text = trans(_(
+            'Your Kofa student record was created on ${a}.',
+            mapping = {'a': creation_date}),
+            portal_language)
+        html = format_html(text)
+        data.append(Paragraph(html, NOTE_STYLE))
+
+        # Create pdf stream
+        view.response.setHeader(
+            'Content-Type', 'application/pdf')
+        pdf_stream = creator.create_pdf(
+            data, None, doc_title, author=author, footer=footer_text,
+            note=None)
+        return pdf_stream
+
     def renderPDF(self, view, filename='slip.pdf', student=None,
                   studentview=None, tableheader=None, tabledata=None,
@@ -431,11 +501,12 @@
 
         # Insert widgets
-        data.append(Paragraph(view.title, style["Heading3"]))
-        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
-        separators = getattr(self, 'SEPARATORS_DICT', {})
-        table = creator.getWidgetsTable(
-            view.form_fields, view.context, None, lang=portal_language,
-            separators=separators)
-        data.append(table)
+        if view.form_fields:
+            data.append(Paragraph(view.title, style["Heading3"]))
+            portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
+            separators = getattr(self, 'SEPARATORS_DICT', {})
+            table = creator.getWidgetsTable(
+                view.form_fields, view.context, None, lang=portal_language,
+                separators=separators)
+            data.append(table)
 
         # Insert scanned docs
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py	(revision 9190)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py	(revision 9191)
@@ -150,5 +150,5 @@
 
 class ContactActionButton(ManageActionButton):
-    grok.order(4)
+    grok.order(5)
     grok.context(IStudent)
     grok.view(StudentBaseDisplayFormPage)
@@ -166,6 +166,15 @@
     target = 'manage_base'
 
+class AdmissionSlipActionButton(ManageActionButton):
+    grok.order(4)
+    grok.context(IStudent)
+    grok.view(StudentBaseDisplayFormPage)
+    grok.require('waeup.viewStudent')
+    icon = 'actionicon_pdf.png'
+    text = _('Download admission letter')
+    target = 'admission_slip.pdf'
+
 class StudentTransfernButton(ManageActionButton):
-    grok.order(5)
+    grok.order(6)
     grok.context(IStudent)
     grok.view(StudentBaseDisplayFormPage)
@@ -176,5 +185,5 @@
 
 class StudentDeactivateActionButton(ManageActionButton):
-    grok.order(6)
+    grok.order(7)
     grok.context(IStudent)
     grok.view(StudentBaseDisplayFormPage)
@@ -196,5 +205,5 @@
 
 class StudentActivateActionButton(ManageActionButton):
-    grok.order(6)
+    grok.order(7)
     grok.context(IStudent)
     grok.view(StudentBaseDisplayFormPage)
