Coder Social home page Coder Social logo

cortiz / prawn-rails Goto Github PK

View Code? Open in Web Editor NEW
142.0 8.0 39.0 117 KB

Prawn Handler for Rails. Handles and registers pdf formats.

License: MIT License

Ruby 98.23% CSS 0.11% HTML 1.18% JavaScript 0.48%
prawn-rails html ruby handler pdf pdf-report

prawn-rails's Introduction

Prawn-Rails

Gem Version CI Status RubyGems Downloads

Install

gem 'prawn-rails'

Note: prawn and prawn-table are dependencies of prawn-rails so there is no need to mention it in the projects Gemfile unless you want to use a specific version of either of those libraries.

Usage

Create a view with pdf as format and prawn as handler so filename should look like example.pdf.prawn.

It provides a helper called prawn_document which builds a PrawnRails::Document with default options. You can override any options as you please. Example:

prawn_document do |pdf|
  pdf.text "Hello World"
end

No need to call pdf.render, it is called by prawn_document.

You can customize the name of the generated PDF and the file's delivery format with the :filename and :disposition keys:

prawn_document(filename: "my-file.pdf", disposition: "attachment") do |pdf|
  pdf.text "Direct download incoming!"
end

You can also override the content disposition using the Content-Disposition HTTP header. If you've already set this, prawn-rails will not override it. Here's an example of setting the header directly:

def download
  respond_to do |format|
    format.pdf do
      headers["Content-Disposition"] = "attachment; filename=\"charts-#{Time.now.to_i}.pdf\""
    end
  end
end

You can also override the file's name from the controller via @filename:

def show
  @filename = "my_report.pdf"
end

If no options are given, the file's name will match to your browser's default and the delivery format will default to inline.

Default configuration

Add a prawn-rails.rb config to your Rails app under config/initializers like this:

PrawnRails.config do |config|
  config.page_layout = :portrait
  config.page_size   = "A4"
  config.skip_page_creation = false
end

Please note that these are the defaults.

For a list of all available options: http://www.rubydoc.info/gems/prawn/Prawn%2FDocument:initialize.

For a list of all metadata the the :info option supports, please see https://github.com/prawnpdf/prawn/blob/master/manual/document_and_page_options/metadata.rb.

If skip_page_creation is set to true then you have to create the first page yourself. Example:

pdf.start_new_page
# OR
pdf.start_new_page size: "A4", page_layout: :portrait

Examples

Hello World

# hello.pdf.prawn

prawn_document do |pdf|
  pdf.text 'Hello World!'
end

Using Active Record

# myproducts.pdf.prawn

prawn_document do |pdf|
  pdf.text 'Current Products are:'
  pdf.move_down 20
  pdf.table @products.collect{|p| [p.name,p.price]}
end

Using Custom options

# landscape.pdf.prawn

prawn_document(page_layout: :landscape) do |pdf|
  pdf.text 'Landscape Page!'
end

Without using the prawn_document helper

doc = PrawnRails::Document.new(page_layout: :landscape)

doc.text "Page 1"
doc.start_new_page
doc.text "Page 2"

pdf_str = doc.render

Credits

Maintained by Weston Ganger - @westonganger

Created by Carlos Ortiz - @cortiz

prawn-rails's People

Contributors

atmartin avatar cgunther avatar codinganarchy avatar cortiz avatar deepak avatar gaffneyc avatar iffyuva avatar langalex avatar reiz avatar rwilliams avatar sigmike avatar smber1 avatar stats avatar tatey avatar tilsammans avatar westonganger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prawn-rails's Issues

Rendering of large PDF file: flush possible?

Hello!

I have a project that renders pretty big PDF files. In one instance the PDF file is more than 600 pages with 4 images on almost every page. This eventually leads to a NoMemoryError by ruby cause the PDF is held entirely in memory... Is there any way to flush the memory to the file during the creation process? I am tinking something along the lines of "create 100 pages - flush - next 100 - flush - ..."

Thanks for taking the time and for this awesome library!

Can't implement config in initializer

Hi, I followed your instructions for setting config in /initializers/prawn-rails.rb, but I keep getting the error unidentified method `config' for PrawnRails::Module. I guess my other option is to revert to Issue #3's commit and hard code landscape into the instantiation, but I sure like the idea of the config better. Any advice on making this work?

landscape page layout

Is there any way to currently create one of these? I don't see a way to pass options to the pdf render... any help would be appreciated. Thanks

ActionController::UnknownFormat

Installed Gem and created pdf.prawn view. When I am accessing url with .pdf. Its giving me ActionController::UnknownFormat Do I need to register the Mime type again ?

Add an option to control Content-Disposition

It looks like there's a way to control the filename (by setting @filename), but the Content-Disposition is hard-coded to be "inline":

          controller.response.headers['Content-Disposition'] = "inline; filename=\\\"\#{@filename}\\\""

Could we add an option for controlling whether Content-Disposition is inline or attachment like prawnto has?

      def set_disposition
        inline = options[:inline] ? 'inline' : 'attachment'
        filename = options[:filename] ? "filename=\"#{options[:filename]}\"" : nil
        @controller.headers["Content-Disposition"] = [inline,filename].compact.join(';')
      end

Maybe we need an options hash?

Rails 6: DEPRECATION WARNING: Single arity template handlers are deprecated.

DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:

Class#call(template)
To:
Class#call(template, source)
(called from class:Engine at C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/prawn-rails-1.2.0/lib/prawn-rails/engine.rb:8)

Using with prawn-icon

Hey, first thanks for the great gem!
I recently tried to use the prawn-icon gem to include Font Awesome icons in my PDF document.

The issue is the following: I need the icons for my table, so I'm using the table_icon helper:

prawn_document(page_layout: :landscape, page_size: "A6", filename: "Bestellungen_#{I18n.l(Date.today)}") do |pdf|
    # pdf.font_families.update(
    #     "Font Awesome" => { :normal => Rails.root.join("app", "assets", "fonts", "fa-solid-900.ttf") }
    # )

    @orders.each do |order|
        data = [ 
            ["Salat", "Suppe", "Dessert"],
            [pdf.table_icon('fas-birthday-cake')]
        ]
        pdf.font("Helvetica", size: 20, style: :bold) do 
            pdf.float { pdf.text(order.user.name, align: :left) }
            pdf.text(l(order.day), align: :right)
        end
        pdf.move_down 10
        pdf.table(data)
    end
end

Without changing the font for the whole document to Font Awesome with pdf.font "Font Awesome", I keep getting the following error:

Your document includes text that's not compatible with the Windows-1252 character set.
If you need full UTF-8 support, use external fonts instead of PDF's built-in fonts.

But unfortunately it neither works when I just change the cell font type like this:

  cell_1 = pdf.make_cell(pdf.table_icon('fas-birthday-cake'))
  cell_1.font = "Font Awesome"

Is there anything I can do to use the gem with prawn-rails? Or might it be a problem with prawn-table?

Prawn::Emoji Support?

I was attempting to integrate prawn-emoji support into my app so we can display emojis inside the PDFs, but it doesn't seem possible to use this with the prawn-rails configuration. Is there any way this can be changed so these integrate automatically?

Bootstrap css import

Hello,
I have set all div and its classes, which i can show in html, i use "gem 'prawn-styled-text'" this gem for styled_text, but the output is not as expected.
So do i need to import CSS ?
if yes, then where and how can i import those CSS.
Thanks and Regards.

Possible missing step or error in README?

From this StackOverflow question, I've followed the instructions in the README (unless I missed something small) but I have an undefined local variable or method 'pdf' for #<#<Class:0x005618ff5021e8>:0x005618ff97b968> in the prawn file, written as in the example.

Feel free to check out my current source here with the relevant commit here.

Thanks!

undefined method `headers' for nil after upgrading to v1.0.0

I'm using prawn to render a pdf to string:

ApplicationController.new.render_to_string("/template.pdf", locals: { model: self })

template.pdf.prawn

require 'stringio'

@model = model if defined?(:model)

prawn_document(:page_layout => :portrait) do |pdf|
  ...
end

This works perfectly with prawn-rails v0.1.1.

After upgrading to v1.0.0 I get the following error:
ActionView::Template::Error: undefined method 'headers' for nil:NilClass

The error supposedly occurs on line 3 of the above template. However If I remove the line the error still happens on line 3. Also If I add a byebug to the top of the template file the breakpoint is never reached as the error happens before.

Appreciate any advice on this, cheers!

Update: looks like this change could be the culprit
https://github.com/cortiz/prawn-rails/pull/16/files

Have you ever been able to make it run on Heroku?

Hello Carlos. First of all, let me apologize, for I know this is not the place to ask this. But I haven't been able to find your email or a private way to contact you.

I have used this gem successfully in a Rails 4 app, locally. When deploying to Heroku, the PDF can't be accessed and the app throws an error. I might be doing something wrong, I know, so I'd just like to know if you have successfully ran this gem on Heroku.

(Note: I can correctly show PDFs if I just use the Prawn gem, without prawn-rails)

PrawnRails initializer doesn't get loaded

I recently moved to this gem instead of separately using prawn and prawn-table. The initializer, I thought, would be handy.

In each of my PDF's I would call something like:

 super(top_margin: 30, right_margin: 50, page_size: 'LETTER', page_layout: :portrait)

I removed that content from each file and placed those setting in an initializer---as recommended in your readme.

PrawnRails.config do |config|
config.page_layout = :portrait
config.page_size = 'LETTER'
config.skip_page_creation = false
config.top_margin = 30
config.left_margin = 50
config.compress = true

config.info = {
Title: 'xxxxx PDF',
Author: 'xxxxxxx',
Subject: 'xxxxx PDF',
Keywords: 'xxxxxx',
Creator: 'xxxxx',
Producer: 'Prawn',
CreationDate: Time.now
}
end

If I load the PDF using super to set the options, the page is created as expected. If I remove super, and and expect the options to be set in the initializer, the PDF fails to load. The first error is "undefined method `page' for nil:NilClass". It seems the document doesn't understand the page structure without using super to define the options.

Load a custom ttf font

Hi @westonganger,

Is it possible to load a custom TTF font in rails initializer ?

I mean that prawn use AFM font type by default and I want to use TTF one (for utf-8 support).

I have access to ttf file, I load them when generating document

pdf.font_families.update("Helvetica": {
    normal: Rails.root.join("app/assets/fonts/Helvetica.ttf"),
    italic: Rails.root.join("app/assets/fonts/Helvetica-Oblique.ttf"),
    bold: Rails.root.join("app/assets/fonts/app/assets/fonts/Helvetica-Bold.ttf"),
    bold_italic: Rails.root.join("app/assets/fonts/Helvetica-BoldOblique.ttf")
    })

Regards,

tests failing with uninitialized constant PDF::Reader

getting a failure

 1) Error:
PdfControllerTest#test_should_get_a_pdf:
NameError: uninitialized constant PDF::Reader
    test/functional/pdf_controller_test.rb:7:in `block in <class:PdfControllerTest>'

assuming it is because, https://github.com/yob/pdf-reader
is needed in tests

also getting an error for html_strip

  1) Error:
PdfControllerTest#test_should_get_a_pdf:
ActionView::Template::Error: undefined method `html_strip' for #<PrawnRails::Document:0x007fddb889a5b0>
    app/views/pdf/render_pdf.pdf.prawn:9:in `_app_views_pdf_render_pdf_pdf_prawn___4319188849794565216_70295138594160'

Render a .pdf.prawn view into a file

Hey!

Big fan of this project. It works flawlessly and allows us to put the code that composes a PDF in the views folder which is where I've always believed something like that belongs.

I have a pdf working as a view exactly like the main page's example with prawn_document and everything. The controller responds to the .pdf format and renders it, all is good and well.

However, I would like to send the generated PDF as an e-mail attachment and to do that I need to have the PDF rendered as if it was a file in my controller. Is there any way to do render a .pdf.prawn view into a file like that?

Let's say I wanted to render a pdf view into a file and save it in the disk, for example. Is that possible in the current state of the gem? I know that using raw prawn that's not hard to do, but with the PDF code inside a view I can't seem to find a way. I couldn't find anything on that topic anywhere.

Thank you in advance!

Rails 6: Deprecation Warning: Single arity template handlers are deprecated.

When running rails, on Rails 6.0.0rc1, I get the following output.

DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must now accept two parameters, the view object and the source for the view object.
Change:

PrawnRails::Renderer.call(template)
To:
PrawnRails::Renderer.call(template, source)

I thought this might be related to: #37

However, I added the latest version of Temple (even though I had no reference to it in my app), and am still receiving the deprecation warning. It looks like an issue from PrawnRails itself, based on the issue above.

I believe this file is the culprit: https://github.com/cortiz/prawn-rails/blob/master/lib/prawn-rails/renderer.rb

When I forked this repo, and changed line 7 of Renderer.rb and modified

def self.call(template)

to
def self.call(template, source)

I was no longer receiving the Deprecation Warning.

Undefined Method

I am getting an error

 NoMethodError - undefined method `merge' for nil:NilClass:
  prawn-rails (0.1.1) lib/prawn-rails/document.rb:10:in `initialize'
  prawn-rails (0.1.1) lib/prawn-rails/rails_helper.rb:11:in `new'
  prawn-rails (0.1.1) lib/prawn-rails/rails_helper.rb:11:in `prawn_document'`

I looked at document.rb and it seems that PrawnConfig is nil. I have the initializer setup, and that appears to be working ok.

My document is: invoice.pdf.prawn and has the contents of

prawn_document do |pdf|
  pdf.text "Hello World!"
end

my prawn-rails.rb file contains:

PrawnRails.config do |config|
  config.page_layout = :portrait
  config.page_sie = "A4"
  config.skip_page_creation = false
end

and after running bundle update I see

Using prawn 1.3.0
Using prawn-table 0.2.1
Using prawn-rails 0.1.1

Issue running on Ruby 3.1 or 3.2 because official prawn gem hasnt released a new version.

Hi there! I'm running into issues deploying an app to Heroku with this gem. These are the logs which look like the error is coming from prawn-rails. Any ideas on what could be going on? Thanks!

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
       1. heroku-community/apt
       2. heroku/ruby
       3. https://github.com/brandoncc/heroku-buildpack-vips
-----> Apt app detected
-----> Reusing cache
-----> Updating apt caches
       Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
       Get:2 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
       Hit:3 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease
       Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
       Get:5 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [2,774 kB]
       Get:6 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [1,057 kB]
       Get:7 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,353 kB]
       Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [3,253 kB]
       Fetched 8,664 kB in 2s (5,311 kB/s)
       Reading package lists...
-----> Fetching .debs for libglib2.0-0
       Reading package lists...
       Building dependency tree...
       0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 43 not upgraded.
       Need to get 0 B/1,287 kB of archives.
       After this operation, 0 B of additional disk space will be used.
       Download complete and in download only mode
-----> Fetching .debs for libglib2.0-dev
       Reading package lists...
       Building dependency tree...
       0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 43 not upgraded.
       Need to get 0 B/1,506 kB of archives.
       After this operation, 0 B of additional disk space will be used.
       Download complete and in download only mode
-----> Fetching .debs for libpoppler-glib8
       Reading package lists...
       Building dependency tree...
       0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 43 not upgraded.
       Need to get 0 B/109 kB of archives.
       After this operation, 0 B of additional disk space will be used.
       Download complete and in download only mode
-----> Installing libglib2.0-0_2.64.6-1~ubuntu20.04.4_amd64.deb
-----> Installing libglib2.0-dev_2.64.6-1~ubuntu20.04.4_amd64.deb
-----> Installing libnspr4_2%3a4.25-1_amd64.deb
-----> Installing libnss3_2%3a3.49.1-1ubuntu1.7_amd64.deb
-----> Installing libnss3_2%3a3.49.1-1ubuntu1.8_amd64.deb
-----> Installing libnss3_2%3a3.49.1-1ubuntu1.9_amd64.deb
-----> Installing libpoppler97_0.86.1-0ubuntu1.1_amd64.deb
-----> Installing libpoppler97_0.86.1-0ubuntu1_amd64.deb
-----> Installing libpoppler-glib8_0.86.1-0ubuntu1.1_amd64.deb
-----> Installing libpoppler-glib8_0.86.1-0ubuntu1_amd64.deb
-----> Writing profile script
-----> Rewrite package-config files
-----> Ruby app detected
-----> Installing bundler 2.3.25
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.1.2
-----> Installing dependencies using bundler 2.3.25
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
       Fetching gem metadata from https://rubygems.org/.........
       Using rake 13.0.6
       Using concurrent-ruby 1.2.2
       Using minitest 5.18.0
       Using builder 3.2.4
       Using mini_portile2 2.8.1
       Using racc 1.6.2
       Using crass 1.0.6
       Using rack 2.2.7
       Using nio4r 2.5.9
       Using websocket-extensions 0.1.5
       Using marcel 1.0.2
       Using mini_mime 1.1.2
       Using date 3.3.3
       Using timeout 0.3.2
       Using public_suffix 4.0.7
       Using connection_pool 2.4.1
       Using http-2 0.11.0
       Using ast 2.4.2
       Using gemoji 4.0.0.rc3
       Using redcarpet 3.5.1
       Using rinku 2.0.6
       Using aws-eventstream 1.2.0
       Using aws-partitions 1.519.0
       Using jmespath 1.6.1
       Using bcrypt 3.1.18
       Using bundler 2.3.25
       Using erubi 1.12.0
       Using thor 1.2.1
       Using zeitwerk 2.6.7
       Using orm_adapter 0.5.0
       Using unf_ext 0.0.8.2
       Using faraday-em_http 1.0.0
       Using faraday-em_synchrony 1.0.0
       Using faraday-excon 1.1.0
       Using faraday-httpclient 1.0.1
       Using multipart-post 2.1.1
       Using faraday-net_http 1.0.1
       Using faraday-net_http_persistent 1.2.0
       Using faraday-patron 1.0.0
       Using faraday-rack 1.0.0
       Using faraday-retry 1.0.3
       Using ruby2_keywords 0.0.5
       Using ffi 1.15.5
       Using geocoder 1.7.3
       Using hashids 1.0.6
       Using honeybadger 4.9.0
       Using http-form_data 2.3.0
       Using mini_magick 4.11.0
       Using json 2.6.1
       Using pagy 5.2.0
       Using method_source 1.0.0
       Using pg 1.2.3
       Fetching ttfunk 1.7.0
       Using rexml 3.2.5
       Using stripe 8.0.0
       Using timezone_finder 1.5.7
       Using i18n 1.12.0
       Using tzinfo 2.0.6
       Using nokogiri 1.14.3
       Using rack-test 2.1.0
       Using websocket-driver 0.7.5
       Using net-protocol 0.2.1
       Using addressable 2.8.0
       Using net-http2 0.18.4
       Using auto_html 2.1.0
       Using aws-sigv4 1.4.0
       Using warden 1.2.9
       Using parser 3.1.2.0
       Using puma 5.6.4
       Using rack-attack 6.6.1
       Using redis-client 0.14.1
       Using sprockets 4.0.2
       Using unf 0.1.4
       Fetching pdf-core 0.9.0
       Using ffi-compiler 1.0.1
       Using faraday-multipart 1.0.3
       Using postmark 1.22.0
       Using activesupport 7.0.4.3
       Using ruby-vips 2.1.4
       Using loofah 2.20.0
       Using net-pop 0.1.2
       Using net-smtp 0.3.3
       Using apnotic 1.7.0
       Using aws-sdk-core 3.121.3
       Using scout_apm 5.1.1
       Using sidekiq 7.1.1
       Using sitemap_generator 6.1.2
       Using net-imap 0.3.4
       Using domain_name 0.5.20190701
       Using faraday 1.9.3
       Using http-parser 1.2.3
       Using rails-dom-testing 2.0.3
       Using globalid 1.1.0
       Using activemodel 7.0.4.3
       Using groupdate 6.0.1
       Using inline_svg 1.7.2
       Using pundit 2.2.0
       Using view_component 2.69.0
       Using rails-html-sanitizer 1.5.0
       Using aws-sdk-kms 1.50.0
       Using image_processing 1.12.2
       Using mail 2.8.1
       Using http-cookie 1.0.5
       Using actionview 7.0.4.3
       Using activejob 7.0.4.3
       Using activerecord 7.0.4.3
       Using aws-sdk-s3 1.104.0
       Using faraday_middleware 1.2.0
       Using http 4.4.1
       Using actionpack 7.0.4.3
       Using actioncable 7.0.4.3
       Using actionmailer 7.0.4.3
       Using activestorage 7.0.4.3
       Using railties 7.0.4.3
       Using hashid-rails 1.4.1
       Using pg_search 2.3.6
       Using pretender 0.4.0
       Using sprockets-rails 3.4.2
       Using tarpon 0.4.0
       Using fathom_api 0.1.2
       Using postmark-rails 0.22.0
       Using actionmailbox 7.0.4.3
       Using actiontext 7.0.4.3
       Using classy-yaml 0.7.0
       Using cssbundling-rails 1.0.0
       Using responders 3.1.0
       Using turbo-rails 1.3.1
       Using jsbundling-rails 1.0.0
       Using rails-i18n 7.0.3
       Using devise 4.9.0
       Using rails 7.0.4.3
       Using stimulus-rails 0.7.2
       Using invisible_captcha 2.0.0
       Using noticed 1.5.9
       Using pay 6.3.2
       Using devise-i18n 1.10.1
       Using hotwire-rails 0.1.3
       Installing pdf-core 0.9.0
       Installing ttfunk 1.7.0
       Fetching prawn 2.4.0
       Installing prawn 2.4.0
       Fetching prawn-table 0.2.2
       Installing prawn-table 0.2.2
       Fetching prawn-rails 1.4.2
       Installing prawn-rails 1.4.2
       Bundle complete! 57 Gemfile dependencies, 140 gems now installed.
       Gems in the groups 'development' and 'test' were not installed.
       Bundled gems are installed into `./vendor/bundle`
       Bundle completed (2.83s)
       Cleaning up the bundler cache.
-----> Installing node-v16.18.1-linux-x64
-----> Installing yarn-v1.22.19
-----> Detecting rake tasks

 !
 !     Could not detect rake tasks
 !     ensure you can run `$ bundle exec rake -P` against your app
 !     and using the production group of your Gemfile.
 !     rake aborted!
 !     LoadError: cannot load such file -- matrix
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `require'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `<top (required)>'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn.rb:67:in `require_relative'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn.rb:67:in `<top (required)>'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-rails-1.4.2/lib/prawn-rails.rb:1:in `require'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-rails-1.4.2/lib/prawn-rails.rb:1:in `<top (required)>'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:60:in `require'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:55:in `each'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:55:in `block in require'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:44:in `each'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:44:in `require'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler.rb:186:in `require'
 !     /tmp/build_c783fe60/config/application.rb:8:in `<top (required)>'
 !     /tmp/build_c783fe60/Rakefile:4:in `require_relative'
 !     /tmp/build_c783fe60/Rakefile:4:in `<top (required)>'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load_rakefile'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:710:in `raw_load_rakefile'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:104:in `block in load_rakefile'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:103:in `load_rakefile'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:82:in `block in run'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
 !     /tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
 !     /tmp/build_c783fe60/bin/rake:4:in `<main>'
 !
/tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/helpers/rake_runner.rb:100:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
rake aborted!
LoadError: cannot load such file -- matrix
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `require'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn/transformation_stack.rb:10:in `<top (required)>'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn.rb:67:in `require_relative'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-2.4.0/lib/prawn.rb:67:in `<top (required)>'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-rails-1.4.2/lib/prawn-rails.rb:1:in `require'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/prawn-rails-1.4.2/lib/prawn-rails.rb:1:in `<top (required)>'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:60:in `require'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:55:in `each'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:55:in `block in require'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:44:in `each'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/runtime.rb:44:in `require'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler.rb:186:in `require'
/tmp/build_c783fe60/config/application.rb:8:in `<top (required)>'
/tmp/build_c783fe60/Rakefile:4:in `require_relative'
/tmp/build_c783fe60/Rakefile:4:in `<top (required)>'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load_rakefile'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:710:in `raw_load_rakefile'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:104:in `block in load_rakefile'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:103:in `load_rakefile'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:82:in `block in run'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/tmp/build_c783fe60/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/tmp/build_c783fe60/bin/rake:4:in `<main>'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:967:in `rake'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:69:in `block in run_assets_precompile_rake_task'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:175:in `log'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:63:in `run_assets_precompile_rake_task'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:103:in `block in compile'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:988:in `allow_git'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:96:in `compile'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails2.rb:55:in `compile'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails3.rb:37:in `compile'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails4.rb:30:in `compile'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails6.rb:17:in `compile'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:19:in `block in <main>'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/base.rb:175:in `log'
	from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/bin/support/ruby_compile:18:in `<main>'
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated

Hello there and thanks for prawn-rails!

We're seeing a deprecation warning since a recent rails upgrade:

DEPRECATION WARNING: Rendering actions with '.' in the name is deprecated: .../show.pdf.prawn

We're rendering a file the way suggested in https://github.com/cortiz/prawn-rails/issues/32, but I assume this is an issue with all templates that follow the file naming convention from your docs.

Is this something you're aware of? Are you working on a fix or do you have a suggestion on how to fix the issue on our side?

Thanks in advance and all the best!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.