Resize logo
This commit is contained in:
@@ -94,7 +94,7 @@ public class PdfDao {
|
||||
}
|
||||
// pageEvent.setTotalPages(writer.getPageNumber());
|
||||
// addLogo(document, "logo.jpg"); // Add your image path here the migration code after cherry-pick
|
||||
addLogo(document, logoUrl);
|
||||
addLogo(document, logoUrl,applicationEntity);
|
||||
|
||||
|
||||
BaseColor customColor = new BaseColor(0, 128, 0); // Adjust RGB values as needed
|
||||
@@ -672,10 +672,15 @@ public class PdfDao {
|
||||
return valueToFind;
|
||||
}
|
||||
|
||||
public void addLogo(Document document, String logoPath) throws Exception {
|
||||
public void addLogo(Document document, String logoPath,ApplicationEntity applicationEntity) throws Exception {
|
||||
Image logo = Image.getInstance(logoPath);
|
||||
logo.scaleToFit(document.getPageSize().getWidth() - document.leftMargin() - document.rightMargin(), // Fit to document width
|
||||
document.getPageSize().getHeight() / 4); // Adjust the height as needed (1/4th of the page height)
|
||||
if (Boolean.TRUE.equals(validator.isProductionProfileActivated()) && applicationEntity.getCall().getId().equals(23l)) {
|
||||
logo.scaleToFit(120, 60);
|
||||
}
|
||||
else {
|
||||
logo.scaleToFit(document.getPageSize().getWidth() - document.leftMargin() - document.rightMargin(), // Fit to document width
|
||||
document.getPageSize().getHeight() / 4); // Adjust the height as needed (1/4th of the page height)
|
||||
}
|
||||
logo.setAlignment(Image.ALIGN_CENTER); // Align logo to center
|
||||
document.add(logo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user