@Override
    public void createLayout(Dimension dim, Rectangle visibleRect)
    {
        if (pdfdocument != null) //PDF mode: create the layout only when the DOM tree is already finished
        {
            if (pdfLoaded)
                createPdfLayout(dim);
        }
        else //DOM mode
        {
        	if (root != null)
        		super.createLayout(dim, visibleRect);
        }
    }
@ Override public void createLayout ( Dimension dim , Rectangle visibleRect ) { if ( pdfdocument != null ) { if ( pdfLoaded ) createPdfLayout ( dim ) ; } else { if ( root != null ) super . createLayout ( dim , visibleRect ) ; } }
===========================================================================================