Skip to content

Commit

Permalink
Merge pull request #1 from unidoc-build/prep-rc-v0.1.0
Browse files Browse the repository at this point in the history
Prepare release v0.1.0
  • Loading branch information
gunnsth authored Feb 8, 2021
2 parents 890249d + 998f569 commit 57147cf
Show file tree
Hide file tree
Showing 14 changed files with 754 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''

---

## Description
A clear and concise description of what the bug is.

## Expected Behavior
A clear and concise description of what you expected to happen.

## Actual Behavior
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Attachments
Include a self-contained reproducible code snippet and PDF file that demonstrates the issue.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
22 changes: 22 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Greetings

on: [issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: >
Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized,
other issues go into our backlog where they are assessed and fitted into the roadmap when suitable.
If you need to get this done, consider buying a license which also enables you to use it in your commercial products.
More information can be found on https://unidoc.io/
pr-message: >
Thanks for posting your first PR. Please be sure to sign the CLA and make sure that the
the Developer Guidelines https://github.com/unidoc/unipdf/wiki/UniPDF-Developer-Guide were followed.
You can expect that we will review the PR and post comments. The timeframe fpr this can vary depending
on various factors, including which issue(s) the PR addresses and where it fits in the roadmap.
Note also that customer PRs are prioritized.
37 changes: 37 additions & 0 deletions ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Acknowledgements
----------------

UniHTML contains code from or depends on the following open source projects:

* [The standard Go library](https://golang.org/pkg/#stdlib).

```
Copyright (c) 2009 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

10 changes: 10 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Licensing Information

This software package is a commercial product and requires a license
code to operate.

The use of this software package is governed by the end-user license agreement
(EULA) available at: https://unidoc.io/eula/

To obtain a Trial license code to evaluate the software, please visit
https://unidoc.io/
122 changes: 120 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,120 @@
# unihtml
UniHTML client for UniHTML
# UniHTML

[UniDoc](https://unidoc.io) UniHTML is a [UniPDF](https://github.com/unidoc/unipdf) library plugin module with capability
of extracting and converting HTML files and inject into PDF document.

It requires a UniHTML Server component to work. Visit [https://unidoc.io](https://unidoc.io).

[![License: UniDoc EULA](https://img.shields.io/badge/license-UniDoc%20EULA-blue)](https://unidoc.io/eula/)
[![GoDoc](https://godoc.org/github.com/unidoc/unipdf?status.svg)](https://godoc.org/github.com/unidoc/unihtml)

## Features

- Create a PDF file from simple HTML file.
- Create PDF file based on the directory that contains HTML along with CSS, JavaScript and Images.
- Create PDF file based on the external web link.
- Define output page dimensions in metric or imperial systems.
- Define output page size based on the [ISO Paper Sizes](https://en.wikipedia.org/wiki/Paper_size#International_paper_sizes) for `A`, `B` series and a `Letter`.
- Define output page orientation.
- Define custom margin sizes for the output document.
- Injection of HTML defined document into existing PDF document.
- CLI that allows to execute HTML -> PDF conversion.


## Preparation

UniHTML is a plugin for the [UniPDF](https://github.com/unidoc/unipdf) Golang library.

It requires valid UniPDF license with the UniHTML plugin. Visit [https://unidoc.io](https://unidoc.io) to get more information.

This plugin works in a pair with the UniHTML server. It is distributed using Docker images and could be downloaded directly from the `unidoccloud/unihtml` DockerHub repository


## Installation

1. Get UniHTML-Server Docker image:
`docker pull unidoccloud/unihtml:latest`
2. Start UniHTML server with some output port defined: `docker run -p 8080:8080 -e UNIHTML_LICENSE=path/to/license unidoccloud/unihtml`
3. Define environment variable: `UNIPDF_LICENSE_PATH` with the path to the UniDoc license.
4. Define environment variable: `UNIPDF_CUSTOMER_NAME` with your customer name matching your license.
5. Get latest version of the `github.com/unidoc/unipdf/v3` module: `go get github.com/unidoc/unipdf/v3`

## Usage

Following example connects to the UniHTML server, reads the content of the input file and converts it using `github.com/unidoc/unipdf/v3/creator` package.

```go
package main

import (
"fmt"
"os"

"github.com/unidoc/unihtml"
"github.com/unidoc/unipdf/v3/creator"
)

func main() {
// UniHTML requires two arguments:
// - Connection path to the unihtml-server i.e.: https://localhost:8080
// - Input path for the file / directory to convert
if len(os.Args) != 3 {
fmt.Println("Err: provided invalid arguments. No UniHTML server path provided")
os.Exit(1)
}

// Establish connection with the UniHTML Server.
if err := unihtml.Connect(os.Args[1]); err != nil {
fmt.Printf("Err: Connect failed: %v\n", err)
os.Exit(1)
}

// Get new PDF Creator.
c := creator.New()

// Read the content of the simple.html file and load it to the conversion.
doc, err := unihtml.NewDocument(os.Args[2])
if err != nil {
fmt.Printf("Err: NewDocument failed: %v\n", err)
os.Exit(1)
}

// Draw the html document file in the context of the creator.
if err = c.Draw(doc); err != nil {
fmt.Printf("Err: Draw failed: %v\n", err)
os.Exit(1)
}

// Write the result file to PDF.
if err = c.WriteToFile("document.pdf"); err != nil {
fmt.Printf("Err: %v\n", err)
os.Exit(1)
}
}
```


## Contributing

[![CLA assistant](https://cla-assistant.io/readme/badge/unidoc/unipdf)](https://cla-assistant.io/unidoc/unipdf)

All contributors must sign a contributor license agreement before their code will be reviewed and merged.

## Support and consulting

Please email us at support@unidoc.io for any queries.

If you have any specific tasks that need to be done, we offer consulting in certain cases.
Please contact us with a brief summary of what you need and we will get back to you with a quote, if appropriate.

## Licensing Information

This software package (unihtml) is a commercial product and requires a license
code to operate.

The use of this software package is governed by the end-user license agreement
(EULA) available at: https://unidoc.io/eula/

To obtain a Trial license code to evaluate the software, please visit
https://unidoc.io/

Loading

0 comments on commit 57147cf

Please sign in to comment.