Closed fcorneli closed 3 years ago
If I do something quick-and-dirty like:
diff --git a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/LayoutContext.java b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/LayoutContext.java
index 990f1c10..d2d4bc0d 100644
--- a/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/LayoutContext.java
+++ b/openhtmltopdf-core/src/main/java/com/openhtmltopdf/layout/LayoutContext.java
@@ -51,6 +51,7 @@ import com.openhtmltopdf.render.FSFont;
import com.openhtmltopdf.render.FSFontMetrics;
import com.openhtmltopdf.render.MarkerData;
import com.openhtmltopdf.render.PageBox;
+import java.util.NoSuchElementException;
/**
* This class tracks state which changes over the course of a layout run.
@@ -303,7 +304,11 @@ public class LayoutContext implements CssContext {
}
public void translate(int x, int y) {
- getBlockFormattingContext().translate(x, y);
+ try {
+ getBlockFormattingContext().translate(x, y);
+ } catch (NoSuchElementException e) {
+
+ }
}
/* code to keep track of all of the id'd boxes */
it no longer fails of course, but I don't see my page footer anymore.
Hi @fcorneli,
It turns out that the layout for table boxes was not aware of stacking context layers or block formatting contexts (both required for position: absolute
). I have now fixed. In the meantime, you can use a surrounding div with the position: absolute
style rather than putting that style directly on the table.
Thanks for reporting.
On one of our templates, we could trigger the following exception: