Class: Decidim::Exporters::PDF
- Includes:
- SanitizeHelper, TranslatableAttributes
- Defined in:
- decidim-core/lib/decidim/exporters/pdf.rb
Overview
Exports a PDF using the provided hash, given a collection and a Serializer. This is an abstract class that should be inherited to create PDF exporters, with each PDF exporter class setting the desired template, layout and orientation.
Direct Known Subclasses
Instance Method Summary collapse
-
#export ⇒ Object
Public: Exports a PDF version of the collection by rendering the template into html and then converting it to PDF.
Methods included from SanitizeHelper
#decidim_escape_translated, #decidim_html_escape, #decidim_rich_text, #decidim_sanitize, #decidim_sanitize_admin, #decidim_sanitize_editor, #decidim_sanitize_editor_admin, #decidim_sanitize_newsletter, #decidim_sanitize_translated, #decidim_url_escape, included
Methods included from TranslatableAttributes
#attachment?, #default_locale?
Methods inherited from Exporter
Constructor Details
This class inherits a constructor from Decidim::Exporters::Exporter
Instance Method Details
#export ⇒ Object
Public: Exports a PDF version of the collection by rendering the template into html and then converting it to PDF.
Returns an ExportData instance.
20 21 22 23 24 25 26 |
# File 'decidim-core/lib/decidim/exporters/pdf.rb', line 20 def export composer.styles(**styles) add_data! ExportData.new(composer.write_to_string, "pdf") end |