1

I'm using PrinceXML and Django Templates to generate a PDF. I'm able to set the content of a url but unable to set a string for the bottom left

@media print{
  @page { 
    @bottom-right {
      /* works */
      content: url({{ user.logo }})
    }
    @bottom-left {
      /* doesn't work */
      content: {{ user.uuid }};
    }
  }
}

Do you have to set the content differently for a string?

user2954587
  • 4,661
  • 6
  • 43
  • 101

1 Answers1

1

Put the template variable between double quotes like this :

content: "{{ user.uuid }}";

Django will only replace the template variable by its value. So if for example you have :

user.uuid = "My unique id"

Then

content: {{ user.uuid }};

will become

content: My unique id;

Which will not be interpreted as a string by PrinceXML

Laurent
  • 1,710
  • 4
  • 25
  • 46