Home Forums Support Add background image to invoice

This topic contains 1 reply, has 2 voices, and was last updated by  Hillel Coren 3 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1943

    timo002
    Participant

    Hello,

    I want to add a background image to the invoice. I checked the pdfmake.org/playground and managed to this:

    var dd = {
        background: [
        {
           image: 'data:image/jpeg;base64,/9j/4RC...image...',
           width: 595
        }
        ],
    	content: [
    		'pdfmake (since it\'s based on pdfkit) supports JPEG and PNG format',
    		
    	],
    }

    But how will I be able to add this to the template?

    I tried this below, but it gives me an error:

    [
      {
        "background": [
          {
            "image": "$accountLogo",
            "width": 300
          }
        ]
      },
      {
        "columns": [
          {
            "image": "$accountLogo",
            "fit": [
              120,
              80
            ]
          },
    ....
    

    Error:

    Uncaught Unrecognized document structure: {“background”:[{“image”:”data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAA2cAAAHdCAYAAACZhQFfAAAgAElEQVR4nOzde5gc

    #1945

    Hillel Coren
    Keymaster

    This isn’t currently supported. The invoice design editor sets the value for the PDF content, however the value for background is set outside of the content value.

    It’d be a good feature, I’ve added it to our roadmap: https://trello.com/c/dUohfkMH

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Posted in: