معرفی شرکت ها


django-xhtml2pdf-0.0.4


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

A Django app to generate pdfs from templates
ویژگی مقدار
سیستم عامل -
نام فایل django-xhtml2pdf-0.0.4
نام django-xhtml2pdf
نسخه کتابخانه 0.0.4
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Christopher Glass
ایمیل نویسنده tribaal@gmail.com
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/django-xhtml2pdf/
مجوز BSD License
Django xhtml2pdf ################ Attention ============================= This project is wrapper code between the django project and the xhtml2pdf project, both have a few maintaining so maybe are not ideal for your project. Please get in touch if you would like to take over maintainership. What it does is simply allow people to create xhtml2pdf templates using all the cool django things like STATIC_URL etc.. (like one would for a webpage template), and the utils function makes all the images and ressources appear in the pdf. Usage ===== Simply do the following:: from django_xhtml2pdf.utils import generate_pdf def myview(response): resp = HttpResponse(content_type='application/pdf') result = generate_pdf('my_template.html', file_object=resp) return result Class-based views ================= You can use the provided PdfMixin with any view that subclasses TemplateView, example:: from django.views.generic.detail import DetailView from django_xhtml2pdf.views import PdfMixin from .models import Product class ProductPdfView(PdfMixin, DetailView): model = Product template_name = "product_pdf.html" It will output the rendered content of the view in pdf. Decorator ============ Simply do the following:: from django_xhtml2pdf.utils import pdf_decorator @pdf_decorator def myview(request): return render(request, 'mytemplate.html') Change de pdf file name:: from django_xhtml2pdf.utils import pdf_decorator @pdf_decorator(pdfname='new_filename.pdf') def myview(request): return render(request, 'mytemplate.html')


نیازمندی

مقدار نام
>=1.11 Django
>=0.2.2 xhtml2pdf


نحوه نصب


نصب پکیج whl django-xhtml2pdf-0.0.4:

    pip install django-xhtml2pdf-0.0.4.whl


نصب پکیج tar.gz django-xhtml2pdf-0.0.4:

    pip install django-xhtml2pdf-0.0.4.tar.gz