0

I'm generating an pdf with xhtml2pdf library, and I have a strange situation regarding background image.

Image is displayed but it does not fit the @page, it's setup something like this

    @page {
        size: {% block page_size %}A4 {% endblock %};
                        background: url("{% static 'folder/background.png' %}") no-repeat center center fixed;
                        @frame content_farme {
                            margin-top: 70pt;
                            margin-bottom: 60pt;
                            margin-left: 30pt;
                            margin-right: 30pt;
                            @bottom-right {
                                font-size: 10px;
              margin: 40pt -10pt 0 0;
                    {% block page_foot_extra_styles %}{% endblock %}
                    content: {% block page_foot %}"Page " counter(page) " of " counter(pages){% endblock %};
            }
            @top-left {
                font-size: 10px;
                font-weight: bold;
            {% block page_header_extra_styles %}{% endblock %}
                content: {% block page_head %}{% endblock %};
            }
                        }
        }

I want it to be placed in my @page, I've tried everything, as I understand standard css property are not working like it should, so how can I scale this background in xhtml2pdf there is a nice test file in docs but I didn't find it useful, did someone have this kind off issues, and how did you solved it.

4

1 回答 1

0

在解决这个问题后,我得出结论,这只在 Firefox 上重现(我的版本是 50.1.0),我在多台机器上尝试过同样的事情正在发生,就像背景从 A4 @page、Chrome、Microsoft Edge偏移其余的浏览器都很好,它们不会重现这种错误。

于 2017-01-21T07:01:22.817 回答