How to turn a Django webpage into a PDF - django

I would like to add a feature to my Django website where the user can click on a link saying "Save as PDF". I would like this link to 1) produce a slightly different version of the page the user is currently on and 2) generate a PDF file in a separate window that the user can then save to wherever he or she wants.
All of the PDF functions I came across related to Django assumed that you already had a PDF that you wanted to render. In this case though, I want to create a PDF based on the content of the current page. Any idea how to do this? Thank you.

You can try this tool WeasyPrint. You can use it with Django

Any webpage is just a HTML basically so any html to pdf library would work. But this one is specifically built for django. Hope this helps.
Documentation for django-wkhtmltopdf

Related

How to render a pdf file as pdf in browser using django

I am using Django web frame work. I am taking pdf files from users (notes/book/etc). Then I want to display those pdf in website, but I could not find a way. Methods that failed 1)iframe 2)simple rendering using django 3)pdf.js library. Also browser blocks rendering initially. Care to suggest a method and steps to implement it.
I the answer to your problem is here :
https://docs.djangoproject.com/en/3.0/howto/outputting-pdf/
Well the answer has to be very very clear here. You can not display pdf using. There is no such library for that. Like pdf.js for javascript based frameworks. I have done the research. So if you want a really good pdf viewer for your django powered website you have to use pdf.js for sure. I have asked people working with django professionally.
output in firefox
ouput in chromium browser
Now 2nd output is what we want
here is the code

Integrating django-filer into djangocms-text-ckeditor

I need a way to use upload and browse abilities of django-filer in the djangocms-text-ckeditor, for example to upload images in the articles of my site, as I'm typing them in the ckeditor.
Are there any settings that help me with that? Or should I write a compatible browser myself?
It seems to me that cmsplugin-filer provides what you are looking for. Take a look at the screenshot. From within the ckeditor modal, I can browse django-filer files and integrate them. Is that what you were looking for?

How to begin creating a web application using a Python and xlrd/django script?

I'm not sure where to begin, as in do I start working towards PHP, Ruby or what, but here is what I'd like to do:
I have a Python script that takes a pre-formatted Excel document and using xlrd and Django, I output a nicely formatted HTML page, based on a template HTML page.
But currently on my team, I'm the only one that can use this Python script because our setups, and I'd like to simplify the process by creating a web app that has a couple drop down menus to specify which script to run, then let me upload the .xls file, at which point the HTML file is automatically generated and a download link is created or the HTML file is spit out somehow.
Does anyone have any guidance as to how I should even begin this project?
I would suggest having a good read of the django docs, and probably working through the tutorials.
Django's documentation is very good.
If you just want to hack at the code you've got then probably read the following to get a very basic overview of some core django functionality -
url dispatcher
views
models
forms
templating
With your app, the url dispatcher will pass the request to a view which will use a template to render your excel document.
You want a form to handle your user parameters and a single view to render and process the form and also render the excel template.

Django image insertion in Admin

I am building a small side project - a simple news site. I want to use the Django Admin for uploading articles and allow access to non-coders so as they can publish articles a la Wordpress or such. I have added some functionality to the admin, first trying out TinyMCE and Dojo rich text editors. However, these do not come with the ability to insert an image into an article from a file (just urls).
I really only want some light text formatting in the text area plus the ability to upload and insert images from the users's harddrive directly into the article. Is there a simple way to achieve this?
If you are already using django-tinymce, you can integrate django-filebrowser with it. See django-tinymce's documentation.
There is also a commercial choice which looks good, but I have never tested it.

How do I extract data from Sitecore's Web Forms for Marketers database?

I want to be able to extract the form submissions from the Web Forms for marketers database and output it in an excel file I can make available to the public on demand.
Anyone know how I can do this?
I know they have an export to Excel option, but it is not automatic and requires someone to login and have access to the form.
I haven't been able to find any documentation from Sitecore on how to do this. Is this a supported operation? Do I have to reflect over the dlls to find api calls? Do I have to delve in to the SQL database and figure out how to do it manually? Is there no hope?
You might get lucky when using Reflector to disasamble the Sitecore.Forms dll. Try to find out if you can disassemble the code that get's run when clicking the Export button.
Actually:
The command comes from: Sitecore.Form.Core.Commands.Export
The executed code is in: Sitecore.Form.Core.Pipelines.Export.Excel
Good luck!
This writeup provides a very detailed account of how to do this if anyone else stumbles on this post. http://r-coding-sitecoreblog.blogspot.com/2011/11/extracting-data-from-sitecore-wffm.html
Hello You can use below given my blog URL to export data in CSV I have also written some blogs to export in XML and HTML on front end
http://sitecoretweaks.wordpress.com/2014/07/02/sitecore-export-to-csvexcel-of-web-form-for-marketers-form-wffm-reports/
You can find all blogs about export data
http://sitecoretweaks.wordpress.com/