Skip to content

External CSS and @media print #17

@lisamarie2000

Description

@lisamarie2000

Hello Ray,

First of all, good work!

I have some questions: Is it possible to use external style sheets? I am using ZF2 and was trying to set a basePath to use my stylesheets, but it doesn´t work. My stylesheets which I am using (embedded in an extra layout.phtml) do not show up or seem to have an effect on the pdf.

What should be exactly in the basePath? While having a normal Zend Framework 2 Skeleton Application? I tried it with $model->setOption('basePath', '/public/'), as my path in the layout.phtml is ...->appendStylesheet($this->basePath() . '/css/main.css'), but it is not working.

And another issue, is it possible to use @media print with the DOMPDFModule? I tried it inline with @media print { h1 { color: indianred; }}, but no success. It only takes affect when saving the pdf manually via the browser ("Print"/...), but not in the generated PDF from the module.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions