Flying saucer not picking css and styles for header and footer

528 views
Skip to first unread message

Predrag Popović

unread,
Sep 28, 2016, 1:43:59 PM9/28/16
to Flying Saucer Users
Hi,

I'm using Flying Saucer 9.0.9 in our application. I use velocity template to generate page content.  Then I just set content to renderer :

                ITextRenderer renderer = new ITextRenderer();

                renderer.setDocumentFromString(content); // here goes page content

                renderer.layout();

                renderer.createPDF(os);



But once page is rendered header and footer don't have any style. Neither from my style.css  nor inline styles. Tried putting media = "print" and media = "all" but doesn't work.


In attachment you can see page content


This is from style.css



@page


    @top-right

      content: element(rightHeader) ;

    }

   @top-center

        content: element(centerHeader) ;

    }


    @bottom-center

    content: element(footer) ;

    }

}


#page-thisheader-center {

display : block;

width: 100%;

    position: running(centerHeader);

}


 #page-thisheader-right {

display : block;

width: 100%;

    position: running(rightHeader);

    height: 100px;

    padding-bottom: 10px;


}



Thanks 

Predrag

page-body.html

Olivier Bourgain

unread,
Sep 29, 2016, 11:06:08 AM9/29/16
to flying-sa...@googlegroups.com
Hi,

The HTML file you provided as attachment doesn't contain any reference to the style.css file. 
So it seems normal the CSS in this file is not applied.

And as far as I can see the inline CSS is correcly applied.

Can you provide the exact HTML file you try to transform ?

Best regards.

Olivier Bourgain

--
You received this message because you are subscribed to the Google Groups "Flying Saucer Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flying-saucer-users+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages