Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7899147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:37:25+00:00 2026-06-03T08:37:25+00:00

In my project I am trying to print a PDF in Greyscale with a

  • 0

In my project I am trying to print a PDF in Greyscale with a couple of images and text from HTML using the wicked_PDF. The Gem provides a function for the same, but it doesn’t seem to be working.

Here is my code:

    render :pdf => "MyObject",
            :wkhtmltopdf => '/usr/local/bin/wkhtmltopdf',
            :template => '/widgets/pdf/show_myObject.erb',
            :page_size => 'A4',
            :header => { :html => { :template => "/widgets/pdf/myObject_header.erb" }},
            :footer => { :html => { :template => "/widgets/pdf/myObject_footer.erb" }, :line => true },
            :margin => { :top => 0, :left => 3, :right => 3 },
            :greyscale => true

I am passing the images as background. But it renders in color. Am I missing something? Why is wicked_PDF gem unable to process greyscale function as expected?

Their documentation did not have any help regarding this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:37:26+00:00Added an answer on June 3, 2026 at 8:37 am

    Turns out the wkhtmltopdf --grayscale option was incorrectly coded in wicked_pdf as --greyscale

    (swap the ‘e’ for an ‘a’).

    I’ve pushed a fix, and cut a new version of the gem (0.7.9) for this. Thanks for pointing it out!

    :grayscale => true
    

    Now works as intended.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to return an html, page using out.print(); from a servlet, and I
I'm trying to print a file using straight HTML, however, I am having difficulties
I'm working on a project and trying to render some images sitting under the
Ok, I am trying to print a page from a windows service that I
I am trying to print value of a function variable in JSP Page. The
I am trying to print a UL list of images ending with _th.jpg returned
I've got a project where I'm using a PDF generator to send a file
I'm trying to print call stack from within a program. Unfortunately, call to glibc
I am trying to create very first project using django but stuck at very
i'm trying to generat pdf files using iText, i want those files to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.