@@ -422,7 +422,7 @@ def sha256_hash(data):
422422 hex_dig = hash_object .hexdigest ()
423423 return hex_dig
424424
425- def generate_pdf_template (template_name , fields , target = None , css_string = None ):
425+ def generate_pdf_template (template_name , fields , target = None , css_string = None , markdown_css = "markdown6.css" ):
426426 template = facturacion_environment .get_template (template_name )
427427 md5_document = template .render (
428428 fields
@@ -442,7 +442,7 @@ def generate_pdf_template(template_name, fields, target=None, css_string=None):
442442 pdf = HTML (string = html ).write_pdf (
443443 target = target ,
444444 stylesheets = [
445- os .path .join (SOURCE_DIRECTORY , "markdown_styles" , "markdown6.css" ),
445+ os .path .join (SOURCE_DIRECTORY , "markdown_styles" , markdown_css ),
446446 CSS (
447447 string = css_string or '@page { width: Letter; margin: 1.6cm 1.6cm 1.6cm 1.6cm; }'
448448 ),
@@ -454,22 +454,22 @@ def generate_pdf_template(template_name, fields, target=None, css_string=None):
454454 with open (target + ".sha1_" + hex_dig [- 8 :] + ".txt" , "w" ) as f :
455455 f .write (md5_document )
456456
457- def generate_pdf_template_basic (template_name , fields , target = None , css_string = None ):
458- template = facturacion_environment .get_template (template_name )
459- md5_document = template .render (
460- fields
461- )
462-
463- html = markdown (md5_document )
464- pdf = HTML (string = html ).write_pdf (
465- target = target ,
466- stylesheets = [
467- os .path .join (SOURCE_DIRECTORY , "markdown_styles" , "markdown6_nopage.css" ),
468- CSS (
469- string = css_string
470- )
471- ]
472- )
457+ # def generate_pdf_template_basic(template_name, fields, target=None, css_string=None):
458+ # template = facturacion_environment.get_template(template_name)
459+ # md5_document = template.render(
460+ # fields
461+ # )
462+ #
463+ # html = markdown(md5_document)
464+ # pdf = HTML(string=html).write_pdf(
465+ # target=target,
466+ # stylesheets=[
467+ # os.path.join(SOURCE_DIRECTORY, "markdown_styles", "markdown6_nopage.css"),
468+ # CSS(
469+ # string=css_string
470+ # )
471+ # ]
472+ # )
473473
474474
475475def mf_pago_fmt (cfdi ):
0 commit comments