Coder Social home page Coder Social logo

geckofxhtmltopdf's Introduction

geckofxHtmlToPdf

Command line and .net component for making pdfs from html, using the Mozilla Gecko engine (which powers Firefox), as wrapped by geckofx. It can handle complex scripts and fonts that incorporate SIL's Graphite rules.

Basic command line:

GeckofxHtmlToPdf inputpath outputpath

Other options:

--graphite
--margin-top (-T) e.g. -T 2.5
--margin-bottom (-B)
--margin-left (-L)
--margin-right (-R)
--orientation (-o) e.g. "landscape"
--page-size (-s) e.g. -s A5
--page-width
--page-height
--quiet (-q)
--debug

NB: Currently the only units that are supported are millimeters.

NB: Currently the input and output paths must precede the parameters (this appears to be a requirement of Args.dll).

##Requirements##

.Net 4.0 Runtime or Mono equivalent

##Building##

msbuild geckofxHtmlToPdf.sln (with any desired command line options like /p:Configuration=Release)

The build process downloads the appropriate Geckofx (and Firefox) executables using NuGet, so an Internet connection is necessary at least to get started.

##Limitation##

  • We use this in a production desktop app and are quite happy with it. However it has one significant problem: it appears that gecko decompresses all images of the entire document into RAM, as simple bitmaps, at the same time. In large documents with many pictures (e.g. text books), this RAM exceeds how much a 32-bit program can use. So far our customers doing these books have found that if they get their images down to 600 dpi, then there is enough RAM to create the PDF.

Pull requests for others command line arguments are welcome. Please follow the wkhtmltopdf conventions.

geckofxhtmltopdf's People

Contributors

davidmoore1 avatar hatton avatar johnthomson avatar phillip-hopper avatar stephenmcconnel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

geckofxhtmltopdf's Issues

How to build?

I really would love to use and enhance the project, but I can't get it to build. I would love to write a wiki page as soon as I figure out how to get it up and running.
The furthest I got with VS2013 was two errors when compiling:
Error 1 Cannot determine the location of the VS Common Tools folder. C:\dev2\geckofxHtmlToPdf-master\src\EXEC geckofxHtmlToPdf
Error 2 The command "IF EXIST "%VS140COMNTOOLS%" CALL "%VS140COMNTOOLS%vsvars32.bat"
IF EXIST "%VS120COMNTOOLS%" CALL "%VS120COMNTOOLS%vsvars32.bat"
IF EXIST "%VS110COMNTOOLS%" CALL "%VS110COMNTOOLS%vsvars32.bat"
IF EXIST "%VS100COMNTOOLS%" CALL "%VS100COMNTOOLS%vsvars32.bat"

editbin.exe /largeaddressaware "C:\dev2\geckofxHtmlToPdf-master\output\Debug\GeckofxHtmlToPdf.exe"" exited with code -1. geckofxHtmlToPdf

Could you please give me hint into the right direction?

Very best regards,
Xan-Kun

Kerning problems

As in Firefox, on Windows (at least), many fonts display kerning problems. Apparently the cause is that the engine is using screen hinting even when you print or make a PDF. A report has gone in to Mozilla.

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.