Browse Source

unipdf move updates (#6)

* Update README and other documentation for unipdf
* Update Jenkinsfile
* Get test dependencies too (Jenkinsfile processing not fully module based yet)
* Update wercker file for modules
master
Gunnsteinn Hall 1 year ago
committed by GitHub
parent
commit
37d822bead
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 83 additions and 112 deletions
  1. +1
    -1
      CONTRIBUTING.md
  2. +8
    -32
      Jenkinsfile
  3. +4
    -4
      LICENSE.AGPL
  4. +1
    -1
      LICENSE.COMMERCIAL
  5. +3
    -3
      LICENSE.md
  6. +49
    -56
      README.md
  7. +8
    -8
      doc.go
  8. +9
    -7
      wercker.yml

+ 1
- 1
CONTRIBUTING.md View File

@ -1,5 +1,5 @@
## Contributor License Agreement
[![CLA assistant](https://cla-assistant.io/readme/badge/unidoc/unidoc)](https://cla-assistant.io/unidoc/unidoc)
[![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.

+ 8
- 32
Jenkinsfile View File

@ -22,11 +22,11 @@ node {
env.TMPDIR="${WORKSPACE}/temp"
sh "mkdir -p ${env.TMPDIR}"
dir("${GOPATH}/src/github.com/unidoc/unidoc") {
dir("${GOPATH}/src/github.com/unidoc/unipdf") {
sh 'go version'
stage('Checkout') {
echo "Pulling unidoc on branch ${env.BRANCH_NAME}"
echo "Pulling unipdf on branch ${env.BRANCH_NAME}"
checkout scm
}
@ -35,7 +35,6 @@ node {
sh 'go get -u golang.org/x/lint/golint'
sh 'go get github.com/tebeka/go2xunit'
sh 'go get github.com/t-yuki/gocover-cobertura'
// Get all dependencies (for tests also).
sh 'go get -t ./...'
}
@ -78,29 +77,13 @@ node {
}
}
dir("${GOPATH}/src/github.com/unidoc/unidoc-examples") {
dir("${GOPATH}/src/github.com/unidoc/unipdf-examples") {
stage('Build examples') {
// Output environment variables (useful for debugging).
sh("printenv")
// Pull unidoc-examples from connected branch, or master otherwise.
def examplesBranch = "master"
if (env.BRANCH_NAME.take(3) == "PR-") {
// Pull requests (PR) require separate handling.
if (env.CHANGE_TARGET.take(2) == "v3") {
examplesBranch = "v3"
}
} else {
if (env.BRANCH_NAME.take(2) == "v3") {
examplesBranch = "v3"
}
// Special cases.
switch("${env.BRANCH_NAME}") {
case "v3-reduce-fonts-exports":
examplesBranch = "v3-reduce-fonts-exports"
break
}
}
// Pull unipdf-examples from connected branch, or master otherwise.
def examplesBranch = "v3"
// Check if connected branch is defined explicitly.
def safeName = env.BRANCH_NAME.replaceAll(/[\/\.]/, '')
@ -109,22 +92,15 @@ node {
examplesBranch = readFile(fpath).trim()
}
echo "Pulling unidoc-examples on branch ${examplesBranch}"
echo "Pulling unipdf-examples on branch ${examplesBranch}"
git url: 'https://github.com/unidoc/unidoc-examples.git', branch: examplesBranch
// Dependencies for examples.
sh 'go get github.com/wcharczuk/go-chart'
sh 'CGO_ENABLED=1 go get github.com/miekg/pkcs11'
sh 'CGO_ENABLED=1 go get github.com/ThalesIgnite/crypto11'
// Build all examples.
// CGO_ENABLED=1 required for crypto11 dependency (one example).
sh 'find . -name "*.go" ! -name "*pkcs11*.go" -print0 | xargs -0 -n1 go build'
sh 'find . -name "*pkcs11*.go" -print0 | CGO_ENABLED=1 xargs -0 -n1 go build'
sh './build_examples.sh'
}
stage('Passthrough benchmark pdfdb_small') {
sh './pdf_passthrough_bench /home/jenkins/corpus/pdfdb_small/* | grep -v "Testing " | grep -v "copy of" | grep -v "To get " | grep -v " - pass"'
sh './bin/pdf_passthrough_bench /home/jenkins/corpus/pdfdb_small/* | grep -v "Testing " | grep -v "copy of" | grep -v "To get " | grep -v " - pass"'
}
}
}

+ 4
- 4
LICENSE.AGPL View File

@ -1,5 +1,5 @@
UniDoc - PDF library for golang
Copyright (C) 2016-2017 FoxyUtils ehf.
UniDoc unipdf - PDF library for golang
Copyright (C) 2016-2019 FoxyUtils ehf.
This program provided by FoxyUtils ehf ("Company") is free software ("covered
work"). You can redistribute it and/or modify it under the terms of the GNU
@ -20,11 +20,11 @@ Section 5 of the License.
You can be released from the requirements of the license by purchasing a
commercial license. Buying such a license is mandatory as soon as you develop
activities involving UniDoc without disclosing the source code of your own
activities involving unipdf without disclosing the source code of your own
applications under the AGPL license. These activities include offering services
as an application service provider or providing an over-network based
application programming interface (API), creating or manipulating documents for
users in a web/server/cloud application, incorporating UniDoc into a closed
users in a web/server/cloud application, incorporating unipdf into a closed
source product.
For more information, please contact the Company by emailing sales@unidoc.io.


+ 1
- 1
LICENSE.COMMERCIAL View File

@ -1,4 +1,4 @@
Software License Agreement for UniDoc (Commercial License)
Software License Agreement for UniDoc unipdf (Commercial License)
Terms of Use
also available on our website https://unidoc.io/eula/


+ 3
- 3
LICENSE.md View File

@ -1,6 +1,6 @@
## Licensing Information
This library (UniDoc) has a dual license, a commercial one suitable for closed source projects and an
This library (UniDoc unipdf) has a dual license, a commercial one suitable for closed source projects and an
AGPL license that can be used in open source software.
Depending on your needs, you must choose one of them and follow its policies. A detail of the policies
@ -8,13 +8,13 @@ and agreements for each license type are available in the [LICENSE.COMMERCIAL](L
and [LICENSE.AGPL](LICENSE.AGPL) files.
In brief, purchasing a license is mandatory as soon as you develop activities
distributing the UniDoc software inside your product or deploying it on a network
distributing the unipdf software inside your product or deploying it on a network
without disclosing the source code of your own applications under the AGPL license.
These activities include:
* offering services as an application service provider or over-network application programming interface (API)
* creating/manipulating documents for users in a web/server/cloud application
* shipping UniDoc with a closed source product
* shipping unipdf with a closed source product
Please see [pricing](http://unidoc.io/pricing) to purchase a commercial license or contact sales at sales@unidoc.io
for more info.


+ 49
- 56
README.md View File

@ -1,48 +1,35 @@
# Version 3 - Upcoming
# UniPDF - PDF for Go
Version 3 of UniDoc is currently in pre-release stages. It marks multiple significant new major advancements as well as many fixes and enhancements:
[UniDoc](http://unidoc.io)'s unipdf is a powerful PDF library for Go (golang) with capabilities for
creating and processing PDF files. The library is written and supported by
the [FoxyUtils.com](https://foxyutils.com) website, where the library is used to power
many of the PDF services offered.
- [x] Composite fonts supported and font handling has and is being completely revamped, including unicode support.
- [x] Digital signing validation and signing
- [x] Append mode
- [x] PDF compression and optimization of outputs with several options 1) combining duplicates, 2) compressed object streams, 3) image points per inch threshold, 4) image quality.
- [x] Text extraction significantly improved in quality and foundation in place for vectorized (position-based) text extraction (XY)
- [x] Image extraction with coordinates
- [x] Paragraph in creator handling multiple styles within the same paragraph
- [x] [Invoice component for easy PDF invoice generation](https://unidoc.io/news/simple-invoices)
- [x] Table of contents automatically generated
- [x] Encryption support refactored and AESv3 support added
- [x] Form field filling and form flattening with appearance generation
- [x] Getting form field values and listing
- [x] FDF merge
- [x] CCITTFaxDecode decoding and encoding support
- [x] Advanced table generation in the creator with subtable support
- [ ] JBIG2 decoding support
To give it a spin, checkout the `v3` branch of unidoc and `v3` branch of unidoc-examples:
- https://github.com/unidoc/unidoc/tree/v3
- https://github.com/unidoc/unidoc-examples/tree/v3
---
[![Build Status](https://app.wercker.com/status/22b50db125a6d376080f3f0c80d085fa/s/master "wercker status")](https://app.wercker.com/project/bykey/22b50db125a6d376080f3f0c80d085fa)
[![License: AGPL v3](https://img.shields.io/badge/License-Dual%20AGPL%20v3/Commercial-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![Go Report Card](https://goreportcard.com/badge/github.com/unidoc/unipdf)](https://goreportcard.com/report/github.com/unidoc/unipdf)
[![GoDoc](https://godoc.org/github.com/unidoc/unipdf?status.svg)](https://godoc.org/github.com/unidoc/unipdf)
# UniDoc
## News
- unidoc is being renamed to unipdf and will be maintained under https://github.com/unidoc/unipdf
- The old repository will remain under https://github.com/unidoc/unidoc for backwards compatibility and will be read-only.
All development will be under the unipdf repository.
- The initial release of unipdf v3.0.0 will be compliant with Go modules from the start.
[UniDoc](http://unidoc.io) is a powerful PDF library for Go (golang). The library is written and supported by the owners of the [FoxyUtils.com](https://foxyutils.com) website, where the library is used to power many of the PDF services offered.
[![wercker status](https://app.wercker.com/status/22b50db125a6d376080f3f0c80d085fa/s/master "wercker status")](https://app.wercker.com/project/bykey/22b50db125a6d376080f3f0c80d085fa)
[![GoDoc](https://godoc.org/github.com/unidoc/unidoc?status.svg)](https://godoc.org/github.com/unidoc/unidoc)
## Installation
~~~
go get github.com/unidoc/unidoc/...
~~~
## Features
UniDoc has a powerful set of features both for reading, processing and writing PDF.
The following list describes some of the main features:
unipdf has a powerful set of features both for reading, processing and writing PDF.
The following list describes some key features:
- [x] Create PDF reports with easy interface
- [x] Create PDF invoices (v3)
- [x] [Invoice component for easy PDF invoice generation](https://unidoc.io/news/simple-invoices)
- [x] Advanced table generation in the creator with subtable support
- [x] Composite fonts supported and font handling has and is being completely revamped, including unicode support.
- [x] Paragraph in creator handling multiple styles within the same paragraph
- [x] Table of contents automatically generated
- [x] PDF compression and optimization of outputs with several options 1) combining duplicates, 2) compressed object streams, 3) image points per inch threshold, 4) image quality.
- [x] Text extraction significantly improved in quality and foundation in place for vectorized (position-based) text extraction (XY)
- [x] Image extraction with coordinates
- [x] Merge PDF pages
- [x] Merge page contents
- [x] Split PDF pages and change page order
@ -58,35 +45,42 @@ The following list describes some of the main features:
- [x] Fill out forms and FDF merging (v3)
- [x] Unlock PDF files / remove password
- [x] Protect PDF files with a password
- [x] Digital signatures (v3)
- [x] Digital signing validation and signing
- [x] Encryption support refactored and AESv3 support added
- [x] CCITTFaxDecode decoding and encoding support
- [x] FDF merge and form filling via JSON data
- [x] Form field filling and form flattening with appearance generation
- [x] Append mode
- [x] Getting form field values and listing
## Installation
With modules:
~~~
go get github.com/unidoc/unipdf/v3
~~~
## How can I convince myself and my boss to buy unidoc rather using a free alternative?
## How can I convince myself and my boss to buy unipdf rather using a free alternative?
The choice is yours. There are multiple respectable efforts out there that can do many good things.
In unidoc, we work hard to provide production quality builds taking every detail into consideration and providing excellent support to our customers. See our [testimonials](https://unidoc.io) for example.
In UniDoc, we work hard to provide production quality builds taking every detail into consideration and providing excellent support to our customers. See our [testimonials](https://unidoc.io) for example.
Security. We take security very seriously and we restrict access to github.com/unidoc/unidoc repository with protected branches and only 2 of the founders have access and every commit is reviewed prior to being accepted.
Security. We take security very seriously and we restrict access to github.com/unidoc/unipdf repository with protected branches and only the founders have access and every commit is reviewed prior to being accepted.
The profits are invested back into making unidoc better. We want to make the best possible product and in order to do that we need the best people to contribute. A large fraction of the profits made goes back into developing unidoc. That way we have been able to get many excellent people to work and contribute to unidoc that would not be able to contribute their work for free.
The profits are invested back into making unipdf better. We want to make the best possible product and in order to do that we need the best people to contribute. A large fraction of the profits made goes back into developing unipdf. That way we have been able to get many excellent people to work and contribute to unipdf that would not be able to contribute their work for free.
## Examples
Multiple examples are provided in our example repository.
Many features for processing PDF files with [documented examples](https://unidoc.io/examples) on our website.
Multiple examples are provided in our example repository https://github.com/unidoc/unidoc-examples
as well as [documented examples](https://unidoc.io/examples) on our website.
Contact us if you need any specific examples.
## Vendoring
For reliability, we recommend using specific versions and the vendoring capability of golang.
Check out the Releases section to see the tagged releases.
## Contributing
[![CLA assistant](https://cla-assistant.io/readme/badge/unidoc/unidoc)](https://cla-assistant.io/unidoc/unidoc)
[![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.
@ -99,7 +93,7 @@ Please contact us with a brief summary of what you need and we will get back to
## Licensing Information
This library (UniDoc) has a dual license, a commercial one suitable for closed source projects and an
This library (unipdf) has a dual license, a commercial one suitable for closed source projects and an
AGPL license that can be used in open source software.
Depending on your needs, you must choose one of them and follow its policies. A detail of the policies
@ -107,20 +101,20 @@ and agreements for each license type are available in the [LICENSE.COMMERCIAL](L
and [LICENSE.AGPL](LICENSE.AGPL) files.
In brief, purchasing a license is mandatory as soon as you develop activities
distributing the UniDoc software inside your product or deploying it on a network
distributing the unipdf software inside your product or deploying it on a network
without disclosing the source code of your own applications under the AGPL license.
These activities include:
* offering services as an application service provider or over-network application programming interface (API)
* creating/manipulating documents for users in a web/server/cloud application
* shipping UniDoc with a closed source product
* shipping unipdf with a closed source product
Please see [pricing](http://unidoc.io/pricing) to purchase a commercial license or contact sales at sales@unidoc.io
for more info.
## Getting Rid of the Watermark - Get a License
Out of the box - unidoc is unlicensed and outputs a watermark on all pages, perfect for prototyping.
To use unidoc in your projects, you need to get a license.
Out of the box - unipdf is unlicensed and outputs a watermark on all pages, perfect for prototyping.
To use unipdf in your projects, you need to get a license.
Get your license on [https://unidoc.io](https://unidoc.io).
@ -134,5 +128,4 @@ if err != nil {
}
```
[contributing]: CONTRIBUTING.md

+ 8
- 8
doc.go View File

@ -4,16 +4,16 @@
*/
// Package unipdf is a comprehensive PDF library for Go (golang). The library has advanced capabilities for generating,
// processing and modifying PDFs. UniDoc is written and supported by the owners of the
// processing and modifying PDFs. UniPDF is written and supported by the owners of the
// FoxyUtils.com website, where the library is used to power many of the PDF services offered.
//
// Getting More Information
//
// Check out the Getting Started and Example sections, which showcase how to install UniDoc and provide numerous
// examples of using UniDoc to generate, process or modify PDF files.
// Check out the Getting Started and Example sections, which showcase how to install unipdf and provide numerous
// examples of using unipdf to generate, process or modify PDF files.
// https://unidoc.io/examples/getting_started/
//
// The godoc for unidoc provides a detailed breakdown of the API and documentation for packages, types and methods.
// The GoDoc for unipdf provides a detailed breakdown of the API and documentation for packages, types and methods.
// https://godoc.org/github.com/unidoc/unipdf
//
// Overview of Major Packages
@ -23,24 +23,24 @@
// - common: Provides common shared types such as Logger and utilities to check
// license validity.
//
// - pdf/core: The core package defines the primitive PDF object types and handles
// - core: The core package defines the primitive PDF object types and handles
// the file reading I/O and parsing the primitive objects.
//
// - pdf/model: The model package builds on the core package, to represent the PDF as
// - model: The model package builds on the core package, to represent the PDF as
// a structured model of the PDF primitive types. It has a reader and a writer to
// read and process a PDF file based on the structured model. This serves as a basis
// to perform a number of numerous tasks and can be used to work with a PDF in a
// medium to high level interface, although it does require an understanding of the
// PDF format and structure.
//
// - pdf/creator: The PDF creator makes it easy to create new PDFs or modify existing
// - creator: The PDF creator makes it easy to create new PDFs or modify existing
// PDFs. It can also enable loading a template PDF, adding text/images and
// generating an output PDF. It can be used to add text, images, and generate text
// and graphical reports. It is designed with simplicity in mind, with the goal of
// making it easy to create reports without needing any knowledge about the PDF
// format or specifications.
//
// - pdf/extractor: Package extractor is used for quickly extracting PDF content
// - extractor: Package extractor is used for quickly extracting PDF content
// through a simple interface. Currently offers functionality for extracting textual
// content.
package unipdf

+ 9
- 7
wercker.yml View File

@ -26,22 +26,24 @@ build:
# at the right place in the workspace tree
- setup-go-workspace
- script:
name: turn on modules
code: export GO111MODULE=on
# Gets the dependencies
- script:
name: go get
name: go mod download
code: |
cd $WERCKER_SOURCE_DIR
go version
go get -t $(go list ./... | grep -v textencoding/glyphlist)
go mod download
# Build the project
- script:
name: go build
name: go vet
code: |
go build $(go list ./... | grep -v examples | grep -v textencoding/glyphlist)
go vet ./...
# Test the project
- script:
name: go test
code: |
go test $(go list ./... | grep -v examples| grep -v textencoding/glyphlist)
go test -v ./...

Loading…
Cancel
Save