Giter VIP home page Giter VIP logo

wkhtmltopdf-binary-edge's Introduction

I'm Yurui, a full-time web developer. ๐Ÿ‘จโ€๐Ÿ’ป

About me:

  • Wrote my first <div> back in 1998.
  • Been fixing IE compatibility issues professionally since 2011.
  • I'm passionate about clean and testable code.
  • Part-time gopher.
  • Ask me about anything related to React/JavaScript/TypeScript!

I use:

React JavaScript TypeScript Go PostgreSQL Nginx Docker Redux AWS Ruby Node.js Webpack Express.js Bash HTML5 CSS3 Git Azure Sass Ruby on Rails

Social:


Github Stats


Recent Blog Posts



Generated using Github Profilinator

wkhtmltopdf-binary-edge's People

Contributors

knu avatar pallymore avatar petems avatar zealot128 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wkhtmltopdf-binary-edge's Issues

Wktohtmltopdf-binary-edge not working in heroku

First of all I tried it with wktmltopdf-heroku gem it didn't work then i continued to use this gem with heroku 18 but it showed the below error:
Screenshot from 2020-04-08 19-12-51

From the error it seems that i need to install the libpng12 package in heroku 18 since it doesn't have support for that.
Can anyone help me with this ...

Also I made this gem to make my charts works in development and I am afraid I can't choose any other gems.

wkhtmltopdf-binary-edge doesn't work on Alpine Linux

wkhtmltopdf-binary-edge doesn't seem to have a binary that works with Alpine Linux.

Example Dockerfile:

FROM ruby:2.3-alpine

RUN gem install wkhtmltopdf-binary-edge
RUN wkhtmltopdf

Output:

Sending build context to Docker daemon  129.3MB
Step 1/3 : FROM ruby:2.3-alpine
 ---> ea8ea1068e3a
Step 2/3 : RUN gem install wkhtmltopdf-binary-edge
 ---> Using cache
 ---> 03c142572f4a
Step 3/3 : RUN wkhtmltopdf
 ---> Running in dc025755832d
/usr/local/bundle/gems/wkhtmltopdf-binary-edge-0.12.4.0/bin/wkhtmltopdf:17:in `exec': No such file or directory - /usr/local/bundle/gems/wkhtmltopdf-binary-edge-0.12.4.0/libexec/wkhtmltopdf-linux-amd64 (Errno::ENOENT)
	from /usr/local/bundle/gems/wkhtmltopdf-binary-edge-0.12.4.0/bin/wkhtmltopdf:17:in `<top (required)>'
	from /usr/local/bundle/bin/wkhtmltopdf:23:in `load'
	from /usr/local/bundle/bin/wkhtmltopdf:23:in `<main>'

This works with Debian. Example Dockerfile:

FROM ruby:2.3-stretch

RUN gem install wkhtmltopdf-binary-edge
RUN wkhtmltopdf

Output:

Sending build context to Docker daemon  129.3MB
Step 1/3 : FROM ruby:2.3-stretch
 ---> d91b0b9d80c1
Step 2/3 : RUN gem install wkhtmltopdf-binary-edge
 ---> Running in 698ae6f7ee4d
Successfully installed wkhtmltopdf-binary-edge-0.12.4.0
1 gem installed
Removing intermediate container 698ae6f7ee4d
 ---> 607d23d75b3c
Step 3/3 : RUN wkhtmltopdf
 ---> Running in ad3032567dcf
You need to specify at least one input file, and exactly one output file
Use - for stdin or stdout

Name:
  wkhtmltopdf 0.12.4 (with patched qt)

Synopsis:
  wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file>

Document objects:
  wkhtmltopdf is able to put several objects into the output file, an object is
  either a single webpage, a cover webpage or a table of content.  The objects
...

The Alpine wkhtmltopdf package is not qt-patched. There is a qt-patch wkhtmltopdf for alpine docker image, though.

Add composer file

Please add a composer file and submit it to packagegist. Aside from the ruby stuff, the binaries don't require ruby and are perfectly usable. There are other wkhtmltopdf composer packages out there but they are either outdated or don't include the darwin binary.

Having one package that includes them all would be great for CI, despite the size.

Command Error: The `wkhtmltopdf` executable in the `wkhtmltopdf-binary-edge` gem is being loaded, but it's also present in other gems (wkhtmltopdf-binary)

Issue description

The next problem ocurred when I was trying to create a pdf:
"The wkhtmltopdf executable in the wkhtmltopdf-binary-edge gem is being loaded, but it's also present in other gems (wkhtmltopdf-binary) If you meant to run the executable for another gem, make sure you use a project specific binstub (bundle binstub <gem_name>)"

Are both wkhtmltopdf-binary-edge and wkhtmltopdf-binary gems necessary?

Error: Failed to execute: ["/.rbenv/versions/2.3.6/bin/wkhtmltopdf", "-q", "--encoding", "UTF-8", "file:///var/folders/ds/70lrh2194yb9jnwgzx28vm100000gn/T/wicked_pdf20200423-33047-47tsw2.html", "/var/folders/ds/70lrh2194yb9jnwgzx28vm100000gn/T/wicked_pdf_generated_file20200423-33047-1hbwcmu.pdf"] Error: PDF could not be generated! Command Error: The wkhtmltopdfexecutable in thewkhtmltopdf-binary-edge gem is being loaded, but it's also present in other gems (wkhtmltopdf-binary). If you meant to run the executable for another gem, make sure you use a project specific binstub (bundle binstub <gem_name>). If you plan to use multiple conflicting executables, generate binstubs for them and disambiguate their names. /.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/wkhtmltopdf-binary-edge-0.12.2.1/bin/wkhtmltopdf:17:in exec': Bad CPU type in executable - /.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/wkhtmltopdf-binary-edge-0.12.2.1/libexec/wkhtmltopdf-darwin-x86 (Errno::E086) from /.rbenv/versions/2.3.6/lib/ruby/gems/2.3.0/gems/wkhtmltopdf-binary-edge-0.12.2.1/bin/wkhtmltopd`

System specifications

wicked_pdf gem version: 0.11.0

wkhtmltopdf version (output of wkhtmltopdf --version): 0.12.5 (with patched qt)

wkhtmltopdf-binary version: 0.12.4

wkhtmltopdf-binary-edge version: 0.12.2.1

platform/distribution and version: MacOS Catalina

Rails version: 4.2.1

HTML not rendering properly

I switched over from wkhtmltopdf-binary to this gem in order to render images properly, and that works. However, it is rendering empty boxes in certain parts of my HTML. If I switch back the Gemfile to wkhtmltopdf-binary, the HTML renders but not the images. Any ideas / suggestions??? Thanks!

DPI option stopped functioning

Hello,
wkhtmltopdf-binary-edge v 0.12.2.1

First of all, thank you for creating this; the original wkhtmltopdf started having major problems with our newer OS and image encryption!

I have created a brochure generation process utilizing wkhtmltopdf; we were producing excellent pdfs appropriately sized at 300 DPI, 12.75" by 10.25" with a resolution of 3825px by 3075px.

However, upon upgrading to binary-edge, the DPI parameter no longer triggers. We consistently get 100 DPI instead, despite using the same code. Notably, all of the other options (margin, page_height, page_width, etc.) all work with no issue.

pdf = WickedPdf.new.pdf_from_string(render_to_string('api/v1/to_pdf/cover.html.haml',
layout: 'cover_bio.pdf.html'
),
orientation: "Landscape",
page_height: "12.75in",
page_width: "10.25in",
dpi: "300",
low_quality: false,
encoding: "UTF-8",
margin: {
top: 0,
bottom: 0,
left: 0,
right: 0,
}
)
name = "cover_#{user_id}.pdf"
save_path = Rails.root.join('public',name)
File.open(save_path, 'wb') do |file|
file << pdf
end

If you have any suggestions or support, I would be very grateful! Our printer requires the PDF to be in 300 DPI, no less!

wkhtmltopdf 12.5.0 - libjpeg.so.8 ... no such file or directory

After updating to the latest version of the gem, I'm getting the following error message whenever I try and use wkhtlmtopdf:

/usr/local/bundle/gems/wkhtmltopdf-binary-edge-0.12.5.0/libexec/wkhtmltopdf-linux-amd64: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

Any idea what we can do to resolve this? Can't seem to manually install the dependency via apt-get.

libssl.so.1.0.0, libcrypto.so.1.0.0 - mismatching version

OS version : Debian 10 (buster)
Ruby version: 2.6
Rails version: 6
wkhtmltopdf-binary-edge 0.12.5.1 - October 29, 2019

At first I've tried with the default version (wkhtmltopdf-binary-edge 0.12.2.1), it required very old version of shared libraries, so I switched to the latest version (wkhtmltopdf-binary-edge 0.12.5.1), but it turned out that it's also not matching:
OS - installed versions are libssl.so.1.1, libcrypto.so.1.1
I can figure out a workaround but it's not a solution for production.
Not sure but I think you may just change the dependency names to libssl.so and like so for all other possible dependencies.
Or give me some elegant solution. Gem update would be greater!
Thanks in advance. ๐Ÿ˜Ž

Support for Alpine Linux OR better error handling!

When on Alpine Linux the following error accures:

Traceback (most recent call last):
	1: from ./wkhtmltopdf:15:in `<main>'
./wkhtmltopdf:15:in `exec': No such file or directory - /usr/local/bundle/gems/wkhtmltopdf-binary-edge-0.12.5.0/libexec/wkhtmltopdf-linux-amd64 (Errno::ENOENT)

The included binary is there but it's not compatible with alpine linux.

I see in bin/wkhtmltopdf that the case statement will match RUBY_PLATFORM with:
/64.*linux/

In this case, alpine linux version has: x86_64-linux-musl its platform which will match up with the regex But fail without any specific error about the platform not being the right one!

This is confusing and hard to debug.

I noticed you said:
This repo is meant for common development uses (e.g. mac, ubuntu) - if I include a binary for every system then gem would be massive... (#12 (comment))

It's understandable but then again Alpine Linux is a very common development use case these days. I think a lot of ppl depending on this gem would appreciate the support for it, especially when trying to use lightweight docker images.

I'll see if I can make a fork and PR for it.

Maybe at least wrapping the binary execution call in a rescue block wouldn't hurt?

# bin/wkhtmltopdf
. . .
begin
  exec "#{cmd} #{args.join(' ')}"
rescue Errno::ENOENT => e  
  raise "Not found or wkhtmltopdf binaries might be incompatible with the os version \n #{e}"
end

Can't update gem version.

Hi, i try to update gem, but I have an error:
Could not find gem 'wkhtmltopdf-binary-edge (~> 0.12.5.0)' in any of the gem sources listed in your Gemfile.

My source is http://rubygems.org. On rubygems last version is 0.12.5.0.pre.alpha0, but on this version i have an error ' /bundle/gems/wkhtmltopdf-binary-edge-0.12.5.0.pre.alpha0/libexec/wkhtmltopdf-linux-amd64: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory'

When i write
gem 'wkhtmltopdf-binary-edge', git: 'https://github.com/pallymore/wkhtmltopdf-binary-edge.git'
and run bundle nothing happened, just fetching.

libpng12.so.0: cannot open shared object file

bundle/ruby/2.4.0/gems/wkhtmltopdf-binary-edge-0.12.5.0/libexec/wkhtmltopdf-linux-amd64: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

System: Ubuntu 18.04
Rails: 5.1.7
Ruby: 2.4.0
wkhtmltopdf-binary-edge-0.12.5.0

Release to rubygems?

All of these gems die at some point via maintainer abandonment it would be great if there was a wonder one available via rubygems.

Https image not loading in pdf

In my html i have used an image from amazon s3 server (using the absolute path) which in turns displays no image. But if i use address of a known absolute address with http it works like a charm

Awesome stuff

Just wanted to say big thank you! Previous wkhtmltopdf-binary gem didn't work and this appears to work very well. :)

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.