import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.pdmodel.graphics.state.RenderingMode;
import java.io.*;
PDDocument document = new PDDocument();
PDPage page1 = new PDPage();
document.addPage(page1);
PDPageContentStream stream = new PDPageContentStream(document, page1);
stream.beginText();
stream.setFont(PDType1Font.TIMES_ROMAN, 12);
stream.newLineAtOffset(50, 500);
stream.setRenderingMode(RenderingMode.FILL_STROKE);
Why is TIMES_ROMAN not resolved?
I have tried changing the version I have to before the migration so that I can
follow online tutorials, but that errors and is unable to compile.
I have fiddled with imports, no change.
New contributor
Meghan Lyle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.