[Seaside] Creating and returning a pdf

Marco D'Ambros marco.dambros at lu.unisi.ch
Thu May 14 22:59:13 UTC 2009


oops, the information was actually there, but under PDFReactor which I  
initially skipped :-)
What I was looking for was this:

html submitButton on: #generateAndExport of: self

generateAndExport
	self generatePdf.
	aFile := pdfFile readStream
	aFile binary.
	contents := aFile contents.
	aFile close.

	self session returnResponse: (WAResponse
		document: contents
		mimeType: 'application/pdf'
		fileName: pdfFile).


cheers
Marco


On May 15, 2009, at 12:33 AM, Marco D'Ambros wrote:

> Yes, but the problem is not really about pdf, but about creating a
> file and proving the url to that file in the same callback.
> Something like this, but working ;)
>
> 	html submitButton
> 		onClick: (html request callback: [self generateFile]);
> 		url: <link to the generated file>
>
>
> cheers
> Marco
>
> On May 14, 2009, at 11:54 PM, Lukas Renggli wrote:
>
>>> How can I do that?
>>
>> Did you check <http://www.seaside.st/documentation/pdfs>?
>>
>> Lukas
>>
>> -- 
>> Lukas Renggli
>> http://www.lukas-renggli.ch
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list