django-easy-pdf
django-easy-pdf copied to clipboard
How can add style??
I added some styles, but I cant' see on pdf
If you are using a template to render your PDF, you have to put your styles in your template after the tag. See the doc here.
Hello, I did that, but I can't see some styles, for example if I added background, I can't see that background on pdf file
Hey Brayan, Can you paste your template code here?
sure, {% extends "easy_pdf/base.html" %} {% block content %}
{% block extra_style %}
{% endblock %}
I tried with this beta code, but I never see changes on pdf
It will be better with
background-color: red;
it's work, but some styles doesn't work for example, margin and padding
I just have tested on my code with a margin-top
and it works.
Can you paste some code?
How can call images on my pdf file?
That happened when I try to call images from static
Invalid block tag on line 106: 'static', expected 'endblock'. Did you forget to register or load this tag?
Can you paste your code?
You can follow my thread about displaying images #48
<img src="{% static "images/img.jpg" %}" alt="">
Did you try:
template.html
<img src="images/img.jpg" />
...assuming you declared a STATIC_ROOT
Yeah, I declared, but with static doesn't work, but if I put that on base template, work, but if I put it inside block does't work, so I decided put on base template and worked it.
You're lucky because I can't display images at all...
amm I also ran python manage.py collectstatic
, maybe lack run this command.
Is it possible put image like background? I tried but I got an error when I did it. Ty
Brayan, how can you put on the base template? I'm trying to put a background-image but I think the url address is wrong