Removed extra spacing between fields in pdf
This commit is contained in:
@@ -137,6 +137,7 @@ public class PdfDao {
|
|||||||
Map<String, Boolean> stateFieldMap= new HashMap<>();
|
Map<String, Boolean> stateFieldMap= new HashMap<>();
|
||||||
|
|
||||||
Paragraph labelParagraph = new Paragraph(label, labelFont);
|
Paragraph labelParagraph = new Paragraph(label, labelFont);
|
||||||
|
labelParagraph.setSpacingAfter(-10f);
|
||||||
document.add(labelParagraph);
|
document.add(labelParagraph);
|
||||||
float leftMargin = 20f;
|
float leftMargin = 20f;
|
||||||
PdfContentByte canvas = writer.getDirectContent();
|
PdfContentByte canvas = writer.getDirectContent();
|
||||||
@@ -202,7 +203,9 @@ public class PdfDao {
|
|||||||
valueCell.setPaddingLeft(leftMargin); // Increase left margin for value
|
valueCell.setPaddingLeft(leftMargin); // Increase left margin for value
|
||||||
valueCell.setBorder(Rectangle.NO_BORDER); // Remove border for value cell
|
valueCell.setBorder(Rectangle.NO_BORDER); // Remove border for value cell
|
||||||
valueCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
valueCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
|
||||||
valueCell.setHorizontalAlignment(Element.ALIGN_LEFT); valueCell.setCellEvent(new RoundedCorners()); // Apply rounded corners
|
valueCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
||||||
|
valueCell.setCellEvent(new RoundedCorners()); // Apply rounded corners
|
||||||
|
valueTable.setSpacingAfter(-15f);
|
||||||
|
|
||||||
// Add the cell to the table
|
// Add the cell to the table
|
||||||
valueTable.addCell(valueCell);
|
valueTable.addCell(valueCell);
|
||||||
@@ -285,6 +288,7 @@ public class PdfDao {
|
|||||||
valueCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
valueCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
||||||
valueCell.setCellEvent(new RoundedCorners()); // Apply rounded corners
|
valueCell.setCellEvent(new RoundedCorners()); // Apply rounded corners
|
||||||
valueTable.addCell(valueCell);
|
valueTable.addCell(valueCell);
|
||||||
|
valueTable.setSpacingAfter(-15f);
|
||||||
document.add(valueTable);
|
document.add(valueTable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -541,6 +545,8 @@ public class PdfDao {
|
|||||||
labelCell.setBorder(Rectangle.NO_BORDER);
|
labelCell.setBorder(Rectangle.NO_BORDER);
|
||||||
labelCell.setGrayFill(7);
|
labelCell.setGrayFill(7);
|
||||||
labelCell.setPadding(5);
|
labelCell.setPadding(5);
|
||||||
|
labelParagraph.setSpacingAfter(-10f);
|
||||||
|
|
||||||
|
|
||||||
// Create a PdfPTable with 1 column and add the PdfPCell to it
|
// Create a PdfPTable with 1 column and add the PdfPCell to it
|
||||||
PdfPTable table = new PdfPTable(1);
|
PdfPTable table = new PdfPTable(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user