Esempio n. 1
0
 def __init__(self, title="No Title", lang=None):
     FPDF.__init__(self)
     self.smTitle = str(title)
     self.smLang = lang
     self.set_title("Data Export")
     
     # first page:
     self.add_page()
Esempio n. 2
0
def report():
    id = request.args(0)
    if not id: redirect(URL('index'))
    title = "Nome Externo"
    heading = "First Paragraph"
    text = 'xpto ' * 100
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font('Times','B',15)
    pdf.cell(w=210,h=9,txt=title,border=0,ln=1,align='C',fill=0)
    pdf.set_font('Times','B',15)
    pdf.cell(w=0,h=6,txt=heading,border=0,ln=1,align='L',fill=0)
    pdf.set_font('Times','',12)
    pdf.multi_cell(w=0,h=5,txt=text)
    response.headers['Content-Type']='application/pdf'
    return pdf.output(name='report.pdf',dest='S')
Esempio n. 3
0
def report():
    id = request.args(0) or 0
    if not id: redirect(URL('index'))
    title = "SORT Arquivo"
    heading = "First Paragraph"
    text = 'xpto ' * 100
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font('Times', 'B', 15)
    pdf.cell(w=210, h=9, txt=title, border=0, ln=1, align='C', fill=0)
    pdf.set_font('Times', 'B', 15)
    pdf.cell(w=0, h=6, txt=heading, border=0, ln=1, align='L', fill=0)
    pdf.set_font('Times', '', 12)
    pdf.multi_cell(w=0, h=5, txt=text)
    response.headers['Content-Type'] = 'application/pdf'
    return pdf.output(name='report.pdf', dest='S')
def get_me_a_pyfpdf():
    title = "This The Doc Title"
    heading = "First Paragraph"
    text = 'bla '* 10000

    pdf=FPDF()
    pdf.add_page()
    pdf.set_font('Times','B',15)
    pdf.cell(w=210,h=9,txt=title,border=0,ln=1,align='C',fill=0)
    pdf.set_font('Times','B',15)
    pdf.cell(w=0,h=6,txt=heading,border=0,ln=1,align='L',fill=0)
    pdf.set_font('Times','',12)
    pdf.multi_cell(w=0,h=5,txt=text)
    response.headers['Content-Type']='application/pdf'
    return pdf.output(dest='S')
Esempio n. 5
0
def get_me_a_pyfpdf():
    title = "This The Doc Title"
    heading = "First Paragraph"
    text = "bla " * 10000

    pdf = FPDF()
    pdf.add_page()
    pdf.set_font("Times", "B", 15)
    pdf.cell(w=210, h=9, txt=title, border=0, ln=1, align="C", fill=0)
    pdf.set_font("Times", "B", 15)
    pdf.cell(w=0, h=6, txt=heading, border=0, ln=1, align="L", fill=0)
    pdf.set_font("Times", "", 12)
    pdf.multi_cell(w=0, h=5, txt=text)
    response.headers["Content-Type"] = "application/pdf"
    return pdf.output(dest="S")
Esempio n. 6
0
 def __init__(self):
     FPDF.__init__(self,'L')
Esempio n. 7
0
def prescription_PDF():
    import time
    uid = int(request.vars.uid)
    name = str(request.vars.name)
    name = name.replace('_', ' ')
    age = str(request.vars.age)
    sex = str(request.vars.sex)
    doc = str(request.vars.doctor)
    hname = str(request.vars.hname)
    allergy = str(request.vars.allergy)
    allergy = allergy.replace('\\n', '\n')
    allergy = allergy.replace('_', ' ')
    name = name.replace('_', ' ')
    doc = doc.replace('_', ' ')
    from gluon.contrib.pyfpdf import FPDF, HTMLMixin
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font('Arial', '', 30)
    pdf.set_text_color(0, 0, 0)
    pdf.cell(w=200, h=30, txt=hname, ln=2, border=2, align='C', fill='0')
    pdf.set_font('Arial', '', 15)
    pdf.set_text_color(0, 0, 0)
    pdf.cell(w=0, h=10, txt="Name: " + name, border=0, align='L', fill='0')
    pdf.cell(w=-150, h=10, txt='Age: ' + age, border=0, align='C', fill='0')
    pdf.cell(w=0, h=10, txt="Gender: " + sex, border=0, align='R', fill='0')
    pdf.cell(w=30, h=10, txt="", ln=1, border=0, align='L', fill='0')
    pdf.cell(w=30, h=10, txt="Allergies: ", border=0, align='L', fill='0')
    pdf.cell(w=3 * len(allergy),
             h=10,
             txt=allergy,
             border=0,
             align='L',
             fill='0')
    pdf.cell(w=30, h=10, txt="", ln=1, border=0, align='L', fill='0')
    img = db(db.prescription.patient_id == uid).select()
    x = img[-1]['prescription_image']
    source = os.path.join(request.folder, 'uploads', x)
    pdf.image(name=source, w=170, h=170, type=(x.split('.'))[-1])
    pdf.cell(w=30, h=10, txt="", ln=1, border=0, align='L', fill='0')
    pdf.set_font('Arial', '', 15)
    pdf.set_text_color(0, 0, 0)
    pdf.cell(w=0,
             h=10,
             txt="Date: " + time.strftime("%d/%m/%Y"),
             border=0,
             align='L',
             fill='0')
    pdf.cell(w=-20, h=10, txt=doc, border=0, align='R', fill='0')
    pdf.cell(w=30, h=10, txt="", ln=1, border=0, align='R', fill='0')
    pdf.cell(w=30, h=10, txt="", ln=1, border=0, align='R', fill='0')
    pdf.cell(w=120,
             h=10,
             txt="Powered by RXGUIDE",
             border=0,
             align='R',
             fill='0')
    response.headers['Content-Type'] = 'application/pdf'
    return pdf.output(name='prescription.pdf', dest="S")
