Ramon Marques
Ramon Marques

Reputation: 3264

Wicked pdf gem custom size generating blank screen

I have a method to render a pdf with custom sizes

  format.pdf do
    render pdf: 'layout',
           page_height: 20,
           page_width: 25
  end

It's generating a blank screen with no errors in log

if I remove those parameters (page_height and page_width) it works, but I need that custom size.

Any idea?

Upvotes: 0

Views: 364

Answers (1)

Ramon Marques
Ramon Marques

Reputation: 3264

I found a solution, changed those numbers to string with units

  format.pdf do
    render pdf: 'layout',
           page_height: "20cm",
           page_width: "25cm"
  end

Their documentation asks for number, but it worked for me like that.

Upvotes: 1

Related Questions