- Name
-
pdf.GetObjectType -- get PDF document object type
- Synopsis
-
type = pdf.GetObjectType()
- Function
-
This function returns the object type used by PDF documents loaded using the pdf.OpenDocument()
function. You can then use this object type with functions from Hollywood's object library
such as
GetAttribute()
, SetObjectData()
, GetObjectData()
, etc.
In particular, Hollywood's GetAttribute()
function may be used to query certain properties of
PDF documents loaded using pdf.OpenDocument(). The following attributes are currently supported
by GetAttribute()
for PDF documents:
#PDFATTRPAGES:
-
Returns the number of pages in the document.
#PDFATTRVERSION:
-
Returns the PDF version this document uses. This will be an integer number, e.g. 14 for 1.4, 15
for 1.5, etc. (V1.1)
#PDFATTRPERMISSIONS:
-
Returns a 32-bit integer describing the document's permission flags. Please refer to the
PDF Reference for detailed descriptions on permissions. (V1.1)
- Inputs
-
none
- Results
-
- type
- internal PDF document type for use with Hollywood's object library
- Example
-
pdf.OpenDocument(1, "test.pdf")
PDF_DOCUMENT = pdf.GetObjectType()
numpages = GetAttribute(PDF_DOCUMENT, 1, #PDFATTRPAGES)
The code above opens test.pdf
and queries the number of pages in the document
via GetAttribute()
.