【问题标题】:magic space between image in pdfMakepdfMake中图像之间的魔法空间
【发布时间】:2017-02-06 02:59:45
【问题描述】:

当我尝试在 2 个列中定位图像时,它们之间出现了一个空格。

我的文档定义:

var dd = {
    pageSize: 'A4',
    pageOrientation: 'landscape',
    pageMargins: [ 0, 0, 0, 0 ],
    content: [
        {
            columns: [
                {
                    width: 250,
                    alignment: 'left',
                    image: 'sampleImage.jpg',
                    margin: [0,0,0,0]
                },{
                    width: 250,
                    alignment: 'left',
                    image: 'sampleImage.jpg',
                    margin: [0,0,0,0]
                }
            ]
        },
    ],
    defaultStyle: {
        columnGap: 0,
    }
}; 

结果: result

最有趣的是 pdfmake.org/playground 上的结果。没关系。 result2

会发生什么以及如何解决?

【问题讨论】:

    标签: javascript angularjs pdfmake


    【解决方案1】:

    它工作正常,还有我的小提琴, 检查此链接。确保您使用的是最新版本的pdf make,由于在之前版本的pdfmake中检测到一些错误,请尝试使用pdfmake的this version

    var dd = {
        pageSize: 'A4',
        pageOrientation: 'landscape',
        pageMargins: [ 0, 0, 0, 0 ],
        content: [
            {
                columns: [
                    {
                        width: 250,
                        alignment: 'left',
                        image: 'sampleImage.jpg',
                        margin: [0,0,0,0]
                    },{
                        width: 250,
                        alignment: 'left',
                        image: 'sampleImage.jpg',
                        margin: [0,0,0,0]
                    }
                ]
            },
        ],
        defaultStyle: {
            columnGap: 0,
        }
    }; 
    

    这是我的小提琴:

    http://jsfiddle.net/sorb999/yxjzeuos/1/

    【讨论】:

      猜你喜欢
      • 2015-12-17
      • 1970-01-01
      • 2013-09-21
      • 1970-01-01
      • 2017-06-06
      • 2012-05-10
      • 1970-01-01
      • 1970-01-01
      • 2016-01-07
      相关资源
      最近更新 更多