Giter Site home page Giter Site logo

openhtmltopdf-cli's Introduction

openhtmltopdf-cli

This is a CLI for converting HTML files to PDF documents. Under the hood it uses the openhtmltopdf library. If you'd like to try it out online before downloading, please see the sandbox.

Requirements

You will need Java (JRE or JDK) installed on your machine (version 8 or above). You can download a version for your platform at Azul.

Download

Please visit the releases page.

Usage

Usage: java -jar openhtmltopdf-cli-1.0.10-1.jar convert [-bqvx] -i=<input> -o=<output>
Converts a single html file into a PDF
  -b, --block             Block linked resources (CSS, images, fonts)
  -i, --input=<input>     The html input file
  -o, --output=<output>   The PDF output file
  -q, --quiet             Quiet logging
  -v, --verbose           Verbose logging
  -x, --xhtml             Use to specify that the input file is valid XHTML
                            (skipping the HTML to XHTML step)

Example

java -jar openhtmltopdf-cli-1.0.10-1.jar convert -v -i doc.html -o doc.pdf

Sample HTML file

<html>
<head>
<style>
@page {
  @top-right {
    content: "Page " counter(page) " of " counter(pages);
  }
}
.greeting {
  font-size: 25px;
  text-align: center;
  color: orange;
}
</style>
</head>
<body>

  <h1 class="greeting">
    Hello World!
  </h1>

</body>
</html>

openhtmltopdf-cli's People

Contributors

danfickle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

openhtmltopdf-cli's Issues

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.