Esempio n. 8
0
def intellectual_form():
    import os
    from gluon.contrib.pyfpdf import FPDF

    candidate = db(db.auth_user.id == auth.user_id).select().first()
    inscription = db(db.shift_candidate.auth_user == auth.user_id).select().last()
    logoIES = os.path.join(request.folder, "static", "images", "logo_ies.png")
    logoMinSeg = os.path.join(request.folder, "static", "images", "logoMinisterio.png")

    #creo el objeto PDF
    pdf = FPDF('P', 'mm', 'A4')

    #FORMULARIO NOTAS EXAMEN INTELECTUAL
    pdf.add_page()
    #LOGOS
    pdf.image(logoIES,165,10,23,26)
    pdf.image(logoMinSeg,45,13,80,20)
    #VARIABLES
    enc_intelectual = unicode('FORMULARIO DE EXÁMENES DE CONOCIMIENTOS INTELECTUALES PARA ASPIRANTES A CADETES DE PRIMER AÑO DEL INSTITUTO DE ENSEÑANZA SUPERIOR DE POLICÍA "GRAL. JOSÉ FRANCISCO DE SAN MARTÍN"','utf-8')
    presentado = unicode('(El presente formulario deberá ser presentado por el Aspirante al momento de rendir los Exámenes de Conocimientos Intelectuales)','utf-8')
    aprobacion = unicode('La aprobación del EXAMEN DE CONOCIMIENTOS INTELECTUALES requerirá la obtención de un puntaje mínimo de sesenta (60) sobre cien (100) puntos por materia o de doscientos cuarenta (240) puntos en la sumatoria de las tres asignaturas, siempre y cuando no se obtenga menos de cuarenta (40) puntos en ninguna materia.','utf-8')
    sin_recuperatorio = unicode('LOS EXAMENES INTELECTUALES NO TIENEN RECUPERATORIO.','utf-8')
    pdf.rect(30,37,170,250)
    pdf.set_xy(33,40)
    pdf.set_font('Arial','BU',12)
    pdf.multi_cell(165,5,enc_intelectual,0,'C',False)
    pdf.set_xy(31,56)
    pdf.set_font('Times','',9)
    pdf.multi_cell(172,3,presentado,0,'',False)
    pdf.set_font('Times','',12)
    pdf.text(33,70,'APELIDO/S:  '+unicode(inscription.auth_user.last_name,'utf-8').upper())
    pdf.text(33,75,'NOMBRE/S:  '+unicode(inscription.auth_user.first_name,'utf-8').upper())
    pdf.text(33,80,'D.N.I.:  '+unicode(inscription.auth_user.username,'utf-8').upper())
    pdf.text(33,85,'FECHA DE NACIMIENTO:  ' + inscription.auth_user.birth_date.strftime("%d/%m/%Y"))
    pdf.text(33,90,'NACIONALIDAD:  ' + unicode(inscription.auth_user.nationality,'utf-8').upper())
    pdf.rect(140,60,60,30)
    pdf.text(153,68,unicode('FORMULARIO N°','utf-8'))
    pdf.set_xy(140,75)
    pdf.set_font('Arial','B',40)
    pdf.multi_cell(60,5,str(inscription.id),0,'C',False)
    pdf.set_xy(33,98)
    pdf.set_font('Times','',10)
    pdf.multi_cell(165,5,aprobacion,0,'J',False)
    pdf.text(125,125,unicode('SAN MIGUEL DE TUCUMÁN,......./......./..............','utf-8'))
    pdf.text(125,242,unicode('SAN MIGUEL DE TUCUMÁN,......./......./..............','utf-8'))
    pdf.text(33,135,unicode('FIRMA DEL ASPIRANTE.........................................................................................................................................','utf-8'))
    pdf.text(33,142,unicode('ACLARACIÓN...........................................................................................................................................................','utf-8'))
    pdf.text(33,256,unicode('FIRMA DEL ASPIRANTE.........................................................................................................................................','utf-8'))
    pdf.text(33,264,unicode('ACLARACIÓN...........................................................................................................................................................','utf-8'))
    

    pdf.set_xy(33,112)
    pdf.set_font('Times','B',10)
    pdf.multi_cell(165,5,sin_recuperatorio,0,'',False)

    #CUADRO NOTAS EXAMENES
    pdf.rect(33,152,164,40)
    pdf.line(33,162,197,162)
    pdf.line(74,162,74,192)
    pdf.line(115,162,115,192)
    pdf.line(156,162,156,192)
    pdf.dashed_line(36,188,71,188)
    pdf.dashed_line(77,188,112,188)
    pdf.dashed_line(118,188,153,188)
    pdf.dashed_line(159,188,194,188)
    pdf.rect(84,200,62,30)
    pdf.line(84,210,146,210)
    pdf.dashed_line(87,227,143,227)

    pdf.text(87,158,unicode('RESULTADO DE LOS EXÁMENES','utf-8'))
    pdf.text(46,168,'LENGUA')
    pdf.text(86,168,'HISTORIA')
    pdf.text(125,168,unicode('GEOGRAFÍA','utf-8'))
    pdf.text(104,206,'PROMEDIO')
    pdf.set_xy(156,165)
    pdf.multi_cell(41,4,unicode('EDUCACIÓN ÉTICA Y CIUDADANA','utf-8'),0,'C',False)

    return pdf.output(dest='S')
