pdfkit-www is a great library. It enable you to output a pdf directly from the browser.

To see the demo : http://ef4.github.com/pdfkit-www/demo.html

From the demo, I took the pdfkit.min.js file ; and it works good. Except for the font ; the only embed font is Arial and font embeding from a directory is not yet supported. If you want to have more font, you have to build the pdfkit.min.js and add the font metrics you want to use in the directory ; as explained here : https://github.com/ef4/pdfkit-www#building

The point is that I have no idea about how to do this. This is ruby and coffee script powered. But here, I feel like a baby monkey in front of a big equation.

Where do I type stuff ? (I'm on windows 7) I tried to type that stuff in the basic windows command line, in the ruby.exe command line and in the command line that open when you click on "open a shell here" when you cloned the repository on the github client.

/* ----- Edit ----- */

Ok, it looks like I should do it with the "Git Shell" (did not see the icon on my desktop first). The first two line seems to work, but the "bundle install" throw an error. (no recognized).

And the "rake" line abort because it "cannot load such file -- bundler".

/* ----- Edit 2 after Duck Boyle answer ----- */ (ok, this is better with an edit)

Ok, thanks a lots, this solved the first problem.

Now the "bundle install" command threw :

Your Gemfile has no remote source. If you need gems that are not already on your machine, add a line like this to your Gemfile : source 'https://rubygems.org'
Could not find rake-0.9.2 in any of the sources

And the "rake" command threw :

cannot load such file -- uglifier

So I tried "gem install uglifier" wich seemed to solve the error for the "rake" command by installing uglifier of course ; then i went in a few gem install for different version of json and execjs and other stuff, according to what the errors told me to do ; untill the "bundle install" command threw :

Using lib..
...
Your bundle is complete !

YOOHOO !

But now, the "rake" command throw :

rake aborted!
Type Error : This objet cannot manage this property or method

I did run the command with --trace ; but I have absolutely no idea about what I have to watch here :

enter image description here

/* ----- Edit 3 ----- */

Yes, I did put the source 'https://rubygems.org' in my gem file, this is what gave me the clues to install all the gems I should install.

(please don't moke me too much I'm only a designer that don't understand everything when it is question about more than the basic html / css stuff)

有帮助吗?

解决方案

You should install bundler, used for dependency management in many Ruby projects. Try this:

gem install bundler

I wouldn’t be surprised if you run into more problems after that, let me know.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top