
org.hcl.pdftemplate.part.PdfImage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdftemplate Show documentation
Show all versions of pdftemplate Show documentation
Tools for adding text and images to pdfs
package org.hcl.pdftemplate.part;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
import org.hcl.pdftemplate.BiFunctionWithException;
import org.hcl.pdftemplate.IPdfPrinter;
@RequiredArgsConstructor
@EqualsAndHashCode
@Getter
@ToString
public class PdfImage implements IPdfPart {
private final float x;
private final float y;
private final int pageNo;
private final BiFunctionWithException image;
@Override
public void print(IPdfPrinter printer, PDPageContentStream stream, Data data) throws Exception {
printer.printImage(stream, data, this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy