tinyweb-office-pdf
v0.1.0
Published
Pure TypeScript PDF library (ISO 32000-1), ported from Aspose.PDF-FOSS-for-Java
Maintainers
Readme
tinyweb-office-pdf
Pure TypeScript PDF library for Node.js (ISO 32000-1:2008). Ported from Aspose.PDF-FOSS-for-Java with an Aspose-shaped public API.
Status: early 0.x — COS, create/open/save, text, tables, drawing, AcroForm, annotations, encryption, PKCS#7 signatures.
Requirements
- Node.js 20+
- Zero runtime dependencies
Install
npm install tinyweb-office-pdfQuick start
import { Document, TextFragment } from 'tinyweb-office-pdf';
const doc = new Document();
const page = doc.getPages().add();
page.getParagraphs().add(new TextFragment('Hello, PDF world!'));
await doc.save('output.pdf');
await doc.dispose();Open existing PDF
const doc = await Document.open('input.pdf');
console.log(doc.getPages().size());
await doc.dispose();Design notes
- Public API mirrors Aspose names (
Document,getPages(), 1-based page index). - File I/O is async (
Document.open,doc.save). - PDF dictionaries/arrays are the single source of truth.
- See
.manager/plans/0001-port-aspose-pdf-to-tinyweb-office-pdf.mdfor the full port roadmap.
Development
npm install
npm run typecheck
npm test
npm run buildRelease / publish (npm)
Flow mirrors tinyweb-office-words:
- Secret: set repo secret
NPM_TOKEN(npm automation token with publish rights). - CI on push to
main/master: typecheck → test (Node 20/22) → build → publish ifpackage.jsonversion is not yet on npm (npm publish --provenance --access public). - Bump version: Actions → Version Bump & Release → choose patch/minor/major (commits tag + GitHub Release). The following push to main triggers publish.
- Manual publish: Actions → Manual Publish (optional dry-run).
Local:
npm run version:patch # or version:minor / version:major
npm run release # build + test + publish