Frequently Asked Questions
What is the licensing model for Aspose.PDF FOSS for Python?
Aspose.PDF FOSS for Python is MIT-licensed. It is free to use in commercial and non-commercial products, with no activation key, API call limits, or commercial agreement required.
Can I use it in commercial products?
Yes. The MIT license permits use, modification, and redistribution in commercial products without royalties or attribution beyond the license notice.
How do I install Aspose.PDF FOSS for Python?
Install it from PyPI with pip:
pip install aspose-pdf-foss-for-pythonVerify the install:
import aspose_pdf
print("aspose_pdf OK")What Python versions are supported? Are there any native dependencies?
The library requires Python 3.11 or later. It is a pure-Python package — no compiled extension modules or native (C/C++) dependencies are required at install or runtime.
Which formats can Aspose.PDF FOSS for Python read and write?
Native PDF documents are the core format: Document opens and saves PDF
files directly. Beyond PDF, the library can export a document to HTML,
Markdown, or SVG by passing a DocFormat value to Document.save(), and it
can import Html, Cdr, Svg, Cgm, and Ofd source content via the matching
*LoadOptions classes (HtmlLoadOptions, CdrLoadOptions,
CgmLoadOptions, OfdLoadOptions). Rendered PDF pages can also be exported
to raster images through RasterizedPage.
Can I export a PDF to HTML, Markdown, or SVG?
Yes, for HTML and Markdown export; pass the matching DocFormat enum member
to Document.save(), optionally paired with HtmlSaveOptions or
MarkdownSaveOptions to control layout details such as
split_into_pages or extract_images.
import aspose_pdf
doc = aspose_pdf.Document()
doc.load_from("input.pdf")
doc.save("output.html", save_format=aspose_pdf.DocFormat.HTML)How do I open a PDF and check its page count?
import aspose_pdf
doc = aspose_pdf.Document()
doc.load_from("input.pdf")
print(doc.page_count)How do I create a new PDF from scratch?
Instantiate Document, append pages with doc.pages.add(), place content
with Page.add_text() or Page.add_image(), then call Document.save():
import aspose_pdf
doc = aspose_pdf.Document()
page = doc.pages.add()
page.add_text("Monthly Report", x=72, y=720, font_size=18)
doc.save("report.pdf")How do I render a PDF page to an image?
Call Document.save_page_as_image() with a zero-based page index and a
destination path; the DPI controls output resolution:
import aspose_pdf
doc = aspose_pdf.Document()
doc.load_from("input.pdf")
doc.save_page_as_image(0, "page1.png", dpi=150)How do I extract text from a PDF?
Use TextAbsorber (or TextFragmentAbsorber), visit the document, then
read the collected text:
import aspose_pdf
doc = aspose_pdf.Document()
doc.load_from("input.pdf")
absorber = aspose_pdf.TextAbsorber()
absorber.visit(doc)
print(absorber.text)How do I encrypt a PDF document?
Call Document.encrypt() with a user password, an owner password, and a
permissions value:
import aspose_pdf
doc = aspose_pdf.Document()
doc.load_from("input.pdf")
doc.encrypt(user_password="user-pw", owner_password="owner-pw", permissions=0)
doc.save("encrypted.pdf")Document.decrypt(password) removes encryption from an already-open
document, and Document.change_passwords() rotates both passwords in
place.
How do I read or fill AcroForm field values?
Access the document’s form property and iterate Form.fields, or add new
fields with Form.add_text_field(), Form.add_checkbox(), and related
methods:
import aspose_pdf
doc = aspose_pdf.Document()
doc.load_from("submitted_form.pdf")
for field in doc.form.fields:
print(field.name, "=", field.value)Are there any known limitations in the current release?
Yes. Five methods across four classes are unimplemented stubs in the
current release: Shading._color_at, FontSource.get_font_definitions
(and its subclasses FileFontSource, FolderFontSource,
MemoryFontSource, SystemFontSource, which inherit the same stub),
DataSource.read_bytes and DataSource.write_bytes (and their subclasses
FileDataSource, StreamDataSource, ByteArrayDataSource), and
PdfPlugin.process. Calling these raises NotImplementedError rather than
performing the documented operation. See the
Troubleshooting page for details and workarounds.
Where is the source code and issue tracker?
The source code and issue tracker are available at
https://github.com/aspose-pdf-foss/Aspose-PDF-FOSS-for-Python.