Commit 7f6a94d9 authored by Nathanael Noblet's avatar Nathanael Noblet Committed by Albert Astals Cid

Add additional info functions to poppler-document object in CPP

Allow querying if the document has Javascript and which type of forms it contains
parent 42d5e541
Pipeline #90116 passed with stage
in 18 minutes and 34 seconds
......@@ -982,6 +982,42 @@ font_iterator* document::create_font_iterator(int start_page) const
return new font_iterator(start_page, d);
}
/**
Detects Javascript within the document
\returns true if the document contains javascript
\since 0.84
*/
bool document::has_js() const
{
return d->doc->getCatalog()->numJS() > 0;
}
/**
Detects if the document contains XFA forms
\returns true if the document contains XFA forms
\since 0.84
*/
bool document::has_xfa() const
{
return d->doc->getCatalog()->getFormType() == Catalog::XfaForm;
}
/**
Detects if the document contains AcroForm type forms
\returns true if the document contains AcroForm type forms
\since 0.84
*/
bool document::has_acroform() const
{
return d->doc->getCatalog()->getFormType() == Catalog::AcroForm;
}
/**
Reads the TOC (table of contents) of the %document.
......
......@@ -95,6 +95,10 @@ public:
bool is_encrypted() const;
bool is_linearized() const;
bool has_js() const;
bool has_xfa() const;
bool has_acroform() const;
bool has_permission(permission_enum which) const;
ustring metadata() const;
bool get_pdf_id(std::string *permanent_id, std::string *update_id) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment