if(isSimpleCertifyd){
JRPrintPage page = new JRBasePrintPage();
JRPrintText text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText("Certificamos que "+genderChar+" alun"+genderChar);
text.setX(convert(20));
text.setY(convert(65) + 10);
text.setWidth(730);
text.setHeight(27);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(bodyStyle);
page.addElement(text);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText(person.getName());
text.setX(convert(20));
text.setY(convert(65) + 43);
text.setWidth(730);
text.setHeight(53);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(nameStyle);
page.addElement(text);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText("concluiu o programa de cursos OPERADOR DE COMPUTADOR e est� apto para ocupar e exercer atividades relacionadas aos treinamentos descritos abaixo:");
text.setX(convert(20));
text.setY(convert(65) + 120);
text.setWidth(730);
text.setHeight(65);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(bodyStyle);
page.addElement(text);
String listCourses = "";
for (int i = 0; i < courses.size(); i++) {
system.execute(new SetCourseAsPrinted(registration, courses.get(i)));
listCourses += courses.get(i);
if(i != courses.size() - 1) {
listCourses += ", ";
}
}
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText(listCourses);
text.setX(convert(20));
text.setY(convert(65) + 210);
text.setWidth(730);
text.setHeight(75);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(boldStyle);
page.addElement(text);
jasperPrint.addPage(page);
}
else {
JRPrintPage page = new JRBasePrintPage();
JRPrintText text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText(person.getName());
text.setX(convert(20));
text.setY(convert(45) + 6);
text.setWidth(730);
text.setHeight(53);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(nameStyle);
page.addElement(text);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText("Certificamos que o aluno acima descrito, concluiu e alcan�ou \no mais alto grau de Qualifica��o Profissional durante o Programa de cursos:");
text.setX(convert(20));
text.setY(convert(45) + 63);
text.setWidth(730);
text.setHeight(63);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(bodyStyle);
page.addElement(text);
JRPrintRectangle rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
rectangle.setX(convert(20)+65);
rectangle.setY(convert(45)+130);
rectangle.setWidth(600);
rectangle.setHeight(62);
page.addElement(rectangle);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText("T�cnico de Computa��o Junior");
text.setX(convert(20));
text.setY(convert(45) + 132);
text.setWidth(730);
text.setHeight(62);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(titleStyle);
page.addElement(text);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText("M�dulo Profissionalizante");
text.setX(convert(20));
text.setY(convert(45) + 166);
text.setWidth(730);
text.setHeight(24);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(bodyStyle);
page.addElement(text);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText("Estando apto � ocupar e exercer atividades relacionadas aos seguintes treinamentos:");
text.setX(convert(20));
text.setY(convert(45) + 200);
text.setWidth(730);
text.setHeight(23);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(bodyStyle);
page.addElement(text);
String listCourses = "";
for (int i = 0; i < courses.size(); i++) {
listCourses += courses.get(i);
if(i != courses.size() - 1) {
listCourses += ", ";
}
}
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText(listCourses);
text.setX(convert(20));
text.setY(convert(45) + 232);
text.setWidth(730);
text.setHeight(65);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(boldStyle);
page.addElement(text);
jasperPrint.addPage(page);
}
} catch (Exception e) {