Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

495
Views
Agregue una imagen .png a un pdf usando reportlab en Django framework

Estoy usando Django y reportlab para generar un informe en PDF. Ya puedo generar el pdf, pero quería agregarle un logo.png . estas fueron las líneas que agregué

vistas.py :

 from reportlab.platypus import Image logo = Image("/cdss/static/cdss/img/logo.png") exam.append(logo)

Pero no funciona, ¿estoy exportando mal el método Image()? ¿O la ruta al archivo es incorrecta?

Espero que me puedas ayudar, gracias ;)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Esto funcionó para mí....

 def PrintImage(request,std_id): response = HttpResponse(content_type='application/pdf') doc = SimpleDocTemplate(response,topMargin=2) doc.pagesize = landscape(A6) elements = [] I = Image('http://demoschoolzen.educationzen.com/images/tia.png') I.drawHeight = 0.7*inch I.drawWidth = 0.7*inch elements.append(I) doc.build(elements) return response

y llámalo desde tus URL

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!