Re: Set Filename for ZMS PDF-Export

"Thorsten" <[email protected]> Mon, 21 Mar 2011 08:45:46 -0000
Newsgroups gmane.comp.cms.zms.devel
Message-ID <[email protected]>
Hi,

depending on what you export (e.g. a single file with some "variables") creating your own python export function might help.
There is a code example on how to create and export a zip file with images from a database:
http://www.zms-publishing.com/dokumentation/magic/zip_archive_erstellen
First, some operations in the local fs are performed. Later, by setting the response parameter, you have full control about type and filename:
...
RESPONSE.setHeader('Content-Type','application/zip')
RESPONSE.setHeader('Content-Disposition','inline;filename=%s.zip'%('lightbox'))
return exportfile

[BTW: Content-Disposition "inline" will give you a prompt for downloading the file, while "attachment" will open the pdf in the browser plugin]

Greetings,
tf

--- In [email protected], Tobias Greitzke <tobias.greitzke@...> wrote:
>
> Dear ZMS-Developers,
> 
> we designed a ZMS-Filter to convert ZMS-documents into PDF-Documents via 
> FOP. So far everything works very well, but saving the document all the 
> pages are named exportFilter.pdf. I don't see where I can change the 
> name to what ever I would like it to be, e.g. the title of the document. 
> Is there a way to do that?
> 
> The commandline is:
> fop -c fop_conf.xml -xsl {trans} -xml {in} -pdf {out}
> 
> I understand that {out} is the name of the output document but how can 
> this be changed by a variable coming from ZMS?
> 
> 
> Thanks for your help
> Tobias Greitzke