bug fix - we must ignore if type does not exist

This commit is contained in:
Jörg Prante 2022-02-01 16:18:09 +01:00
parent 366adee432
commit c1f5ebd409
2 changed files with 5 additions and 2 deletions

View file

@ -57,7 +57,8 @@ public class Engine {
private void executeSettings(Settings settings) throws IOException { private void executeSettings(Settings settings) throws IOException {
String type = settings.get("type"); String type = settings.get("type");
if (type == null) { if (type == null) {
throw new IllegalArgumentException("missing type in " + settings.getAsMap()); // silently ignore
return;
} }
try { try {
String className = packageName + ".command." + type.substring(0, 1).toUpperCase() + type.substring(1) + "Command"; String className = packageName + ".command." + type.substring(0, 1).toUpperCase() + type.substring(1) + "Command";

View file

@ -2,8 +2,10 @@ package org.xbib.graphics.pdfbox.layout.text.annotations;
import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.xbib.graphics.pdfbox.layout.element.render.RenderContext; import org.xbib.graphics.pdfbox.layout.element.render.RenderContext;
import org.xbib.graphics.pdfbox.layout.element.render.RenderListener; import org.xbib.graphics.pdfbox.layout.element.render.RenderListener;
import org.xbib.graphics.pdfbox.layout.element.render.Transform;
import org.xbib.graphics.pdfbox.layout.text.Alignment; import org.xbib.graphics.pdfbox.layout.text.Alignment;
import org.xbib.graphics.pdfbox.layout.text.DrawContext; import org.xbib.graphics.pdfbox.layout.text.DrawContext;
import org.xbib.graphics.pdfbox.layout.text.DrawListener; import org.xbib.graphics.pdfbox.layout.text.DrawListener;
@ -12,7 +14,7 @@ import org.xbib.graphics.pdfbox.layout.position.Position;
/** /**
* This listener has to be passed to all * This listener has to be passed to all
* {@link DrawableText#drawText(org.apache.pdfbox.pdmodel.PDPageContentStream, Position, Alignment, DrawListener) * {@link DrawableText#drawText(PDPageContentStream, Position, Transform, Alignment, DrawListener)}
* draw()} methods, in order collect all annotation metadata. After all drawing * draw()} methods, in order collect all annotation metadata. After all drawing
* is done, you have to call {@link #afterRender()} which creates all * is done, you have to call {@link #afterRender()} which creates all
* necessary annotations and sets them to the corresponding pages. This listener * necessary annotations and sets them to the corresponding pages. This listener