Sujet précédent

6.5. pdfgen – PDF outputs

Sujet suivant

6.6. webdav – WebDAV

Cette page

Autres langues

6.5.1. pdfgen.views — views for pdfgen

class openPLM.apps.pdfgen.views.StreamedPdfFileWriter[source]

Bases: pyPdf.pdf.PdfFileWriter

Iterable PdfFileWriter (from pyPDF).

Usage:

>>> pdf_file = StreamedPdfFileWriter()
>>> # add contents
>>> response = HttpResponse(pdf_file)
>>> # set response headers
openPLM.apps.pdfgen.views.fetch_resources(uri, rel)[source]
openPLM.apps.pdfgen.views.render_to_pdf(template_src, context_dict, filename)[source]
openPLM.apps.pdfgen.views.attributes(request, *args, **kwargs)[source]

View that returns the object’s attributes as a PDF file.

class openPLM.apps.pdfgen.views.StateHistory

Bases: tuple

StateHistory(date, user, state)

date

itemgetter(item, ...) –> itemgetter object

Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

state

itemgetter(item, ...) –> itemgetter object

Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

user

itemgetter(item, ...) –> itemgetter object

Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])

openPLM.apps.pdfgen.views.get_state_histories(ctrl)[source]
openPLM.apps.pdfgen.views.download_merged_pdf(obj, files)[source]

Returns a HTTPResponse that contains all PDF files merged into a single PDF file.

openPLM.apps.pdfgen.views.select_pdf_document(request, ctx, obj)[source]

Views to select pdf files to download.

Bases: object

openPLM.apps.pdfgen.views.select_pdf_part(request, ctx, obj)[source]

View helper to select pdf files to download.

openPLM.apps.pdfgen.views.select_pdf(request, *args, **kwargs)[source]

View to download a merged pdf file that contains all pdf files.

Redirects to select_pdf_part() or select_pdf_document() according to the type of the object.

Raises ValueError if the object is not a part or a document.

openPLM.apps.pdfgen.views.bom_pdf(request, *args, **kwargs)[source]