Exemplo n.º 1
0
    def OnPrint(self, event):
        """ Print this prescription """
        if self.patient is None:
            return

        self.session.refresh(self.patient)

        temp_file = tempfile.mktemp(".pdf")

        generate_prescription(self.session, self.patient, self.txt_doctor.GetValue(), temp_file)

        pdf_view = PDFViewer(None, title="Print Preview")
        pdf_view.viewer.UsePrintDirect = ``False``
        pdf_view.viewer.LoadFile(temp_file)
        pdf_view.Show()