PDFileSpec objects can be created from ASPathName objects or from Cos objects.
typedef
OPAQUE_64_BITS
PDFileSpec
;
ASPathName
PDFileSpecAcquireASPathProc(
void
*
fileSpecHandlerObj
,
PDFileSpec
fileSpec
,
ASPathName
relativeToThisPath
);
fileSpecHandlerObj | IN/OUT User-supplied data passed in the call to PDRegisterFileSpecHandler().
|
fileSpec | IN/OUT The PDFileSpec for which an ASPath is acquired.
|
relativeToThisPath | IN/OUT A path name relative to which the PDFileSpec is interpreted. If
NULL , fileSpec is assumed to be an absolute path, not a relative path. |
PDFileSpec
PDFileSpecNewFromASPathProc(
void
*
fileSpecHandlerObj
,
PDDoc
pdDoc
,
ASPathName
path
,
ASPathName
relativeToThisPath
);
fileSpecHandlerObj | User-supplied data passed in the call to PDRegisterFileSpecHandler().
|
pdDoc | The PDDoc in which the file specification is created.
|
path | The ASPathName for which a corresponding file specification is created.
|
relativeToThisPath | A path name relative to which path is interpreted. If
NULL , path is assumed to be an absolute path, not a relative path. |
NULL
, no launch action is performed. ASBool
PDLaunchActionProc(
void
*
fileSpecHandlerObj
,
PDDoc
pdDoc
,
PDAction
pdAction
);
fileSpecHandlerObj | IN/OUT The registered PDFileSpecHandler.
|
pdDoc | IN/OUT The document containing the Launch action.
|
pdAction | IN/OUT The action dictionary.
|
| |
Must be
sizeof(PDFileSpecHandlerRec) . | |
The file system that is to be used with this file specification handler.
| |
|
ASPathName
PDFileSpecAcquireASPath(
PDFileSpec
fileSpec
,
ASPathName
relativeToThisPath
);
fileSpec | IN/OUT The file specification for which an ASPathName is acquired.
|
relativeToThisPath | IN/OUT A path name relative to which the
fileSpec is interpreted. If it is NULL , fileSpec is assumed to be an absolute, not a relative, path. |
The ASPathName corresponding to fileSpec
.
After you are done using the ASPathName, you must free it using ASFileSysReleasePath().
ASPathName
PDFileSpecAcquireASPathEx(
PDFileSpec
fileSpec
,
ASFileSys
relPathFileSys
,
ASPathName
relativeToThisPath
,
ASFileSys
*
retFileSys
,
ASBool
pathMustExist
);
fileSpec | IN/OUT The file specification for which an ASPathName is acquired.
|
relPathFileSys | The file system that owns
relativeToThisPath . |
relativeToThisPath | IN/OUT A path name relative to which the
fileSpec is interpreted. If it is NULL , fileSpec is assumed to be an absolute, not a relative, path. If it is not NULL and fileSys and relPathFileSys are not the same, then an attempt is made to fabricate a relPathName in terms of fileSys , and if that is not possible, NULL is used. |
retFileSys | IN/OUT The file system that owns the returned ASPathName.
|
pathMustExist |
The ASPathName corresponding to fileSpec
.
After you are done using the ASPathName, you must free it using ASFileSysReleasePath().
PDFileSpec
PDFileSpecFromCosObj(
CosObj
obj
);
obj | IN/OUT The Cos object to convert to a file specification.
|
obj
. is raised if the file specification is not valid, as determined by PDFileSpecIsValid().
|
CosObj
PDFileSpecGetCosObj(
PDFileSpec
fileSpec
);
fileSpec | IN/OUT The file specification whose Cos object is obtained.
|
ASInt32
PDFileSpecGetDIPath(
PDFileSpec
fileSpec
,
char
*
buffer
,
ASInt32
bufLen
);
fileSpec | IN/OUT The file specification whose device-independent path name is obtained.
|
buffer | |
bufLen | IN/OUT The length of
buffer in bytes. If the device- independent path name is longer than this, only the first bufLen - 1 bytes are copied into buffer , plus a NULL at the end of the buffer. |
NULL
) copied into buffer
. void
PDFileSpecGetDIPathEx(
PDFileSpec
fileSpec
,
ASText
diPath
);
fileSpec | IN The file specification whose device-independent path name is obtained.
|
diPath | IN/OUT An existing ASText object whose content is set to the path name obtained from from
fileSpec . |
fileSpec
. PDDoc
PDFileSpecGetDoc(
PDFileSpec
fileSpec
);
fileSpec | IN/OUT A PDFileSpec in a document.
|
ASFileSys
PDFileSpecGetFileSys(
PDFileSpec
fileSpec
);
fileSpec | IN/OUT The file specification whose file system is obtained.
|
fileSpec
. Gets the name of the file system that a PDFileSpec belongs to. For a simple fileSpec
(string form), the name of the file system is the name of the document's file system if the CosObj that is the fileSpec
is contained in a document. For a complex fileSpec
(dictionary form) with an FS key, the name of the file system is the atom associated with the FS key.
The file system returned by PDFileSpecGetFileSys() is the file system that has registered a PDFileSpecHandler() for the file specification's file system name (if there is one), and is not necessarily the same as ASFileGetFileSysByName
(PDFileSpecGetFileSysName(fileSpec));
.
ASAtom
PDFileSpecGetFileSysName(
PDFileSpec
fileSpec
);
fileSpec | A PDFileSpec.
|
fileSpec
. ASBool
PDFileSpecIsValid(
PDFileSpec
fileSpec
);
fileSpec | The file specification whose validity is tested.
|
PDFileSpec
PDFileSpecNewFromASPath(
PDDoc
pdDoc
,
ASFileSys
fileSys
,
ASPathName
path
,
ASPathName
relativeToThisPath
);
pdDoc | The document in which the new file specification will be used.
|
fileSys | A pointer to an ASFileSysRec specifying the file system responsible for the newly created file specification.
|
path | The path to convert into a file specification.
|
relativeToThisPath | A path name relative to which
path is interpreted. If it is NULL , path is interpreted as an absolute path name, not a relative path name. |
PDFileSpec
PDFileSpecNewFromASPathEx(
PDDoc
pdDoc
,
ASFileSys
fileSys
,
ASPathName
path
,
ASFileSys
relPathFileSys
,
ASPathName
relativeToThisPath
);
pdDoc | The document in which the new file specification will be used.
|
fileSys | A pointer to an ASFileSysRec specifying the file system responsible for the newly created file specification.
|
path | The path to convert into a file specification.
|
relPathFileSys | The file system that owns
relativeToThisPath . |
relativeToThisPath | A path name relative to which the
fileSpec is interpreted. If it is NULL , fileSpec is assumed to be an absolute, not a relative, path. If it is not NULL and fileSys and relPathFileSys are not the same, then an attempt is made to fabricate a relPathName in terms of fileSys , and if that is not possible, NULL is used. |
void
PDRegisterFileSpecHandler(
ASFileSys
contextFileSys
,
PDFileSpecHandler
fileSpecHandler
,
void
*
fileSpecHandlerObj
);
contextFileSys | The file system that specifies the context in which the file specification handler is used. This is the file system on which the PDF document resides. It is sometimes necessary to use different file specification handlers depending on the file system in which the document is open. For example, when a document is opened in a web browser, the Acrobat viewer may use the browser's HTTP stack when it needs to use HTTP. When a document is opened outside of the browser, however, the Acrobat viewer must use a different HTTP stack.
|
fileSpecHandler | A pointer to a structure that contains the handler's callbacks. This structure must not be freed after calling PDRegisterFileSpecHandler().
|
fileSpecHandlerObj | A pointer to user-supplied data to pass to the file specification handler's callbacks each time they are called.
|
Registers a new file specification handler with the Acrobat viewer. The viewer calls the appropriate file specification handler when it encounters a file specification in a PDF file. The appropriate file specification handler is the one whose specSysName
matches the value of the FS key in the file specification and whose contextFileSys
matches the file system on which the PDF file resides.
The file specification handler's file system, (passed as the fileSys
field of fileSpecHandler
), is used to obtain data from, or write data to, the file referred to by the file specification.
void
PDRegisterFileSpecHandlerByName(
ASAtom
specSysName
,
ASFileSys
contextFileSys
,
PDFileSpecHandler
fileSpecHandler
,
void
*
fileSpecHandlerObj
);
specSysName | The name (as an ASAtom) of a file system with which this file specification works.
|
contextFileSys | The file system that specifies the context in which the file specification handler is used. This is the file system on which the PDF document resides. It is sometimes necessary to use different file specification handlers depending on the file system in which the document is open. For example, when a document is opened in a web broswer, the Acrobat viewer may use the browser's HTTP stack when it needs to use HTTP. When a document is opened outside of the browser, however, the Acrobat viewer must use a different HTTP stack.
|
fileSpecHandler | A pointer to a structure that contains the handler's callbacks. This structure must not be freed after calling PDRegisterFileSpecHandlerByName().
|
fileSpecHandlerObj | A pointer to user-supplied data to pass to the file specification handler's callbacks each time they are called.
|