Esempio n. 9
0
def report():
    id = request.args(0) or 0
    if not id:
        redirect(URL("index"))
    title = "SORT com uma saida"
    heading = "First Paragraph"
    text = "xpto " * 100
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font("Times", "B", 15)
    pdf.cell(w=210, h=9, txt=title, border=0, ln=1, align="C", fill=0)
    pdf.set_font("Times", "B", 15)
    pdf.cell(w=0, h=6, txt=heading, border=0, ln=1, align="L", fill=0)
    pdf.set_font("Times", "", 12)
    pdf.multi_cell(w=0, h=5, txt=text)
    response.headers["Content-Type"] = "application/pdf"
    return pdf.output(name="report.pdf", dest="S")
Esempio n. 10
0
def print_inscription_form():
    import os
    from gluon.contrib.pyfpdf import FPDF

    candidate = db(db.auth_user.username == request.vars['dni']).select().first()
    inscription = db(db.shift_candidate.auth_user == candidate.id).select().last()
    age = calculate_age(candidate.birth_date)
    logoIES = os.path.join(request.folder, "static", "images", "logo_ies.png")
    logoMinSeg = os.path.join(request.folder, "static", "images", "logoMinisterio.png")
    
    titulo_form = unicode('FORMULARIO ÚNICO DE INSCRIPCIÓN PARA ASPIRANTES A CADETES DE PRIMER AÑO DEL INSTITUTO DE ENSEÑANZA SUPERIOR DE POLICÍA "GRAL. JOSE FRANCISCO DE SAN MARTÍN" - CICLO LECTIVO 2019',"utf-8")
    declaracion_jurada = unicode('Declaro bajo juramento de ley: 1°) Que los datos consignados son verdaderos; 2°) Que he tomado conocimiento y acepto los términos de la presente convocatoria y proceso de selección, conforme el Decreto respectivo, como así tambien las pautas establecidas por el I.E.S. de Policía "GJFSM"; 3°) Que no registro antecedentes judiciales ni penales de carácter doloso ni contravencionales policiales, ni me encuentro procesado por la justicia provincial o nacional. En consecuencia, quedo sujeto a las normas que rigen administrativa y jurídicamente en la materia (Art. 172, 292 y c.c. Código Penal Argentino), y además obligado a comunicar toda variante dentro de los 15 (quince) días corridos a partir de la fecha en que éstas se hayan producido.','utf-8')
    pdf = FPDF('P', 'mm', 'A4')
    pdf.add_page()
    #LOGOS
    pdf.image(logoIES,165,10,23,26)
    pdf.image(logoMinSeg,45,13,80,20)
    pdf.set_font('Times', 'B', 12)
    pdf.line(30,37,200,37)
    pdf.line(30,37,30,290)
    pdf.line(200,37,200,290)
    pdf.line(30,290,200,290)
    pdf.line(30,75,200,75)
    pdf.line(120,37,120,75)
    pdf.line(30,239,200,239)
    pdf.dashed_line(35,65,115,65) #FIRMA CONTROLADOR FORMULARIO
    pdf.dashed_line(138,278,198,278) #FIRMA CONTROLADOR FISICO

    pdf.text(40,43,unicode('DOCUMENTACIÓN CONTROLADA','utf-8'))
    pdf.text(138,43,'FORMULARIO NRO:')
    pdf.text(33,50,'FECHA:         /         /')
    pdf.text(37,70,'FIRMA Y SELLO DEL CONTROLADOR')
    pdf.text(150,63,'TURNO:')
    pdf.text(125,69,unicode('DÍA: ','utf-8') + inscription.shift.shift_date.strftime("%d/%m/%Y"))
    pdf.text(125,74,'HORA: ' + inscription.shift.shift_time.strftime("%H:%M"))
    pdf.set_xy(38,77)
    pdf.multi_cell(157,5, titulo_form,0,'C',False)
    #DATOS DEL POSTULANTE
    pdf.set_font('Times','',12)
    pdf.text(34,100,'APELLIDO/S: ' + unicode(inscription.auth_user.last_name,'utf-8').upper())
    pdf.text(34,105,'NOMBRE/S: ' + unicode(inscription.auth_user.first_name,'utf-8').upper())
    pdf.text(34,110, 'D.N.I.:' + unicode(inscription.auth_user.username, 'utf-8'))
    pdf.text(34,115,'FECHA DE NACIMIENTO: ' + inscription.auth_user.birth_date.strftime("%d/%m/%Y"))
    pdf.text(34,120,'EDAD: ' + str(age))
    pdf.text(34,125,'GENERO: ' + unicode(inscription.auth_user.gender,'utf-8').upper())
    pdf.text(34,130,'ESTADO CIVIL: ' + unicode(inscription.auth_user.marital_status, 'utf-8').upper())
    pdf.text(34,135,'NACIONALIDAD: ' + unicode(inscription.auth_user.nationality, 'utf-8').upper())
    pdf.text(34,140, 'DOMICILIO: ' + unicode(inscription.auth_user.address, 'utf-8').upper())
    pdf.text(34,145, 'CIUDAD / LOCALIDAD: ' + unicode(inscription.auth_user.city,'utf-8').upper())
    pdf.text(34,150,'PROVINCIA: ' + unicode(inscription.auth_user.province,'utf-8').upper())
    pdf.text(34,155, unicode('COMISARIA JURISDICCIONAL: ' + inscription.auth_user.police_station, 'utf-8').upper())
    pdf.text(34,160,'TEL. FIJO: ' + inscription.auth_user.phone)
    pdf.text(34,165,'TEL. CEL.: ' + inscription.auth_user.mobile_phone)
    pdf.text(34,170,unicode('CORREO ELECTRÓNICO: ','utf-8') + unicode(inscription.auth_user.email,'utf-8').lower())
    if(len(inscription.auth_user.high_school)<=40):
        pdf.text(34,175, unicode('TÍTULO SECUNDARIO EXPEDIDO POR: ' + inscription.auth_user.high_school,'utf-8').upper())
    else:
        pdf.text(34,175, unicode('TÍTULO SECUNDARIO EXPEDIDO POR:','utf-8'))
        pdf.set_xy(110,171)
        pdf.set_font('Times','',9)
        pdf.multi_cell(85,2.8,unicode(inscription.auth_user.high_school,'utf-8').upper(),0,'J',False)
        pdf.set_font('Times','',12)
    if(len(inscription.auth_user.high_school)<=40):
        pdf.text(34,180, unicode('TÍTULO TERCIARIO/UNIVERSITARIO: ' + inscription.auth_user.tertiary_title,'utf-8').upper())
    else:
        pdf.text(34,180, unicode('TÍTULO TERCIARIO/UNIVERSITARIO: ','utf-8'))
        pdf.set_xy(108,176)
        pdf.set_font('Times','',9)
        pdf.multi_cell(85,2.8,unicode(inscription.auth_user.tertiary_title,'utf-8').upper(),0,'J',False)
        pdf.set_font('Times','',12)

    pdf.set_font('Times','B',12)
    pdf.text(37,245, unicode('ESTOS DATOS SERÁN COMPLETADOS POR PERSONAL DEL I.E.S.P "G.J.F.S.M"','utf-8'))
    pdf.set_font('Times','',12)
    pdf.text(34,257, 'ESTATURA:..................')
    pdf.text(34,267, 'PESO:.............................')
    pdf.text(34,277, 'I.M.C.:............................')
    pdf.set_xy(34,185.7)
    pdf.set_font('Times','',12)
    pdf.multi_cell(160,4, declaracion_jurada,0,'J',False)
    pdf.set_font('Times','',9)
    pdf.text(34,230,unicode('FIRMA DEL ASPIRANTE AL MOMENTO DE PRESENTAR LA DOCUMENTACIÓN: ..........................................................','utf-8'))
    pdf.text(34,237,unicode('ACLARACIÓN: .................................................................................................................................................................................','utf-8'))
    #pdf.set_xy(34,320)
    #pdf.multi_cell(160,5, aclaracion,0,'J',False)
    pdf.text(140,282, 'FIRMA Y SELLO DEL CONTROLADOR')


    #NRO DE FORMULARIO
    pdf.set_font('Arial','B',40)
    pdf.set_xy(120,47)
    pdf.cell(75,10,str(inscription.id),0,0,'C')

    #SEGUNDA PAGINA
    pdf.add_page()
    #LOGOS
    pdf.image(logoIES,165,10,23,26)
    pdf.image(logoMinSeg,45,13,80,20)
    pdf.set_font('Times', 'B', 12)
    pdf.line(30,37,200,37)
    pdf.line(30,37,30,290)
    pdf.line(200,37,200,290)
    pdf.line(30,290,200,290)
    pdf.line(30,75,200,75)
    pdf.line(120,37,120,75)
    pdf.line(30,239,200,239)
    pdf.dashed_line(35,65,115,65) #FIRMA CONTROLADOR FORMULARIO
    pdf.dashed_line(138,278,198,278) #FIRMA CONTROLADOR FISICO

    pdf.text(40,43,unicode('DOCUMENTACIÓN CONTROLADA','utf-8'))
    pdf.text(138,43,'FORMULARIO NRO:')
    pdf.text(33,50,'FECHA:         /         /')
    pdf.text(37,70,'FIRMA Y SELLO DEL CONTROLADOR')
    pdf.text(150,63,'TURNO:')
    pdf.text(125,69,unicode('DÍA: ','utf-8') + inscription.shift.shift_date.strftime("%d/%m/%Y"))
    pdf.text(125,74,'HORA: ' + inscription.shift.shift_time.strftime("%H:%M"))
    pdf.set_xy(38,77)
    pdf.multi_cell(157,5, titulo_form,0,'C',False)
    #DATOS DEL POSTULANTE
    pdf.set_font('Times','',12)
    pdf.text(34,100,'APELLIDO/S: ' + unicode(inscription.auth_user.last_name,'utf-8').upper())
    pdf.text(34,105,'NOMBRE/S: ' + unicode(inscription.auth_user.first_name,'utf-8').upper())
    pdf.text(34,110, 'D.N.I.:' + unicode(inscription.auth_user.username, 'utf-8'))
    pdf.text(34,115,'FECHA DE NACIMIENTO: ' + inscription.auth_user.birth_date.strftime("%d/%m/%Y"))
    pdf.text(34,120,'EDAD: ' + str(age))
    pdf.text(34,125,'GENERO: ' + unicode(inscription.auth_user.gender,'utf-8').upper())
    pdf.text(34,130,'ESTADO CIVIL: ' + unicode(inscription.auth_user.marital_status, 'utf-8').upper())
    pdf.text(34,135,'NACIONALIDAD: ' + unicode(inscription.auth_user.nationality, 'utf-8').upper())
    pdf.text(34,140, 'DOMICILIO: ' + unicode(inscription.auth_user.address, 'utf-8').upper())
    pdf.text(34,145, 'CIUDAD / LOCALIDAD: ' + unicode(inscription.auth_user.city,'utf-8').upper())
    pdf.text(34,150,'PROVINCIA: ' + unicode(inscription.auth_user.province,'utf-8').upper())
    pdf.text(34,155, unicode('COMISARIA JURISDICCIONAL: ' + inscription.auth_user.police_station, 'utf-8').upper())
    pdf.text(34,160,'TEL. FIJO: ' + inscription.auth_user.phone)
    pdf.text(34,165,'TEL. CEL.: ' + inscription.auth_user.mobile_phone)
    pdf.text(34,170,unicode('CORREO ELECTRÓNICO: ','utf-8') + unicode(inscription.auth_user.email,'utf-8').lower())
    if(len(inscription.auth_user.high_school)<=40):
        pdf.text(34,175, unicode('TÍTULO SECUNDARIO EXPEDIDO POR: ' + inscription.auth_user.high_school,'utf-8').upper())
    else:
        pdf.text(34,175, unicode('TÍTULO SECUNDARIO EXPEDIDO POR:','utf-8'))
        pdf.set_xy(110,171)
        pdf.set_font('Times','',9)
        pdf.multi_cell(85,2.8,unicode(inscription.auth_user.high_school,'utf-8').upper(),0,'J',False)
        pdf.set_font('Times','',12)
    if(len(inscription.auth_user.high_school)<=40):
        pdf.text(34,180, unicode('TÍTULO TERCIARIO/UNIVERSITARIO: ' + inscription.auth_user.tertiary_title,'utf-8').upper())
    else:
        pdf.text(34,180, unicode('TÍTULO TERCIARIO/UNIVERSITARIO: ','utf-8'))
        pdf.set_xy(108,176)
        pdf.set_font('Times','',9)
        pdf.multi_cell(85,2.8,unicode(inscription.auth_user.tertiary_title,'utf-8').upper(),0,'J',False)
        pdf.set_font('Times','',12)

    pdf.set_font('Times','B',12)
    pdf.text(37,245, unicode('ESTOS DATOS SERÁN COMPLETADOS POR PERSONAL DEL I.E.S.P "G.J.F.S.M"','utf-8'))
    pdf.set_font('Times','',12)
    pdf.text(34,257, 'ESTATURA:..................')
    pdf.text(34,267, 'PESO:.............................')
    pdf.text(34,277, 'I.M.C.:............................')
    pdf.set_xy(34,185.7)
    pdf.set_font('Times','',12)
    pdf.multi_cell(160,4, declaracion_jurada,0,'J',False)
    pdf.set_font('Times','',9)
    pdf.text(34,230,unicode('FIRMA DEL ASPIRANTE AL MOMENTO DE PRESENTAR LA DOCUMENTACIÓN: ..........................................................','utf-8'))
    pdf.text(34,237,unicode('ACLARACIÓN: .................................................................................................................................................................................','utf-8'))
    #pdf.set_xy(34,320)
    #pdf.multi_cell(160,5, aclaracion,0,'J',False)
    pdf.text(140,282, 'FIRMA Y SELLO DEL CONTROLADOR')


    #NRO DE FORMULARIO
    pdf.set_font('Arial','B',40)
    pdf.set_xy(120,47)
    pdf.cell(75,10,str(inscription.id),0,0,'C')


    #FORMULARIO NOTAS EXAMEN INTELECTUAL
    pdf.add_page()
    #LOGOS
    pdf.image(logoIES,165,10,23,26)
    pdf.image(logoMinSeg,45,13,80,20)
    #VARIABLES
    enc_intelectual = unicode('FORMULARIO DE EXÁMENES DE CONOCIMIENTOS INTELECTUALES PARA ASPIRANTES A CADETES DE PRIMER AÑO DEL INSTITUTO DE ENSEÑANZA SUPERIOR DE POLICÍA "GRAL. JOSÉ FRANCISCO DE SAN MARTÍN"','utf-8')
    presentado = unicode('(El presente formulario deberá ser presentado por el Aspirante al momento de rendir los Exámenes de Conocimientos Intelectuales)','utf-8')
    aprobacion = unicode('La aprobación del EXAMEN DE CONOCIMIENTOS INTELECTUALES requerirá la obtención de un puntaje mínimo de sesenta (60) sobre cien (100) puntos por materia o de doscientos cuarenta (240) puntos en la sumatoria de las tres asignaturas, siempre y cuando no se obtenga menos de cuarenta (40) puntos en ninguna materia.','utf-8')
    sin_recuperatorio = unicode('LOS EXAMENES INTELECTUALES NO TIENEN RECUPERATORIO.','utf-8')
    pdf.rect(30,37,170,250)
    pdf.set_xy(33,40)
    pdf.set_font('Arial','BU',12)
    pdf.multi_cell(165,5,enc_intelectual,0,'C',False)
    pdf.set_xy(31,56)
    pdf.set_font('Times','',9)
    pdf.multi_cell(172,3,presentado,0,'',False)
    pdf.set_font('Times','',12)
    pdf.text(33,70,'APELIDO/S:  '+unicode(inscription.auth_user.last_name,'utf-8').upper())
    pdf.text(33,75,'NOMBRE/S:  '+unicode(inscription.auth_user.first_name,'utf-8').upper())
    pdf.text(33,80,'D.N.I.:  '+unicode(inscription.auth_user.username,'utf-8').upper())
    pdf.text(33,85,'FECHA DE NACIMIENTO:  ' + inscription.auth_user.birth_date.strftime("%d/%m/%Y"))
    pdf.text(33,90,'NACIONALIDAD:  ' + unicode(inscription.auth_user.nationality,'utf-8').upper())
    pdf.rect(140,60,60,30)
    pdf.text(153,68,unicode('FORMULARIO N°','utf-8'))
    pdf.set_xy(140,75)
    pdf.set_font('Arial','B',40)
    pdf.multi_cell(60,5,str(inscription.id),0,'C',False)
    pdf.set_xy(33,98)
    pdf.set_font('Times','',10)
    pdf.multi_cell(165,5,aprobacion,0,'J',False)
    pdf.text(125,125,unicode('SAN MIGUEL DE TUCUMÁN,......./......./..............','utf-8'))
    pdf.text(125,242,unicode('SAN MIGUEL DE TUCUMÁN,......./......./..............','utf-8'))
    pdf.text(33,135,unicode('FIRMA DEL ASPIRANTE.........................................................................................................................................','utf-8'))
    pdf.text(33,142,unicode('ACLARACIÓN...........................................................................................................................................................','utf-8'))
    pdf.text(33,256,unicode('FIRMA DEL ASPIRANTE.........................................................................................................................................','utf-8'))
    pdf.text(33,264,unicode('ACLARACIÓN...........................................................................................................................................................','utf-8'))
    

    pdf.set_xy(33,112)
    pdf.set_font('Times','B',10)
    pdf.multi_cell(165,5,sin_recuperatorio,0,'',False)

    #CUADRO NOTAS EXAMENES
    pdf.rect(33,152,164,40)
    pdf.line(33,162,197,162)
    pdf.line(74,162,74,192)
    pdf.line(115,162,115,192)
    pdf.line(156,162,156,192)
    pdf.dashed_line(36,188,71,188)
    pdf.dashed_line(77,188,112,188)
    pdf.dashed_line(118,188,153,188)
    pdf.dashed_line(159,188,194,188)
    pdf.rect(84,200,62,30)
    pdf.line(84,210,146,210)
    pdf.dashed_line(87,227,143,227)

    pdf.text(87,158,unicode('RESULTADO DE LOS EXÁMENES','utf-8'))
    pdf.text(46,168,'LENGUA')
    pdf.text(86,168,'HISTORIA')
    pdf.text(125,168,unicode('GEOGRAFÍA','utf-8'))
    pdf.text(104,206,'PROMEDIO')
    pdf.set_xy(156,165)
    pdf.multi_cell(41,4,unicode('EDUCACIÓN ÉTICA Y CIUDADANA','utf-8'),0,'C',False)

    #FORMULARIO DE AUTORIZACION MENOR DE EDAD
    if age < 18:
        instituto = unicode('INSTITUTO DE ENSEÑANZA SUPERIOR DE POLICÍA "GRAL. JOSÉ FRANCISCO DE SAN MARTÍN"','utf-8')
        direccion = unicode('Calle Muñecas N°1.025 - San Miguel de Tucumán','utf-8')
        telefono = unicode('Telefono N°(0381) 4305141 - Republica Argentina','utf-8')
        porintermedio = unicode('Por intermedio de la presente, manifiesto/amos expreso consentimiento AUTORIZANDO a mí/nuestro....................................................................................., DNI nro.......................................nacido el ......./......./.............. a inscribirse  y participar en todas las etapas del proceso de selección (Exámenes Intelectuales, Psicológicos, Médicos y de Aptitud Física), para ingresar como Aspirante a Cadete de Primer Año del Instituto de Enseñanza Superior de Policía "Gral. José Francisco de San Martín"  Ciclo Lectivo 2019, bajo los términos y condiciones del Decreto respectivo y las pautas establecidas por el I.E.S.P. "G.J.F.S.M."','utf-8')
        consentimiento = unicode('(El consentimiento expreso para la presente autorización debe ser otorgada por ambos progenitores de conformidad a lo dispuesto por el Art. 645 y ccs del Código Civil y Comercial de la nación).','utf-8')
        enesteacto = unicode('En este acto presta conformidad expresa el menor de edad para realizar  los actos enunciados precedentemente.','utf-8')
        certificacion = unicode('CERTIFICACIÓN DE FIRMAS POR ESCRIBANO PÚBLICO O JUEZ DE PAZ (DE PROGENITORES)','utf-8')
        certificacion2 = unicode('CERTIFICACIÓN DE FIRMAS POR ESCRIBANO PÚBLICO O JUEZ DE PAZ\n(DE PADRES O REPRESENTANTE LEGAL)','utf-8')
        suscribe = unicode('El que suscribe CERTIFICA que la/s firma/s que antecede/n pertenece/n\na ........................................................................... DNI N°....................................................\n y a........................................................................ DNI N°....................................................\npor haber sido puesta/s en mi presencia.','utf-8')

        pdf.add_page()
        pdf.rect(30,10,175,28)
        pdf.image(logoIES,32,11,23,26)
        pdf.set_xy(52,11)
        pdf.set_font('Times','B',14)
        pdf.multi_cell(135,5, instituto,0,'C',False)
        pdf.set_font('Times','',12)
        pdf.text(77,30,direccion)
        pdf.text(76,35,telefono)
        pdf.set_font('Arial','BU',14)
        pdf.set_xy(30,40)
        pdf.multi_cell(150,6,unicode('INGRESO 2019\nAUTORIZACIÓN PARA ASPIRANTES MENORES DE 18 AÑOS','utf-8'),0,'C',False)
        pdf.set_xy(30,55)
        pdf.set_font('Times','',10)
        pdf.multi_cell(150,4,consentimiento,0,'J',False)
        pdf.set_font('Times','',12)
        pdf.set_xy(30,70)
        pdf.multi_cell(150,5,porintermedio,0,'J',False)
        pdf.rect(30,115,155,60)
        pdf.line(30,125,185,125)
        pdf.line(30,145,185,145)
        pdf.line(30,155,185,155)
        pdf.line(80,115,80,175)
        pdf.line(135,125,135,145)
        pdf.line(135,155,135,175)
        pdf.line(135,130,185,130)
        pdf.line(135,160,185,160)
        pdf.set_xy(30,116)
        pdf.set_font('Arial','B',10)
        pdf.multi_cell(48,4,'APELLIDO Y NOMBRE DEL PROGENITOR',0,'C',False)
        pdf.set_xy(30,146)
        pdf.multi_cell(48,4,'APELLIDO Y NOMBRE DEL PROGENITOR',0,'C',False)
        pdf.text(45,135,'FIRMA')
        pdf.text(45,165,'FIRMA')
        pdf.text(150,129, unicode('D.N.I N°','utf-8'))
        pdf.text(150,159, unicode('D.N.I N°','utf-8'))
        pdf.set_font('Arial','', 9)
        pdf.text(90,209,'(Lugar y Fecha)')
        pdf.text(31,226,unicode('*Espacio reservado para certificación de firmas','utf-8'))
        pdf.set_xy(30,176)
        pdf.multi_cell(150,3,enesteacto,0,'C',False)
        pdf.rect(30,182,155,15)
        pdf.line(30,187,185,187)
        pdf.line(120,182,120,197)
        pdf.line(132,182,132,197)
        pdf.line(30,205,185,205)
        pdf.set_font('Arial','B',10)
        pdf.text(45,186,'APELLIDO Y NOMBRE DEL MENOR')
        pdf.text(121,186,'EDAD')
        pdf.text(151,186,unicode('DNI N°','utf-8'))
        pdf.set_xy(30,213)
        pdf.set_font('Arial','B',12)
        pdf.multi_cell(155,5,certificacion,0,'C',False)
        pdf.rect(30,223,155,68)

    return pdf.output(dest='S')
