Friday, November 22, 2013

Re: html to odt

I'm not sure if I understand the problem correctly, but if you are wanting to serve HTML files rendered as ODT, you could take the following steps:

1. In your view, render your HTML
2. Use this library (or something similar) to convert it to ODT
3. Return a Response that includes the ODT as the content and the set the proper content-type


On Fri, Nov 22, 2013 at 11:13 AM, Tom Lockhart <tlockhart1976@gmail.com> wrote:

On 2013-11-21, at 9:34 PM, Harjot Mann <harjotmann1992@gmail.com> wrote:

> I want to save my html django templates to odt file. Is there any way
> to do this?

Not sure what you actually want to do. If you are trying to capture your final html, you might be able to script something, possibly with selenium, to generate the page and then send it to Libre Office as a batch job:

http://stackoverflow.com/questions/16202103/how-to-open-file-in-libre-office-and-save-this-like-doc-file

hth

                     - Tom

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4082C55B-E4DC-425A-A239-5BC11B652042%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPbEHsf%2B%2BS3k%3DwE6cV0CoVjdmADo7z%3Da0_NNxzM%2B_PA%2B_0y%3DHg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment