Esempio n. 1
0
 def render(self, context):
     document = Variable(self.document).resolve(context)
     arguments, warnings = calculate_converter_arguments(document, size=PRINT_SIZE, quality=QUALITY_PRINT)
     width, height = get_document_dimensions(document, **arguments)
     context[u'document_width'], context['document_height'] = width, height
     context[u'document_aspect'] = float(width) / float(height)
     return u''
Esempio n. 2
0
 def render(self, context):
     document = Variable(self.document).resolve(context)
     width, height = get_document_dimensions(document)
     context[u"document_width"], context["document_height"] = width, height
     context[u"document_aspect"] = float(width) / float(height)
     return u""