Code Monkey home page Code Monkey logo

coherentpdf.js's Introduction

coherentpdf.js

A JavaScript library for editing PDF files. For example:

  • Quality Split and Merge, keeping bookmarks. Extract pages. Split on Bookmarks.
  • Impose files n-up
  • Create new PDFs. Convert text files to PDF
  • Losslessly squeeze files to reduce their size
  • Encrypt and Decrypt (including AES 128 and AES 256 encryption)
  • Read and set info and metadata from a PDF file. Set and read XMP Metadata.
  • Scale, rotate, crop and flip pages. Scale pages to fit.
  • Copy, Remove and Add bookmarks. Build table of contents from bookmarks.
  • Stamp logos, shapes, watermarks, page numbers and multiline text. Transparency.
  • List, copy or remove annotations
  • Add and remove file attachments to document or page. Extract attachments.
  • Thicken hairlines, blacken text, make draft documents
  • Reconstruct malformed files
  • Detect missing fonts, low resolution images. Remove images. Extract images.
  • Add printer's marks
  • Add, modify, remove, or print page labels.
  • Export PDF file to / Import PDF file from JSON.
  • Manipulate optional content groups

The files in dist/ and the file coherentpdf.js are distributed under the AGPL - see LICENSE.md. Check if you need a commercial license.

https://www.coherentpdf.com/

For commercial licenses, email [email protected]

Use

coherentpdf.js can be used from both node and the browser.

The file cpdflibtest.js uses every function in coherentpdf.js. Call ./run to run it in node.

In the dist/ directory:

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.

Documentation

  1. cpdfjsmanual.pdf contains the API documentation interleaved with the coherentpdf.js API. This is the primary source of documentation:

    https://coherentpdf.com/cpdfjsmanual.pdf

    The command line tools can be found at:

    https://community.coherentpdf.com/

  2. API documentation online at

    https://www.coherentpdf.com/jscpdf/index.html

Data types

Arguments are numbers, strings, or arrays (of type UInt8Array for data). Page ranges are represented by arrays of numbers.

Memory Management

A PDF p must be explicitly deallocated with deletePdf(p).

Errors

Any function may raise an exception, containing a string describing the problem.

Concurrency

coherentpdf.js is synchronous and non-re-entrant. In the browser, best used in a worker.

Examples

Server-side: cpdflibtest.js tests every function in coherentpdf.js.

Client-side: index.html is an interactive browser example with the worker cpdfworker.js. You will need to run this from a real server, for example http-server, rather than just loading index.html directly.

Contact

https://www.coherentpdf.com/

For commercial licenses, email [email protected]

coherentpdf.js's People

Contributors

johnwhitington avatar

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.