Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Merge foliojs/master #8

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
f91bdd6
Features/outline (#831)
theBenForce Jun 22, 2018
56c7deb
Fix linewrapper ellipsis inifinite loop (#779)
Ketler13 Jun 29, 2018
7839a41
Long running loop fix (#796)
Mike-Koder Jun 29, 2018
93061f3
Fix bug with \n translation (#797)
Mike-Koder Jun 29, 2018
2567227
Allows the text continue feature to work when the starting string is …
pretzelfisch Jun 29, 2018
6e72e0f
Fix build config
diegomura Nov 23, 2018
83f5f72
Convert to EcmaScript (ES6+) (#859)
blikblum Nov 29, 2018
b3c2790
Add initial reference spec
blikblum Dec 17, 2018
6f0d5ff
Merge pull request #883 from blikblum/add-reference-unit-test
blikblum Dec 17, 2018
f5b6ddd
Add PDF security features with ES6
zesik Dec 6, 2018
2ef9d7d
Allow customization of randomizer
zesik Dec 16, 2018
870260c
Add tests for security features and update snapshots
zesik Dec 16, 2018
678148a
Downgrade dependency version to avoid fs operation
zesik Dec 16, 2018
6398cca
Update readme and docs
zesik Dec 16, 2018
2651a74
Organize permissions in option to an object
zesik Dec 17, 2018
c400dfa
Add unit tests for trailer
zesik Dec 18, 2018
d5d8e3c
Merge pull request #820 from zesik/master
blikblum Dec 19, 2018
5274136
Complete coffee -> JS conversion of docs
blikblum Dec 17, 2018
aec971f
Rename docs files, removing the coffee sufix
blikblum Dec 19, 2018
e595a8e
Convert coffeescript code in README.md
blikblum Dec 19, 2018
3eae185
Remove coffee-script dependency
blikblum Dec 20, 2018
c09cd64
Merge pull request #884 from blikblum/cleanup-docs
blikblum Dec 20, 2018
883983a
Import test dependencies directly from src through babel-jest. Adapt …
blikblum Dec 20, 2018
5f125f7
Mock PDFSecurity methods in tests to ensure same output accross diffe…
blikblum Dec 20, 2018
8bf29c5
Update saved snapshots
blikblum Dec 20, 2018
a1156fb
Move integration tests into a separated directory and add script to r…
blikblum Dec 20, 2018
6488c53
Use sync version of zlib deflate method to compress png images
blikblum Dec 21, 2018
fe8632b
Add png-benchmark demo
blikblum Dec 21, 2018
56d4327
Merge pull request #886 from blikblum/improve-tests
blikblum Dec 21, 2018
4e90b87
Remove setTimeout call in PDFReference.finalize
blikblum Dec 21, 2018
52c3b45
Use property getter to define PDFPage lazy dictionaries
blikblum Dec 21, 2018
f2208a7
Add png unit tests
blikblum Dec 22, 2018
acef5e0
Merge pull request #887 from blikblum/remove-reference-timeout
blikblum Dec 23, 2018
8f1bb8c
Merge pull request #888 from blikblum/simplify-pdfpage
blikblum Dec 23, 2018
eb60ed1
Merge pull request #889 from blikblum/png-sync
blikblum Dec 23, 2018
faad6e8
Fix defining Mask for grayscale transparent PNG files
blikblum Dec 23, 2018
7c6134a
Add new png tests
blikblum Dec 23, 2018
ffdda49
Fix grayscale PNG images with alpha channel
blikblum Dec 23, 2018
acbeceb
Use a loop to copy png image data instead of Buffer.copy
blikblum Dec 23, 2018
2955161
Merge pull request #891 from blikblum/fix-grayscale-png
blikblum Dec 24, 2018
b7edc73
Fix 16bit png files with alpha channel
blikblum Dec 24, 2018
dfb5f93
Avoid code duplication in copy image data routine
blikblum Dec 24, 2018
b83371e
Merge pull request #893 from blikblum/fix-16bit-alpha
blikblum Dec 24, 2018
e3c7d64
Fix PDF corruption when adding PNG images with transparency (not alph…
blikblum Dec 24, 2018
ea7927c
Remove outdated Gratipay reference (#896)
ryjones Dec 26, 2018
147ebfd
Rename src to lib (compatible to fork)
diegomura Dec 28, 2018
87bdaef
Merge branch 'master' of github.com:foliojs/pdfkit into fork
diegomura Dec 28, 2018
5f42512
Apply changes needed for react-pdf
diegomura Dec 29, 2018
b1a15b2
Remove deprecated methods from document
diegomura Dec 29, 2018
eda7bc5
Resolve conflicts with foliojs master
diegomura Dec 29, 2018
ec35445
Add browser check for PDF images
diegomura Dec 29, 2018
49f2c5c
Restore page margins constant
diegomura Dec 29, 2018
4d4a191
Merge pull request #895 from blikblum/fix-png-finalize
blikblum Dec 29, 2018
8ee8aa9
Add contributing, issue and pull request templates
blikblum Dec 31, 2018
43796e0
Merge pull request #898 from blikblum/master
blikblum Jan 7, 2019
a6af764
Add prettier npm script and run it in *.js files
blikblum Jan 7, 2019
5d527a3
Merge pull request #900 from blikblum/master
blikblum Jan 7, 2019
15636ee
Update version to 0.9.0 (#901)
blikblum Jan 28, 2019
64d2fb8
A few docs fixes
devongovett Jan 28, 2019
9d9e94b
Commit yarn.lock
devongovett Jan 28, 2019
ee3fa44
Upgrade fontkit
devongovett Jan 28, 2019
83c5557
fix printing permission
liborm85 Feb 10, 2019
82a76ff
Merge pull request #917 from liborm85/security-printing-fix
blikblum Feb 10, 2019
7ac7196
Upgrade to latest browserify
blikblum Feb 16, 2019
5e923db
Merge pull request #924 from blikblum/update-browserify
blikblum Feb 16, 2019
f52cca9
Use valueOf when converting String object values
blikblum Feb 16, 2019
288e22c
Merge pull request #925 from blikblum/master
blikblum Feb 16, 2019
bd0631f
Add option to defined default font
blikblum Mar 2, 2019
a8f796b
Add documentation for default font option
blikblum Mar 2, 2019
91d3f95
Merge pull request #934 from blikblum/add-default-font
blikblum Mar 2, 2019
43ce902
Do not call fontkit.openSync
blikblum Mar 3, 2019
819c51d
Merge pull request #935 from blikblum/master
blikblum Mar 3, 2019
e2c9459
Add changelog and improve Get Started document
blikblum Mar 3, 2019
ee62958
Add Update Changelog entry to PULL REQUEST template
blikblum Mar 3, 2019
ffaec16
Merge pull request #936 from blikblum/add-default-font
blikblum Mar 3, 2019
b4be0c4
Add standalone virtual file system implementation
blikblum Mar 3, 2019
b3a943b
Add fontCache option
blikblum Mar 3, 2019
dae45a4
Rename fontCache to fontLayoutCache
blikblum Mar 3, 2019
d79240b
Merge pull request #937 from blikblum/virtual-fs
blikblum Mar 3, 2019
38d9a2a
Merge pull request #938 from blikblum/font-cache
blikblum Mar 3, 2019
1e62e6f
Cleanup remaining artifacts from CoffeScript conversion
blikblum Mar 3, 2019
a704eda
Merge pull request #939 from blikblum/cleanup
blikblum Mar 3, 2019
8ffaef6
Update tests snapshots and cleanup cyrilic string in text test
blikblum Mar 4, 2019
1f5565d
Merge pull request #940 from blikblum/update-tests
blikblum Mar 4, 2019
9b25601
merge upstream with conflicts
maxaggedon Apr 10, 2019
d1221f0
resolve conflicts
maxaggedon Apr 10, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": [["env", {"modules": false, "targets": {"node": "6.10"}}]],
"env": {
"test": {
"presets": [["env", {"targets": {"node": "6.10"}}]]
}
}
}
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "eslint:recommended"
}
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug Report
about: Report runtime errors or wrong PDF output
---

# Bug Report


## Description of the problem


## Code sample
<!-- Post code or a link to a live example (can fork from https://repl.it/@blikblum/minimal-pdfkit) that reproduces the issue -->


## Your environment

* pdfkit version:
* Node version:
* Browser version (if applicable):
* Operating System:
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Feature Request
about: Request new features
---

# Feature Request

## Feature description
<!-- How the feature should work? -->

<!-- You have examples or an idea how it can be implemented? -->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Question
about: Ask about pdfkit
---

# Question

## Description

<!--- Provide your question or other information that will help in solving here -->

## Code sample
<!-- Post code or a link to a live example (can fork from https://repl.it/@blikblum/minimal-pdfkit) -->

## Your environment

* pdfkit version:
* Node version:
* Browser version (if applicable):
* Operating System:
35 changes: 35 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
Please make sure you are familiar with and follow the instructions in the
contributing guidelines (found in the CONTRIBUTING.md file).

Please fill out the information below to expedite the review and (hopefully)
merge of your pull request!
-->

<!-- Is it a Bug fix, feature, docs update, ... -->

**What kind of change does this PR introduce?**

<!-- You can also link to an open issue here -->

**What is the current behavior?**

<!-- if this is a feature change -->

**What is the new behavior?**

<!-- Have you done all of these things? -->

**Checklist**:

<!-- add "N/A" to the end of each line that's irrelevant to your changes -->
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->

- [ ] Tests (preference for unit tests)
- [ ] Documentation
- [ ] Update CHANGELOG.md
- [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->

<!-- feel free to add additional comments -->

<!-- Thank you for contributing! -->
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ demo/bundle.js
!demo/browser.html
dist
*.b64.afm
.vscode
coverage
tests/integration/__pdfs__
tests/integration/pdfmake/__pdfs__
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ demo/
lib/
docs/
playground/
.vscode/
coverage/
tests/
index.js
index.html
yarn.lock
rollup.config.js
.eslintrc
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## pdfkit changelog

### Unreleased

- Fix setting printing permission
- Fix corruption of string objects in browser
- Add option to set default font
- Remove call to fontkit.openSync
- Add standalone virtual file system implementation

### [v0.9.0] - 2019-1-28

- Convert to code base from coffescript to ES6+
- Fix loading grayscale / transparent PNG files
- Reduce number of calls to async functions
- Implement encryption / access control
83 changes: 83 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Contributing to pdfkit

## Table of Contents

- [Contributing to pdfkit](#contributing-to-pdfkit)
- [Table of Contents](#table-of-contents)
- [Code Organization](#code-organization)
- [Setting Up the project locally](#setting-up-the-project-locally)
- [Running and writing tests](#running-and-writing-tests)
- [Submitting a Pull Request](#submitting-a-pull-request)


## Code Organization

pdfkit is organized in the following folders:

- `lib`: The actual source code.
- `js`: The built / distributable code.
- `docs`: Code and artifacts to generate documentation.
- `demo`: Node and browser demos.
- `tests/unit`: Tests behavior of specific classes / methods.
- `tests/integration`: Compare the pdf output against a reference.

**Working on your first Pull Request?** You can learn how from this _free_ series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)

## Setting Up the project locally

To install the project you need to have `node`

1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork:

```
# Clone your fork
git clone https://github.com/<your-username>/pdfkit.git

# Navigate to the newly cloned directory
cd pdfkit
```

2. `npm install` to install dependencies
3. `npm run build` to build the library
4. `npm run demo` to run the demo (check demo/out.pdf)
5. `npm run demo-browser` to run the browser demo (check demo/browser.html)

> Tip: Keep your `master` branch pointing at the original repository and make
> pull requests from branches on your fork. To do this, run:
>
> ```
> git remote add upstream https://github.com/foliojs/pdfkit.git
> git fetch upstream
> git branch --set-upstream-to=upstream/master master
> ```
>
> This will add the original repository as a "remote" called "upstream,"
> then fetch the git information from that remote, then set your local `master`
> branch to use the upstream master branch whenever you run `git pull`.
> Then you can make all of your pull request branches based on this `master`
> branch. Whenever you want to update your version of `master`, do a regular
> `git pull`.

## Running and writing tests

Tests are run using [Jest](http://jestjs.io/) and are categorized as integration and unit tests.

Integration tests check the pdf output against a reference stored as snapshots. While is served well to avoid regressions it has some disadvantages like small (correct) changes requiring to update all snapshots

Unit tests checks behavior os specific classes / methods isolatedly. It covers relatively small portion of code but is preferred way of writing new tests going forward

Tests commands
* `npm run test`: Run all tests
* `npm run test:unit`: Run unit tests
* `npm run test:integration`: Run integration tests

To write new tests, look for the *.spec.js files at `test/unit` and `test/integration` as examples


## Submitting a Pull Request

Please go through existing issues and pull requests to check if somebody else is already working on it.

Also, make sure to run the tests and lint the code before you commit your changes.

**Preferentially, tests should be added to check the changed behavior even if is a bug fix. Unit tests are preferred over integration ones**
Loading