【问题标题】:PDFMake how to put text over an imagePDFMake如何在图像上放置文本
【发布时间】:2017-03-09 19:52:50
【问题描述】:

我正在努力尝试使用 PDFmake 将文本放在图像上,我正在使用 PDFMAKE 游乐场图像演示

var dd = {
    content: [
                {
                 stack:[    
                         {
                             text:'pdfmake (since it\'s based on pdfkit)     supports JPEG and PNG format',
                             color:'#333',
                             fontSize: 17
                        },    
                        {
                            image: 'sampleImage.jpg',
                        }
                    ]

                }
    ]
} 

有什么办法可以实现吗?

【问题讨论】:

    标签: javascript pdfkit pdfmake


    【解决方案1】:

    重复问题:Embedding a background image in pdfmake

    把图片放在背景中

    var dd = {
    
      pageSize: 'LETTER',
      background: [
       {
           image: 'sample.jpg',
           width: 792
       }
      ],
      content: [
         'text'
      ]
    

    【讨论】:

    • 这真的不是一个好的答案,因为这会将它嵌入到每个页面中。
    猜你喜欢
    • 2015-01-05
    • 2014-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-11
    • 2023-03-25
    • 1970-01-01
    相关资源
    最近更新 更多