{# Copyright 2024 Louis Paternault This file is part of pdfimpose-web. Pdfimpose-web is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pdfimpose-web is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with pdfimpose-web. If not, see . -#} {% macro input_length(text, nameprefix, defaultvalue=0, defaultunit="cm", arialabel="") -%}
{{ text }}
{%- endmacro %} {% macro input_format(nameprefix, choices, default="standard") -%} {% if "standard" in choices %}
{% trans %}Put as much source pages into the destination page of the given size (note that margins are ignored when computing this; if margins are set (see below), the resulting file might be larger than the required format).{% endtrans %}
{% endif %} {% if "custom" in choices %}
{% trans %}Same as above, but with custom paper size.{% endtrans %}
{{ input_length(_("Width"), nameprefix=nameprefix + "-format-custom-width", defaultvalue=21, defaultunit="cm") }}
{{ input_length(_("Height"), nameprefix=nameprefix + "-format-custom-height", defaultvalue=29.7, defaultunit="cm") }}
{% endif %} {% if "signature" in choices %}
{% trans %}Size of the destination pages (e.g. 2x3): this represents the number of sheets you will get after having cut each printed sheet.{% endtrans %}
{% trans %}Width{% endtrans %}
{% trans %}Height{% endtrans %}
{% endif %} {% endmacro %} {% macro input_number(title, name, value, minimum="", maximum="", step="", moreargs="") %}
{{ title }}
{%- endmacro %} {% macro input_bind(nameprefix) %}
{% trans %}Bind{% endtrans %}
{%- endmacro %} {% macro input_group(nameprefix, default) %}
{% trans %}Sheets{% endtrans %}
{% endmacro %} {% macro input_resize(nameprefix) %}
{% trans %}Same as above, but with custom paper size.{% endtrans %}
{{ input_length(_("Width"), nameprefix=nameprefix + "-resize-custom-width", defaultvalue=21, defaultunit="cm") }}
{{ input_length(_("Height"), nameprefix=nameprefix + "-resize-custom-height", defaultvalue=29.7, defaultunit="cm") }}
{{ input_number(_("Scale"), name=nameprefix + "-resize-scale", value="0.5", minimum="0", step="any", moreargs='onfocus="checkparentradio(this)"') }}
{% endmacro %}