Aspose.PDF FOSS for TypeScript — Frequently Asked Questions

Aspose.PDF FOSS for TypeScript — Frequently Asked Questions

Licensing & Open Source

What is the licensing model for Aspose.PDF FOSS for TypeScript?

Aspose.PDF FOSS for TypeScript is released under the MIT license. Source code is published on GitHub, and there is no evaluation watermark, usage limit, or separate license file to manage.

Can I use it in commercial products?

Yes. The MIT license permits use in commercial products without royalties or attribution requirements beyond preserving the license notice.


Installation & Requirements

How do I install Aspose.PDF FOSS for TypeScript?

asposefoss/pdf is not yet published — build from source until it ships. See the project README for build instructions.

What Node.js versions are supported?

Node.js 22 or later is required.

Are there any other runtime dependencies?

No. The package is zero-dependency — Node.js is the only runtime requirement.


Format Support

Which formats can Aspose.PDF FOSS for TypeScript read and write?

The library reads and writes PDF, and can also read and write Markdown, SVG, and TIFF. It can also generate DOCX, HTML, PNG, and EPUB output, though it does not read those four formats back in.

Can I convert a PDF to Markdown or HTML?

Yes. Document.ToMarkdown() renders a whole document to GitHub-flavored Markdown, and Document.ToHtml() renders it to standalone semantic HTML.

Can I render PDF pages to images?

Yes. Page.ToImage() renders a single page to raster PNG bytes, and Page.ToSvg() renders a page to standalone SVG.


API Usage

What is the main entry point for working with a PDF document?

The Document class. Document.OpenFile() opens a PDF from a file path, Document.Open() accepts in-memory bytes, and Document.New() starts a blank document.

How do I create a new PDF from scratch?

Call Document.New() with a PageFormat, then add content with methods like Page.AddText() and Document.AddPage():

import { Document, PageFormat } from '@asposefoss/pdf';
const doc = Document.New(PageFormat.A4);          // one blank A4 page
doc.Pages[0].AddText('Hello', 72, 720, { fontSize: 14 });
doc.AddPage(PageFormat.A4.landscape());           // append more as you go
doc.WriteTo('scratch.pdf');

How do I add annotations to a page?

Each Page exposes annotation methods directly, such as Page.AddHighlight(), Page.AddTextNote(), Page.AddFreeText(), and Page.AddStamp(). Typed subtypes like MarkupAnnotation and StampAnnotation expose a Flatten() method to bake the annotation into page content.

How do I encrypt a PDF when saving it?

Pass an encrypt option to Document.WriteTo() with algorithm: 'aes256' | 'aes128' | 'rc4', an optional user/owner password pair, and granular Permissions.

How do I redact sensitive content from a PDF?

Document.Redact() and Document.RedactText() mark and permanently remove sensitive regions or matched text; Page.ApplyRedactions() applies marks added earlier. Both are configured through RedactOptions.


Known Limitations

Is the API stable?

Not yet. The package is currently at version 0.1.0 and under active early-stage development, so API signatures may evolve before a stable release.

Does the library have any documented unimplemented features?

As of this writing, no unimplemented or stub methods were detected in the library’s source.

See Also