diff --git a/frontend/src/styles.scss b/frontend/src/styles.scss index 75c6750..e09409b 100644 --- a/frontend/src/styles.scss +++ b/frontend/src/styles.scss @@ -22,3 +22,7 @@ html { body { padding: 0; } + +img { + max-width: 100% !important; +} diff --git a/samples/entrega-de-trabalho.png b/samples/entrega-de-trabalho.png deleted file mode 100644 index f6e5f61..0000000 Binary files a/samples/entrega-de-trabalho.png and /dev/null differ diff --git a/src/main/java/com/ambientelivre/plugin/service/ProcessDefinitionDocumentationService.java b/src/main/java/com/ambientelivre/plugin/service/ProcessDefinitionDocumentationService.java index 3494554..dd02c40 100644 --- a/src/main/java/com/ambientelivre/plugin/service/ProcessDefinitionDocumentationService.java +++ b/src/main/java/com/ambientelivre/plugin/service/ProcessDefinitionDocumentationService.java @@ -26,8 +26,10 @@ import com.ambientelivre.plugin.dto.ProcessDefinitionDocumentationAuthorizationDto; import com.ambientelivre.plugin.utils.BpmnXmlNamespaceUri; import com.itextpdf.html2pdf.HtmlConverter; +import com.itextpdf.io.font.constants.StandardFonts; import com.itextpdf.io.image.ImageData; import com.itextpdf.io.image.ImageDataFactory; +import com.itextpdf.kernel.font.PdfFontFactory; import com.itextpdf.kernel.pdf.PdfDocument; import com.itextpdf.kernel.pdf.PdfWriter; import com.itextpdf.layout.Document; @@ -35,7 +37,6 @@ import com.itextpdf.layout.element.IElement; import com.itextpdf.layout.element.Image; import com.itextpdf.layout.element.Paragraph; -import com.itextpdf.layout.properties.TextAlignment; import com.itextpdf.layout.properties.UnitValue; public class ProcessDefinitionDocumentationService extends AbstractCockpitPluginResource { @@ -197,18 +198,11 @@ public byte[] generatePdf(ProcessDefinitionDocumentationAuthorizationDto documen Document document = new Document(pdfDoc); try { - document.add(new Paragraph("Portal Documentation") - .setFontSize(18) - .setBold() - .setTextAlignment(TextAlignment.CENTER)); - ProcessDefinitionDocumentation process = documentation.getDefinitionDocumentation().get(0); document.add(new Paragraph("Process: " + process.getName()) .setFontSize(14) .setBold()); - document.add(new Paragraph("Key: " + process.getKey())); - document.add(new Paragraph("Version: " + process.getVersion())); InputStream imageByteInput = getProcessEngine() .getRepositoryService() @@ -224,12 +218,20 @@ public byte[] generatePdf(ProcessDefinitionDocumentationAuthorizationDto documen document.add(image); } + document.add(new Paragraph("Key: " + process.getKey()) + .setFontSize(8) + .setMarginBottom(-2) + .setFont(PdfFontFactory.createFont(StandardFonts.HELVETICA))); + document.add(new Paragraph("Version: " + process.getVersion()) + .setFontSize(8) + .setMarginBottom(-2) + .setFont(PdfFontFactory.createFont(StandardFonts.HELVETICA))); + for (ProcessDefinitionDocumentationElement element : process.getDocumentation()) { - if (element.getName() != null) { - document.add(new Paragraph(element.getName()) - .setFontSize(12) - .setBold()); - } + document.add(new Paragraph( + element.getName() != null ? element.getName() : element.getId()) + .setFontSize(12) + .setBold()); if (element.getDocumentation() != null) { addHtmlContentWithImages(element.getDocumentation(), pdfDoc, document); @@ -238,20 +240,39 @@ public byte[] generatePdf(ProcessDefinitionDocumentationAuthorizationDto documen addHtmlContentWithImages(element.getExtendedDocumentation(), pdfDoc, document); } - document.add(new Paragraph("ID: " + element.getId())); + document.add(new Paragraph("ID: " + element.getId()) + .setFontSize(8) + .setMarginBottom(-2) + .setFont(PdfFontFactory.createFont(StandardFonts.HELVETICA))); if (element.getAssignee() != null) { - document.add(new Paragraph("Assignee: " + element.getAssignee())); + document.add(new Paragraph("Assignee: " + element.getAssignee()) + .setFontSize(8) + .setMarginBottom(-2) + .setFont(PdfFontFactory + .createFont(StandardFonts.HELVETICA))); } if (element.getCandidateGroups() != null) { document.add(new Paragraph( - "Candidate Groups: " + element.getCandidateGroups())); + "Candidate Groups: " + element.getCandidateGroups()) + .setFontSize(8) + .setMarginBottom(-2) + .setFont(PdfFontFactory + .createFont(StandardFonts.HELVETICA))); } if (element.getDueDate() != null) { - document.add(new Paragraph("Due Date: " + element.getDueDate())); + document.add(new Paragraph("Due Date: " + element.getDueDate()) + .setFontSize(8) + .setMarginBottom(-2) + .setFont(PdfFontFactory + .createFont(StandardFonts.HELVETICA))); } if (element.getOrder() != null && element.getOrder() > 0) { - document.add(new Paragraph("Order: " + element.getOrder())); + document.add(new Paragraph("Order: " + element.getOrder()) + .setFontSize(8) + .setMarginBottom(-2) + .setFont(PdfFontFactory + .createFont(StandardFonts.HELVETICA))); } document.add(new Paragraph("\n"));