Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwhitington committed Aug 17, 2022
1 parent 636ace2 commit 10530ba
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
20 changes: 12 additions & 8 deletions cpdfdocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
Use
---
cpdf.js can be used from both node and the browser.
coherentpdf.js can be used from both node and the browser.
For development server-side with node: `cpdf.js` (minified version
`cpdf.min.js`) Load with `const cpdf = require('cpdf.js')` if installed in npm,
or `const cpdf = require('./cpdf.js')` to load from current directory.
The file `cpdflibtest.js` uses every function in coherentpdf.js. Call `./run`
to run it in node.
For development client-side with the browser : `cpdf.browser.js` (minified
version for deployment : `cpdf.browser.min.js`). Load with `<script
src="cpdf.browser.js"></script>` or similar.
For development server-side with node: `coherentpdf.js` (minified version
`coherentpdf.min.js`). Load with `const coherentpdf = require('coherentpdf')`
if installed in npm, or `const coherentpdf = require('./coherentpdf.js')` to
load from current directory.
For development client-side with the browser : `coherentpdf.browser.js`
(minified version for deployment : `coherentpdf.browser.min.js`). Load with
`<script src="coherentpdf.browser.js"></script>` or similar.
Data types
Expand All @@ -37,7 +41,7 @@ Any function may raise an exception, containing a string describing the problem.
Concurrency
-----------
cpdf.js is synchronous and non-re-entrant. In the browser, best used in a worker.
coherentpdf.js is synchronous and non-re-entrant. In the browser, best used in a worker.
**/

// CHAPTER 0. Preliminaries
Expand Down
17 changes: 17 additions & 0 deletions example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//Merge example

//Load coherentpdf.js
const coherentpdf = require('./coherentpdf.js');

//Load the file hello.pdf from the current directory
var pdf = coherentpdf.fromFile('hello.pdf', '');

//Merge three copies of it
var merged = coherentpdf.mergeSimple([pdf, pdf, pdf]);

//Write to merged.pdf
coherentpdf.toFile(merged, 'merged.pdf', false, false);

//Clean up the two PDFs
coherentpdf.deletePdf(pdf);
coherentpdf.deletePdf(merged);
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "coherentpdf",
"version": "2.5.4",
"version": "2.5.5",
"description": "Read, write and modify PDF files",
"main": "cpdf.js",
"main": "coherentpdf.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/coherentgraphics/cpdf.js.git"
"url": "git+https://github.com/coherentgraphics/coherentpdf.js.git"
},
"keywords": [
"pdf",
Expand All @@ -17,7 +17,7 @@
"author": "Coherent Graphics Ltd",
"license": "AGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/coherentgraphics/cpdf.js/issues"
"url": "https://github.com/coherentgraphics/coherentpdf.js/issues"
},
"homepage": "https://github.com/coherentgraphics/cpdf.js#readme"
"homepage": "https://github.com/coherentgraphics/coherentpdf.js#readme"
}

0 comments on commit 10530ba

Please sign in to comment.