Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

PDFKit.GetPDFAttribute

Queries a PDF attribute.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
PDFKit 2.3 Yes No Yes, macOS only No Yes

MBS( "PDFKit.GetPDFAttribute"; PDF; Key )

Parameters

Parameter Description Example value
PDF A container value with the PDF content from a media field. Or a text with an URL. Or a PDF reference from PDFKit.Open.
Key Which information to query. This can be one of the following: Title, Subject, Author, Creator, Producer, Keywords, CreationDate or ModificationDate. "Title"

Result

Returns the text or date value requested.

Description

Queries a PDF attribute.
New keys in v5.4: OwnerPassword, UserPassword, EncryptionKeyLength, AllowsPrinting and AllowsCopying.

KeyDescription
TitleThe document's title. Optional; if present, the value of this key must be a text.
AuthorThe name of the person who created this document. Optional; if present, the value of this key must be a text.
SubjectThe subject of a document. Optional; if present, the value of this key must be a text.
KeywordsThe keywords for this document. This key is optional. Must be the keywords with comma separated.
CreatorThe name of the application that created the original data used to create this document. Optional; if present, the value of this key must be a text.
OwnerPasswordThe "owner password" of the PDF document. If this key is specified, the document will be encrypted using the value as the owner password; otherwise, the document will not be encrypted. The value of this key must be a text which can be represented in ASCII encoding; only the first 32 bytes will be used for the password. There is no default value for this key. If the value of this key cannot be represented in ASCII, the document will not be created and the creation function will fail.
UserPasswordThe "user password" of the PDF document. If the document is encrypted, then the value of this key will be the user password for the document; if unspecified, the user password will be the empty string. The value of this key must be a text which can be represented in ASCII encoding; only the first 32 bytes will be used for the password. If the value of this key cannot be represented in ASCII, the document will not be created and the creation function will fail.
EncryptionKeyLengthSpecifies the encryption key length in bits; see Table 3.18 "Entries common to all encryption dictionaries", PDF Reference: Adobe PDF version 1.5 (4th ed.) for more info. Optional; if present, the value of this key must be a number with value which is a multiple of 8 between 40 and 128, inclusive. If this key is absent or invalid, the encryption key length defaults to 40 bits.
AllowsPrintingUsed to specify whether the document allows printing when unlocked with the user password. The value of this key must be a boolean. The default value of this key is 1 (true).
AllowsCopyingUsed to specify whether the document allows copying when unlocked with the user password. The value of this key must be a boolean. The default value of this key is 1 (true).

If you need more control about encryption, restrictions or metadata, you may want to checkout our DynaPDF functions in the plugin.

Examples

Get all the information values for a PDF in a container:

"Title: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "Title") & "¶" &
"Subject: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "Subject") & "¶" &
"Author: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "Author") & "¶" &
"Creator: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "Creator") & "¶" &
"Producer: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "Producer") & "¶" &
"Keywords: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "Keywords") & "¶" &
"CreationDate: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "CreationDate") & "¶" &
"ModificationDate: " & MBS("PDFKit.GetPDFAttribute"; combine pdf::test1; "ModificationDate")

See also

Example Databases


PDFKit.GetIgnoreCombineErrors   -   PDFKit.GetPDFDocument

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins