Commit ff7ac46e authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: let user to define header position against to top in pdf

parent 716b8171
......@@ -51,6 +51,7 @@ override_batch_mode = kw.get('batch_mode', None)
destination_position_in_letter = kw.get('destination_position_in_letter', 'right')
display_sender_company_above_recipient = kw.get('display_sender_company_above_recipient', 0)
destination_position_padding_left = kw.get('destination_position_padding_left', '100px')
letter_header_margin_to_top = kw.get('letter_header_margin_to_top') or 26
# -------------------------- Document Parameters ------------------------------
letter_portal_type = letter.getPortalType()
letter_relative_url = letter.getRelativeUrl()
......@@ -258,7 +259,7 @@ if letter_format == "pdf":
footer_embedded_html_data = letter.Base_convertHtmlToSingleFile(letter_foot, allow_script=True)
pdf_file = letter.Base_cloudoooDocumentConvert(embedded_html_data, "html", "pdf", conversion_kw=dict(
encoding="utf8",
margin_top=26,
margin_top=letter_header_margin_to_top,
margin_bottom=30,
margin_left=0,
margin_right=0,
......
......@@ -24,7 +24,6 @@ Export this web page as letter in specified format
# override_destination_organisation_title: override event recipient subordinate
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
return context.WebPage_viewAsLetter(
format=format,
display_head=display_head,
......@@ -41,5 +40,6 @@ return context.WebPage_viewAsLetter(
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient= display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
letter_header_margin_to_top = letter_header_margin_to_top,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="html", display_source_address=None, display_head=1, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=0, destination_position_padding_left=\'100px\',**kw</string> </value>
<value> <string>format="html", display_source_address=None, display_head=1, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=0, destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -48,6 +48,7 @@ if dialog_id is not None:
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient=display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
letter_header_margin_to_top = letter_header_margin_to_top,
**kw
)
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>override_source_organisation_title=None, display_source_address=None, display_svg=None,document_download=None, document_save=None, dialog_id=None, cancel_url=None, portal_skin=None,display_head=None, format=None, override_date=None, override_destination_person_title=None, override_source_person_title=None,override_destination_organisation_title=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=None,destination_position_padding_left=\'100px\',*args,**kw</string> </value>
<value> <string>override_source_organisation_title=None, display_source_address=None, display_svg=None,document_download=None, document_save=None, dialog_id=None, cancel_url=None, portal_skin=None,display_head=None, format=None, override_date=None, override_destination_person_title=None, override_source_person_title=None,override_destination_organisation_title=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=None,destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,*args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -40,5 +40,6 @@ return context.Base_viewAsLetter(
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient=display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
letter_header_margin_to_top = letter_header_margin_to_top,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter = \'right\',display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',**kw</string> </value>
<value> <string>format=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter = \'right\',display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -77,6 +77,7 @@
<string>format</string>
<string>portal_skin</string>
<string>display_head</string>
<string>letter_header_margin_to_top</string>
<string>display_source_address</string>
<string>display_sender_company_above_recipient</string>
<string>display_svg</string>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment