Ismar
Joined 2/23/2019
Ismar said over 4 years ago on SOLID - Liskov Substitution Principle :
very great!

Ismar said almost 3 years ago on Creating PDF files with WickedPDF :
Can you please help me use wicked_pdf with webpacker? it's possible? thanks.

Ismar said almost 3 years ago on Creating PDF files with WickedPDF :
Exactly, I have the following structure:

app/views/layouts/pdf.html.erb
    <%= wicked_pdf_stylesheet_pack_tag "pdf" -%>    
    <%= wicked_pdf_javascript_pack_tag "pdf" -%>

app/javascript/stylesheets/pdf.scss
@import "~bootstrap/scss/bootstrap";

div.alwaysbreak { page-break-before: always; }
div.nobreak:before { clear:both; }
div.nobreak { page-break-inside: avoid; }

app/javascript/packs/pdf.js
const images = require.context('../images', true);
import number_pages from "../vendor/number_pages.js"
window.addEventListener('load', function() {
  number_pages()
})

app/controllers/contracts_controller.rb
  def show
    respond_to do |format|
      format.html
      format.pdf do
        render(template: 'contracts/contract', pdf: @contract.name, disposition: 'inline')
      end
    end
  end

app/views/contracts/contract.pdf.erb
hello!

However, assets are only loaded with helpers wicked_pdf_stylesheet_link_tagĀ  and wicked_pdf_javascript_include_tagĀ 

The wicked_pdf_asset_pack_path method for imagesm also does not work correctly, resulting in a blank file when added.