Styling not applying in PDF

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Styling not applying in PDF

bwallis42
I don't seem to be able to style anything in an autogenerated PDF file. This
worked in version 3.9 after some fiddling about with the css selectors but
in 2017.2 I can't get any formatting to come through into the PDF.

I have tried many variations of selectors and can get what I want on the
screen. I tried these both in and out of an @media print block as well but
nothing seems to affect the generated PDF.

Is there something special I need to do to get this working in the PDF? Our
customers want their font colors and font style changes in their printed
documents.

The documentation at https://doc.orbeon.com/form-runner/styling/css.html
doesn't mention embedded css in the form template for this, it just gives
the example of using oxf.fr.css.custom.uri. Should embedded css also work
for PDF?

thanks
brian...


--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Styling not applying in PDF

Erik Bruchez
Administrator
Brian,

I do manage to get it to work with inline styles, but often I have to add
`!important` to the CSS rules. For example:

    <xh:style type="text/css">
        @media print {
            .orbeon .xforms-input .xforms-field {
                background-color: red !important
            }
        }
    </xh:style>

I hope this helps,

-Erik

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Styling not applying in PDF

bwallis42
Hi Eric,
  Yes it does. Thanks. Selectors are often a pain, I should have tried
important (but I try to avoid using it if I can)

brian...


--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Styling not applying in PDF

Erik Bruchez
Administrator
Agreed, `!important` is discouraged. With the PDF engine we are using,
however, it is often necessary for some reason.

-Erik

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].