Search in sources :

Example 41 with Paragraph

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"));
}
Also used : SubunidadeDidaticaDTO(com.tomasio.projects.trainning.dto.SubunidadeDidaticaDTO) Section(com.itextpdf.text.Section) Paragraph(com.itextpdf.text.Paragraph)

Example 42 with Paragraph

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;
}
Also used : Chapter(com.itextpdf.text.Chapter) Paragraph(com.itextpdf.text.Paragraph)

Example 43 with Paragraph

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);
}
Also used : Paragraph(com.itextpdf.text.Paragraph)

Example 44 with Paragraph

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;
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) PdfPTable(com.itextpdf.text.pdf.PdfPTable) List(com.itextpdf.text.List) ArrayList(java.util.ArrayList) Phrase(com.itextpdf.text.Phrase) ListItem(com.itextpdf.text.ListItem) Chunk(com.itextpdf.text.Chunk) Paragraph(com.itextpdf.text.Paragraph) ObjetivoDisciplinaDTO(com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO)

Example 45 with Paragraph

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;
}
Also used : PerfilRelacionamentoDTO(com.tomasio.projects.trainning.dto.PerfilRelacionamentoDTO) PdfPCell(com.itextpdf.text.pdf.PdfPCell) PdfPTable(com.itextpdf.text.pdf.PdfPTable) Phrase(com.itextpdf.text.Phrase) Paragraph(com.itextpdf.text.Paragraph)

Aggregations

Paragraph (com.itextpdf.text.Paragraph)67 Chapter (com.itextpdf.text.Chapter)25 PdfPTable (com.itextpdf.text.pdf.PdfPTable)18 Phrase (com.itextpdf.text.Phrase)14 PdfPCell (com.itextpdf.text.pdf.PdfPCell)13 Font (com.itextpdf.text.Font)11 IOException (java.io.IOException)11 DocumentException (com.itextpdf.text.DocumentException)10 Section (com.itextpdf.text.Section)10 Document (com.itextpdf.text.Document)8 ArrayList (java.util.ArrayList)8 ListItem (com.itextpdf.text.ListItem)7 BaseFont (com.itextpdf.text.pdf.BaseFont)7 FileOutputStream (java.io.FileOutputStream)7 List (com.itextpdf.text.List)6 Chunk (com.itextpdf.text.Chunk)5 Image (com.itextpdf.text.Image)5 PdfWriter (com.itextpdf.text.pdf.PdfWriter)5 ObjetivoDisciplinaDTO (com.tomasio.projects.trainning.dto.ObjetivoDisciplinaDTO)5 SubunidadeDidaticaDTO (com.tomasio.projects.trainning.dto.SubunidadeDidaticaDTO)5