Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Link of Style Sheet #24

Closed
JohnDotOwl opened this issue Feb 6, 2014 · 6 comments
Closed

Adding Link of Style Sheet #24

JohnDotOwl opened this issue Feb 6, 2014 · 6 comments

Comments

@JohnDotOwl
Copy link

Is it possible for me to attach the link of style sheet and use the CSS accordingly in HTML. Will it be able to still generate a PDF properly?

Thanks!

@barryvdh
Copy link
Owner

barryvdh commented Feb 6, 2014

I think so. Did you try?
Op 6 feb. 2014 02:40 schreef "RainbowHat" notifications@github.com:

Is it possible for me to attach the link of style sheet and use the CSS
accordingly in HTML. Will it be able to still generate a PDF properly?

Thanks!

Reply to this email directly or view it on GitHubhttps://github.com//issues/24
.

@jonlambert
Copy link

Tried this - I'm attempting to load fonts into the PDF.

    <header>
        <link href='http://fonts.googleapis.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
        <style>
            body {
                font-family: 'Exo 2';
            }    
        </style>

    </header>
    <body style="">
        <h1 style="border-bottom: 1px solid #999;">Foo</h1>
    </body>

No such luck. The page takes 20+ seconds to load, and doesn't seem to include the stylesheet...

@barryvdh
Copy link
Owner

I tried this example: https://github.com/dompdf/dompdf/blob/master/www/test/css_at_font_face.html
This works for me. Be sure to update to the latest (stable) version.
A patch has recently landed for the fonts cache/dir, so make sure to create app/storage/fonts directory and make it writable.

@barryvdh
Copy link
Owner

Also you have

instead of and missing the html tag. I would suggest trying that example as the basis and see where it get's you.
Also, this is a dompdf issue, so you might want to try upstream if you still have problems: https://github.com/dompdf/dompdf/issues

@jonlambert
Copy link

Thanks for the advice - the markup in the link above worked fine after updating, but not when using a different font. I've opened an issue at dompdf/dompdf as you advised.

dompdf/dompdf#784

Thanks!

@barryvdh
Copy link
Owner

The issue has been recognized and a workaround is provided in the linked issue, so closing this issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants