Salut Comment pouvons-nous redimensionner l'image dans iText 7. Je n'arrive pas à trouver PDFTemplate dans itext 7 maintenant qui recadrait l'image. .Itext7 - Recadrer l'image
public Image cropImage(PdfWriter writer, Image image, float leftReduction, float rightReduction, float topReduction, float bottomReduction) throws DocumentException {
float width = image.getScaledWidth();
float height = image.getScaledHeight();
PdfTemplate template = writer.getDirectContent().createTemplate(
width - leftReduction - rightReduction,
height - topReduction - bottomReduction);
template.addImage(image,
width, 0, 0,
height, -leftReduction, -bottomReduction);
return Image.getInstance(template);
}
Il est utilisé pour itext 5
Merci laissez-moi vérifier :) –
a également accepté celui-ci :) –