Css,图像在pdf文件的背景中 [英] Css, image in background for a pdf file

查看:85
本文介绍了Css,图像在pdf文件的背景中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我正在寻找一个在pdf文件背面获取图像(背景)的解决方案。



对于我的项目,我将页面的一部分打印到Dymo打印机上,以便为访问者打印卡片。在我使用我的所有Dymo卡之前,如果我可以使用print to pdf测试所有内容,那就太好了。直到现在我有问题这个我的打印看起来像这样:



HTML查看:http://prntscr.com/kpwmyh

PDF查看:http://prntscr.com/kpwn2v



请指教



我是什么尝试过:



这是我的代码;



Hi there,

I'm looking for a solution to get an image (background) in the back of a pdf file.

For my project I'm printing a part of a page to a Dymo printer to print cards for visitors. Before I use all of my Dymo cards it would be nice if I can test everything with print to pdf. Till now I have problems with this my print looks like this:

HTML view: http://prntscr.com/kpwmyh
PDF view: http://prntscr.com/kpwn2v

Please advise

What I have tried:

This is my code;

.card:hover {
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
.container {
    padding: 2px 16px; 
}
.body {
width: 1000px; 
}

@media print {
    body:after {
        content: url(../images/QRCard1.png);
    } 
}

@page {
    size:A4 landscape;
    margin-left: 0px;
    margin-right: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    margin: 0;
    -webkit-print-color-adjust: exact;
}

@media screen and (min-width: 480px) {
    .card {
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    transition: 0.3s;
    width: 600px;
    height: 300px;
    background-image: url("../images/QRCard1.png");
}

推荐答案

我不会去你的链接,但有一个为您的打印设置(1)打印背景图像,或(2)不打印。



(2)可以节省大量墨水,并且经常默认设置。



检查系统的打印机设置。
I'll not go to your links, but there is a setting for your printing that either (1) prints the background image, or (2) doesn't.

(2) can save a lot of ink and is often the default setting.

Check your system's printer settings.


这篇关于Css,图像在pdf文件的背景中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