I am using ## Ofbiz XSL FO template for downloading PDF files ##. Currently the pdf file downloading with the same name always. I need to set the name of the PDF file. How can I set the filename dynamically? In some other questions I see that we have to set the response header "Content-Disposition", but not sure in ofbiz where to set this. Any answers or pointers will be helpful.
My controller.xml
<view-map name="InvoicePDF" type="screenfop"
page="component://myapp/widget/OrderScreens.xml#InvoicePDF" content-type="application/pdf" encoding="none"/>
My OrderScreens.xml
<!-- PDF Screens -->
<screen name="InvoicePDF">
<section>
<actions>
<property-map resource="AppUiLabels" map-name="uiLabelMap" global="true"/>
<service service-name="getInvoiceDetails" auto-field-map="true"/>
</actions>
<widgets>
<platform-specific>
<xsl-fo><html-template location="component://myapp/webapp/myapp/static/pdf/invoicePrint.fo.ftl"/></xsl-fo>
</platform-specific>
</widgets>
<fail-widgets>
<label style="h3" text="${uiLabelMap.PrintPermission}"/>
</fail-widgets>
</section>
</screen>