The PDF.js module integrates with the Wicket Viewer, rendering a Blob property containing a PDF using the PDF.js library.


To use the extension, annotate an Blob property with the @PdfJsViewer annotation.

For example:

@PdfJsViewer            (1)
@PropertyLayout(fieldSetId = "content", sequence = "1")
public Blob getAttachment() { ... }
1 indicates that the Blob returns a set of bytes that correspond to a PDF, and so should be rendered as such.
The Blob is expected also to have a mime type of application/pdf.

Optionally, you can also provide an implementation of the PdfJsViewerAdvisor SPI, which advises on the size of the viewer (and has callbacks to keep track of which page of the PDF is being viewed). The framework provides a fallback implementation that sets the height to 800px, and scaled to 75% normal size.


Make the following changes:

  • In your domain module (containing the domain class that has a Blob PDF type), add in the following dependency:


    This will provide access to the @PdfJsViewer annotation.

  • And, in the webapp module, add the following dependency:

  • In your AppManifest:

            CausewayModuleExtPdfjsWicketUi.class,  (1)
    public class AppManifest {