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:

@PropertyLayout(fieldSetId = "content", sequence = "1")
public Blob getAttachment() { ... }
The Blob should only ever return a bytes that correspond to a PDF, with 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:

            IsisModuleExtPdfjsWicketUi.class,  (1)
    public class AppManifest {