Esempio n. 11
0
 def __init__(self):
     FPDF.__init__(self, 'L')
Esempio n. 12
0
def mypdf3():
    
    r=db(request.args[0]==db.details.myid).select()
    s=db(request.args[0]==db.project.myid).select()
    t=db(request.args[0]==db.achievements.myid).select()
    u=db(db.auth_user.id==request.args[0]).select(db.auth_user.email)
    from gluon.contrib.pyfpdf import FPDF, HTMLMixin
    pdf=FPDF()
    pdf.add_page()
    pdf.set_font('Arial','BU',40)
    #pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
    pdf.set_text_color(100,0,100)
    pdf.cell(w=80,h=30,txt="Curriculum Vitae",ln=2,border=2,align='L',fill='0')
    pdf.set_text_color(0,0,0)
    pdf.set_font('Arial','BU',30)
    pdf.set_text_color(0,0,100)
    pdf.cell(w=80,h=30,txt="Biodata",ln=1,border=2,align='L',fill='0')
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Name  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].name,ln=1,border=2,align='L',fill='0')
    
    
    
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Current Year  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].current_year,border=2,ln=1,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="CGPA  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=str(r[0].cg),ln=1,border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="College  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].college,border=2,ln=1,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="Branch  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].branch,border=2,ln=1,align='L',fill='0')
    
    pdf.set_text_color(0,0,0)  
     
    #pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    #pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    #pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    pdf.set_font('Arial','BU',30)
    pdf.set_text_color(0,0,100)
    if len(s) != 0:
        pdf.cell(w=60,h=10,txt="Projects/Interns    ",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="                                          ",ln=1,border=2,align='L',fill='0')
    pdf.set_text_color(0,0,0)
    for i in s:
        pdf.set_font('Arial','BI',20)
        pdf.cell(w=60,h=10,txt=i.name,ln=1,border=2,align='L',fill='0')
        pdf.set_font('Arial','',15)
        pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="Mentor  :",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt=i.mentor,ln=1,border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="Organistion  :",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt=i.org,ln=1,border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="Description  :",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt=i.Description,ln=1,border=2,align='L',fill='3')
        pdf.cell(w=60,h=10,txt="Skills Used  :",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt=i.skills_used,ln=1,border=2,align='L',fill='3')
        pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
        #pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    pdf.set_font('Arial','BU',30)
    pdf.set_text_color(0,0,100)
    if len(s) != 0:
        pdf.cell(w=60,h=10,txt="Achievements    ",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="                                          ",ln=1,border=2,align='L',fill='0')
    pdf.set_text_color(0,0,0)
    for i in t:
        pdf.set_font('Arial','',15)
        pdf.cell(w=60,h=10,txt=i.what,ln=1,border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    pdf.set_font('Arial','BU',30)
    pdf.set_text_color(0,0,100)
    pdf.cell(w=60,h=10,txt="Contact Details",ln=1,border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt="",ln=1,border=2,align='L',fill='0')
    pdf.set_text_color(0,0,0)
    pdf.set_font('Arial','',15)
    #pdf.cell(w=40,h=10,txt="Email  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=u[0].email,ln=1,border=2,align='L',fill='0')
    #pdf.cell(w=40,h=10,txt="Address  :",border=2,align='L',fill='0')
    #pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].address+', ',border=2,ln=1,align='L',fill='0')
    #pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].city+', '+r[0].cstate,border=2,ln=1,align='L',fill='0')
    #pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
    #pdf.cell(w=60,h=10,txt=r[0].cstate,border=2,ln=1,align='L',fill='0')
  
    response.headers['Content-Type']='application/pdf'
    return pdf.output(dest="S")
Esempio n. 13
0
def mypdf():
    query=(int)(request.args(0))
    r=db((db.student.student_id==query)).select(db.student.ALL)
    s=db((db.course.student_id==query)).select()
    t=db(db.project.student_id==query).select()
    u=db(db.extra.student_id==query).select()
    a=db(db.institution.student_id==query).select()
    b=db(db.work_expr.student_id==query).select()
    c=db(db.activity.student_id==query).select()
    from gluon.contrib.pyfpdf import FPDF, HTMLMixin
    pdf=FPDF()
    pdf.add_page()
    pdf.set_font('Arial','BU',40)
    #pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
    pdf.set_text_color(100,0,100)
    pdf.cell(w=80,h=30,txt="RESUME",ln=2,border=2,align='L',fill='0')
    pdf.set_text_color(0,0,0)
    pdf.set_font('Arial','BU',30)
    pdf.set_text_color(0,0,100)
    pdf.cell(w=80,h=30,txt="My Details:",ln=1,border=2,align='L',fill='0')
    
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Name  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].name,ln=1,border=2,align='L',fill='0')
    
    str1=str(r[0].age)
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Age :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=str1,ln=1,border=2,align='L',fill='0')
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Gender :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].gender,ln=1,border=2,align='L',fill='0')
    
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Date Of Birth  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=str(r[0].dob),ln=1,border=2,align='L',fill='0')
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Address  :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].address1,ln=1,border=2,align='L',fill='0')
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].address2,ln=1,border=2,align='L',fill='0')
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].address3,ln=1,border=2,align='L',fill='0')
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="Contact",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].contact,ln=1,border=2,align='L',fill='0')
    
    pdf.set_font('Arial','',15)
    pdf.set_text_color(0,0,0)
    pdf.cell(w=60,h=10,txt="E-mail :",border=2,align='L',fill='0')
    pdf.cell(w=60,h=10,txt=r[0].email,ln=1,border=2,align='L',fill='0')
    if len(a):
        pdf.set_text_color(0,0,0)
        pdf.set_font('Arial','BU',30)
        pdf.set_text_color(0,0,100)
        pdf.cell(w=80,h=30,txt="EDUCATION",ln=1,border=2,align='L',fill='0')
        for x in a:
            pdf.set_font('Arial','',15)
            pdf.set_text_color(0,0,0)
            #pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.title,border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.name,ln=1,border=2,align='L',fill='0')
    if len(b):
        pdf.set_text_color(0,0,0)
        pdf.set_font('Arial','BU',30)
        pdf.set_text_color(0,0,100)
        pdf.cell(w=80,h=30,txt="WORK EXPERIENCE",ln=1,border=2,align='L',fill='0')
        pdf.set_font('Arial','',15)
        pdf.set_text_color(0,0,0)
        for x in b:
           
            #pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.name,border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.as_post,border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.type_of,ln=1,border=2,align='L',fill='0')
    if len(s):
        pdf.set_text_color(0,0,0)
        pdf.set_font('Arial','BU',30)
        pdf.set_text_color(0,0,100)
        pdf.cell(w=80,h=30,txt="COURSES TAKEN",ln=1,border=2,align='L',fill='0')
        for x in s:
            pdf.set_font('Arial','',15)
            pdf.set_text_color(0,0,0)
            #pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.name,ln=1,border=2,align='L',fill='0')
    if len(t):
        pdf.set_text_color(0,0,0)
        pdf.set_font('Arial','BU',30)
        pdf.set_text_color(0,0,100)
        pdf.cell(w=80,h=30,txt="PROJECTS DONE",ln=1,border=2,align='L',fill='0')
        pdf.set_font('Arial','',15)
        pdf.set_text_color(0,0,0)
        pdf.cell(w=60,h=10,txt="Project Name:",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="Project Details:",ln=1,border=2,align='L',fill='0')
        for x in t:
            
            #pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.name,border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.detail,ln=1,border=2,align='L',fill='0')
    if len(u):
        pdf.set_text_color(0,0,0)
        pdf.set_font('Arial','BU',30)
        pdf.set_text_color(0,0,100)
        pdf.cell(w=80,h=30,txt="OTHER ACTIVITIES:",ln=1,border=2,align='L',fill='0')
        pdf.set_font('Arial','',15)
        pdf.set_text_color(0,0,0)
        pdf.cell(w=60,h=10,txt="Name:",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="Details:",ln=1,border=2,align='L',fill='0')
        for x in u:
            #pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.title,border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.info,ln=1,border=2,align='L',fill='0')
            
    if len(c):
        pdf.set_text_color(0,0,0)
        pdf.set_font('Arial','BU',30)
        pdf.set_text_color(0,0,100)
        pdf.cell(w=80,h=30,txt="ACHIEVEMENTS",ln=1,border=2,align='L',fill='0')
        pdf.set_font('Arial','',15)
        pdf.set_text_color(0,0,0)
        pdf.cell(w=60,h=10,txt="Name:",border=2,align='L',fill='0')
        pdf.cell(w=60,h=10,txt="Details:",ln=1,border=2,align='L',fill='0')
        for x in c:
            
            #pdf.cell(w=60,h=10,txt=s[0].name :",border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.title,border=2,align='L',fill='0')
            pdf.cell(w=60,h=10,txt=x.detail,ln=1,border=2,align='L',fill='0')

                       
                       
    response.headers['Content-Type']='application/pdf'
    return pdf.output(dest="S")
def get_me_a_pyfpdf():
    title = "This The Doc Title"
    heading = "First Paragraph"
    text = 'bla ' * 10000

    pdf = FPDF()
    pdf.add_page()
    pdf.set_font('Times', 'B', 15)
    pdf.cell(w=210, h=9, txt=title, border=0, ln=1, align='C', fill=0)
    pdf.set_font('Times', 'B', 15)
    pdf.cell(w=0, h=6, txt=heading, border=0, ln=1, align='L', fill=0)
    pdf.set_font('Times', '', 12)
    pdf.multi_cell(w=0, h=5, txt=text)
    response.headers['Content-Type'] = 'application/pdf'
    return pdf.output(dest='S')