use of com.itextpdf.text.Paragraph in project trainning by fernandotomasio.
the class DOC003PDF method buildSection.
private void buildSection(Chapter ch, SecaoApostilaDTO secao, XMLParser p, Document document) throws IOException, DocumentException {
SubunidadeDidaticaDTO subunidade = teachingDocumentsService.findSubunidadeDidatica(secao.getSubunidadeDidatica().getId());
String secaoLabel = "SUBUNIDADE " + subunidade.getNumeroGeral() + ": " + secao.getSubunidadeDidatica().getDescricao();
if (secao.getContent() != null) {
this.sectionContent.add(secao.getContent());
}
Paragraph secaoParagraph = new Paragraph(secaoLabel, fontManager.getH1Font());
Section section = ch.addSection(secaoParagraph);
section.setNumberDepth(0);
buildFolhaRostoSecao(section, secao);
// p.append(secao.getContent());
// p.parse(new StringReader(secao.getContent()));
// section.add(new Paragraph("section " + secao.getContent()));
// document.add(new Paragraph("repositioning"));
}
use of com.itextpdf.text.Paragraph in project trainning by fernandotomasio.
the class DOC003PDF method buildSumario.
private Chapter buildSumario(ArrayList<Paragraph> titles) throws DocumentException {
Paragraph p = new Paragraph("SUMÁRIO", fontManager.getBoldFont());
p.setAlignment(Element.ALIGN_CENTER);
Chapter ch = new Chapter(p, 0);
ch.setNumberDepth(0);
ch.add(Chunk.NEWLINE);
for (Paragraph title : titles) {
ch.add(title);
}
return ch;
}
use of com.itextpdf.text.Paragraph in project trainning by fernandotomasio.
the class DOC003PDF method buildCover.
private void buildCover(Document document, CurriculoMinimoDTO curriculo, ApostilaDTO apostila) throws DocumentException {
Paragraph p13 = new Paragraph("");
document.add(p13);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
document.add(Chunk.NEWLINE);
String cursoLabel = "CURSO " + curriculo.getCurso().getCodigo();
Paragraph cursoParagraph = new Paragraph(cursoLabel, fontManager.getH1Font());
cursoParagraph.setAlignment(Element.ALIGN_CENTER);
document.add(cursoParagraph);
String numeroDisciplina = "DISCIPLINA " + apostila.getDisciplina().getNumeroDisciplina();
Paragraph numeroDisicplinaParagraph = new Paragraph(numeroDisciplina, fontManager.getH1Font());
numeroDisicplinaParagraph.setAlignment(Element.ALIGN_CENTER);
document.add(numeroDisicplinaParagraph);
String disciplinaLabel = "APOSTILA DE " + apostila.getDisciplina().getDescricao().toUpperCase();
Paragraph disciplinaParagraph = new Paragraph(disciplinaLabel, fontManager.getH1Font());
disciplinaParagraph.setAlignment(Element.ALIGN_CENTER);
document.add(disciplinaParagraph);
document.add(Chunk.NEXTPAGE);
document.add(Chunk.NEXTPAGE);
}
use of com.itextpdf.text.Paragraph in project trainning by fernandotomasio.
the class DOC002PDF method buildTableDisciplina.
private PdfPTable buildTableDisciplina(DisciplinaDTO disciplina) throws DocumentException {
PdfPTable table = new PdfPTable(6);
table.setWidthPercentage(100);
// table.setWidths(new int[]{2, 1, 1});
PdfPCell cellCampo;
Phrase phraseCampo = new Phrase();
phraseCampo.add(new Chunk("CAMPO: ", fontManager.getBoldFont()));
phraseCampo.add(new Chunk("TÉCNICO-ESPECIALIZADO", fontManager.getDefaultFont()));
cellCampo = new PdfPCell(phraseCampo);
cellCampo.setColspan(3);
cellCampo.setPadding(10);
table.addCell(cellCampo);
PdfPCell cellArea;
Phrase phraseArea = new Phrase();
phraseArea.add(new Chunk("ÁREA: ", fontManager.getBoldFont()));
phraseArea.add(new Chunk("SISTEMAS AEROESPACIAIS", fontManager.getDefaultFont()));
cellArea = new PdfPCell(phraseArea);
cellArea.setColspan(3);
cellArea.setPadding(10);
table.addCell(cellArea);
PdfPCell cellDescricao;
Phrase phraseDescricao = new Phrase();
phraseDescricao.add(new Chunk("DISCIPLINA " + disciplina.getNumeroDisciplina() + ": ", fontManager.getBoldFont()));
phraseDescricao.add(new Chunk(disciplina.getDescricao().toUpperCase(), fontManager.getDefaultFont()));
cellDescricao = new PdfPCell(phraseDescricao);
cellDescricao.setColspan(6);
cellDescricao.setPadding(10);
table.addCell(cellDescricao);
PdfPCell cellCHInstrucao;
Phrase phraseCHInstrucao = new Phrase();
phraseCHInstrucao.add(new Chunk("CH INSTRUÇÃO: ", fontManager.getBoldFont()));
phraseCHInstrucao.add(new Chunk(disciplina.getQuantidadeTemposAula() + " tempo(s)", fontManager.getDefaultFont()));
cellCHInstrucao = new PdfPCell(phraseCHInstrucao);
cellCHInstrucao.setColspan(2);
cellCHInstrucao.setPadding(10);
table.addCell(cellCHInstrucao);
PdfPCell cellCHAvaliacao;
Phrase phraseCHAvaliacao = new Phrase();
phraseCHAvaliacao.add(new Chunk("CH AVALIAÇÃO: ", fontManager.getBoldFont()));
phraseCHAvaliacao.add(new Chunk(disciplina.getQuantidadeTemposAvaliacao() + " tempo(s)", fontManager.getDefaultFont()));
cellCHAvaliacao = new PdfPCell(phraseCHAvaliacao);
cellCHAvaliacao.setColspan(2);
cellCHAvaliacao.setPadding(10);
table.addCell(cellCHAvaliacao);
PdfPCell cellCHTotal;
Phrase phraseCHTotal = new Phrase();
int quantidadeTempoTotal = disciplina.getQuantidadeTemposAula() + disciplina.getQuantidadeTemposAvaliacao();
phraseCHTotal.add(new Chunk("CH TOTAL: ", fontManager.getBoldFont()));
phraseCHTotal.add(new Chunk(quantidadeTempoTotal + " tempo(s)", fontManager.getDefaultFont()));
cellCHTotal = new PdfPCell(phraseCHTotal);
cellCHTotal.setColspan(2);
cellCHTotal.setPadding(10);
table.addCell(cellCHTotal);
PdfPCell cellObjetivos;
Paragraph objetivosHead = new Paragraph("OBJETIVOS ESPECÍFICOS: ", fontManager.getBoldFont());
ObjetivoDisciplinaDTO[] objetivosDisciplina = teachingDocumentsService.findAllObjetivosDisciplinas(disciplina.getId());
// Paragraph objetivos = new Paragraph("asdfasdfasdfasdf", fontManager.getDefaultFont());
cellObjetivos = new PdfPCell();
cellObjetivos.addElement(objetivosHead);
List objetivosList = new List(List.ORDERED, List.ALPHABETICAL);
objetivosList.setLowercase(true);
for (ObjetivoDisciplinaDTO objetivoDisciplina : objetivosDisciplina) {
ListItem item = new ListItem(objetivoDisciplina.getDescricao() + " (" + objetivoDisciplina.getNivelAprendizagem().getCodigo() + ")", fontManager.getDefaultFont());
objetivosList.add(item);
}
cellObjetivos.addElement(objetivosList);
cellObjetivos.setColspan(6);
cellObjetivos.setPadding(10);
table.addCell(cellObjetivos);
return table;
}
use of com.itextpdf.text.Paragraph in project trainning by fernandotomasio.
the class DOC002PDF method buildTablePerfisRelacionamento.
private PdfPTable buildTablePerfisRelacionamento(DisciplinaDTO disciplina) {
PdfPTable table = new PdfPTable(1);
table.setWidthPercentage(100);
PdfPCell cellHeader;
cellHeader = new PdfPCell(new Phrase("PERFIL DE RELACIONAMENTO", fontManager.getBoldFont()));
cellHeader.setPadding(10);
table.addCell(cellHeader);
PdfPCell cellContent;
cellContent = new PdfPCell();
PerfilRelacionamentoDTO[] perfis = teachingDocumentsService.findAllPerfisRelacionamentoByDisciplina(disciplina.getId());
for (PerfilRelacionamentoDTO perfilRelacionamento : perfis) {
Paragraph perfil = new Paragraph(perfilRelacionamento.getTexto(), fontManager.getDefaultFont());
cellContent.addElement(perfil);
}
cellContent.setPadding(10);
table.addCell(cellContent);
return table;
}
Aggregations