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

CSS and Images no longer working #3525

Open
Roxeen12 opened this issue Sep 13, 2024 · 7 comments
Open

CSS and Images no longer working #3525

Roxeen12 opened this issue Sep 13, 2024 · 7 comments
Labels

Comments

@Roxeen12
Copy link

Roxeen12 commented Sep 13, 2024

Hi there!

I'm using this package with laravel modules and the CSS and the external images are no longer working.

Everything works on my local environment as it should, but on the server, the style is no longer applied in the PDF.

This is how i am importing the CSS:

{{ module_vite('build-eventpage', 'resources/assets/sass/app.scss') }}

and this is how i am using the images:

<img src="https://images.domain.com/domain-logo-orange.svg" alt="logo" class="logo__image">

It's weird because on my staging server the CSS is working but the images are not, and on the production nothing is working anymore.

Is something blocking the images to be rendered and the CSS to be applied?

Thank you!

Production:
CleanShot 2024-09-13 at 12 54 12@2x

Staging:
CleanShot 2024-09-13 at 12 55 06@2x

Local:
CleanShot 2024-09-13 at 12 55 29@2x

@bsweeney
Copy link
Member

How are you loading your document into Dompdf? Are paths correct for local vs production systems? Are remote resources allowed via your configuration?

I don't use laravel but it looks like the DEV URLs generated by vite may differ from the production URLs.

@Roxeen12
Copy link
Author

Hi @bsweeney! Sorry for the miscommunication, i am using laravel-dompdf, which is a wrapper of this package.

@bsweeney
Copy link
Member

I understand you're using laravel-dompdf, I just don't have a test environment where I can check things since I do not use laravel. My questions are still relevant, particularly with regard to vite. If you're using a DEV configuration locally that may be the reason it's rendering as expected in that environment.

@maschenborn
Copy link

images and css stopped working for me as well - but only if request contains https.
Requested with http they still work.

@bsweeney
Copy link
Member

@maschenborn you might try enabling additional debug messaging to see if something helpful is surfaced.

@techtuneitbackenddev
Copy link

$pdf->setOption(['isRemoteEnabled' => true]);
is work for me

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

No branches or pull requests

5 participants