# File app/controllers/attendance_adm_controller.rb, line 199
  def certificate_pdf_for(people, fmt, with_boxes=false)
    pdf = PDF::Writer.new(:orientation => fmt.orientation.to_sym,
                          :paper => fmt.paper_size)
    pdf.stroke_color(Color::RGB::Black) 
    
    people.each do |person|
      fmt.certif_format_lines.each do |line|
        ### PDF::Writer does not currently (as of version 1.1.7) support
        ### UTF8... Sorry, we will lose on some charsets :-/ At least,
        ### Iconv is in the standard Ruby library
        pdf_draw_field_box(pdf, line) if with_boxes

        pdf.add_text_wrap(line.x_pos, line.y_pos, line.max_width,
                          Iconv.conv('ISO-8859-15', 'UTF-8',
                                     line.text_for(person, @conference)), 
                          line.font_size, line.justification.to_sym)
      end
      pdf.start_new_page unless person == people.last
    end

    return pdf.render
  end