Package com.openhtmltopdf.context
Class ContentFunctionFactory.FsIfCutOffFunction
java.lang.Object
com.openhtmltopdf.context.ContentFunctionFactory.FsIfCutOffFunction
- All Implemented Interfaces:
ContentFunction
- Enclosing class:
ContentFunctionFactory
private static class ContentFunctionFactory.FsIfCutOffFunction
extends Object
implements ContentFunction
Content function which returns its argument if on a cut off page, else the empty string.
Example:
content: "Page " counter(page) -fs-if-cut-off(" continued") " of " counter(pages);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculate
(LayoutContext c, FSFunction function) calculate
(RenderingContext c, FSFunction function, InlineText text) boolean
canHandle
(LayoutContext c, FSFunction function) If a function value can change at render time (i.e.boolean
isStatic()
Whether or not the function value can change at render time.
-
Constructor Details
-
FsIfCutOffFunction
private FsIfCutOffFunction()
-
-
Method Details
-
isStatic
public boolean isStatic()Description copied from interface:ContentFunction
Whether or not the function value can change at render time. If true,ContentFunction.calculate(LayoutContext, FSFunction)
will be called. If false,ContentFunction.calculate(RenderingContext, FSFunction, InlineText)
will be called.- Specified by:
isStatic
in interfaceContentFunction
-
calculate
- Specified by:
calculate
in interfaceContentFunction
-
calculate
- Specified by:
calculate
in interfaceContentFunction
-
getLayoutReplacementText
Description copied from interface:ContentFunction
If a function value can change at render time (i.e.ContentFunction.isStatic()
returns false) use this text as an approximation at layout.- Specified by:
getLayoutReplacementText
in interfaceContentFunction
-
canHandle
- Specified by:
canHandle
in interfaceContentFunction
-