pdf.generate

/ PDF / pdf.generate

PDF Generate:

Step_1:

[db.meta.select_meta meta_table=”order_meta” object_id=”{qs.0}” set=”template.candidate_data” /]

[loop.eachKey template.candidate_data]
[aw2.get eachKey.item.meta_value set=”template.arr.{eachKey.item.meta_key}” /]

[if.contains haystack=”amount_gross,amount_discount,amount_gst,amount_total” needle=”{eachKey.item.meta_key}”]
[aw2.get eachKey.item.meta_value set=”template.price” /]
[php.number_format p1=”{template.price}” p2=”2″ set=”template.formated_price” /]
[template.get formated_price set=”template.arr.{eachKey.item.meta_key}” /]
[/if.contains]

[/loop.eachKey]

[helper.pdf.main pdf_data=”{template.arr}” pdf_template_slug=”invoice-candidate-subscription-template” filename=”{qs.0}-candidate-deatails.pdf” pdf_post_type=”pdf_template” /]

 

Step_2:

[templates.add main]
[query.get_post post_slug='{template.pdf_template_slug}’ post_type=”{template.pdf_post_type default=’pdf_template’}” set=’template.pdf’ /]

[if.empty template.filename]
[template.set filename=”{template.pdf_template_slug}.pdf” /]
[/if.empty]

[pdf.generate part=setup]
{
“page_orientation”:”P”,
“pdf_unit”:”mm”,
“page_format”:”LEGAL”,
“unicode”:”TRUE”,
“encoding”:”UTF-8″,
“pdfa”:”TRUE”,
“border”:”B”,
“show_footer”:”no”,
“show_header”:”no”,
“font_name”:”freesans”,
“title”:”[aw2.get template.pdf.post_title /]”
}
[/pdf.generate]

[pdf.generate part=”content”]
[aw2.set pdf_data=”{template.pdf_data}” /]
[template.get pdf.post_content.run /]
[/pdf.generate]

[pdf.generate part=download filename='{template.filename}’ /]

[/templates.add]

 

Step_3: Just eg.

PDF Templates : this is a CPT

Module> dhl-admission-template
<table width=”100%” align=”center” style=”text-align:center;padding:10px;”>
<tr>
<td width=”20%”>
[aw2.get pdf_data.application_id /]
</td>
</tr></table>

Categories
Most Popular

Leave a Reply

Your email address will not be published.