Typedef | ||
---|---|---|
PDFileAttachment
A PDFileAttachment represents an embedded file stored in a PDF file, and may be stored at various locations in a PDF file, including the EmbeddedFiles name tree, FileAttachment annotation types, and Multimedia annotations.
|
Method | ||
---|---|---|
PDFileAttachment PDFileAttachmentFromCosObj(CosObj cosAttachment)
Converts a file specification dictionary to a PDFileAttachment object. An exception is raised if the parameter is not a file specification dictionary.
|
||
CosObj PDFileAttachmentGetCosObj(PDFileAttachment attachment)
Returns a CosObj representing the file specification dictionary of the file attachment.
|
||
Gets the creation date of the file attachment.
|
||
Gets the value of the specified date field in the file attachment.
|
||
Gets the value of the specified numeric field in the file attachment.
|
||
Gets the specified prefix field in the file attachment.
|
||
Gets the value of the specified text field in the file attachment.
|
||
Gets the value of the specified text field in the file attachment as styled text, in XML Text Layout Format.
|
||
Gets the value of the specified text field in the file attachment.
|
||
ASText PDFileAttachmentGetFileName(PDFileAttachment attachment)
Gets the file name of the file attachment.
|
||
ASUns32 PDFileAttachmentGetFileSize(PDFileAttachment attachment)
Returns the size, in bytes, that the file will occupy if exported to disk.
|
||
Gets the modification date of the file attachment.
|
||
ASBool PDFileAttachmentIsValid(PDFileAttachment attachment)
Tests a file attachment for validity.
|
||
PDFileAttachment PDFileAttachmentNewFromFile(CosDoc parentDoc, ASFile sourceFile, const ASAtom* filterNames, const ASArraySize numFilters, CosObj filterParams, ASProgressMonitor monitor, ASConstText monitorText, void* monitorData)
Creates a new file attachment from the given file. The resulting file specification dictionary is created for the given document, but is not referenced. The client must reference the resulting file specification dictionary by attaching it to another object in the PDF file, such as an annotation or name tree. An exception is raised if the file could not be read or the attachment stream could not be created.
|
||
ASStm PDFileAttachmentOpenStream(PDFileAttachment attachment)
Returns a stream for reading the data from an existing file attachment. An exception is raised if the file attachment does not have a stream (it is not embedded) or the stream could not be opened. The caller is responsible for closing the returned stream.
|
||
Copies the data embedded in the file attachment to the specified file. The file must be open for write or append. The caller is responsible for closing the file after this call returns. If an error is encountered during the write, some data may have been written to the destination file. This call will make no attempt at restoring the file after failure. An exception is raised if the file attachment has no embedded stream or if a file write error occurs.
|
||
void PDFileAttachmentSetFieldDate(PDFileAttachment attachment, ASAtom fieldID, const ASTimeRec* date)
Sets the specified date field in the file attachment.
|
||
Sets the specified numeric field in the file attachment.
|
||
Sets the specified prefix field in the file attachment. The prefix allows additional text to be prepended to the visual appearance of a field without affecting its actual value.
|
||
Sets the specified text field in the file attachment using styled text.
|
||
void PDFileAttachmentSetFieldStyledText(PDFileAttachment attachment, ASAtom fieldID, ASConstText text)
Sets the specified text field in the file attachment using styled text.
|
||
Sets the specified text field in the file attachment.
|
||
void PDFileAttachmentUpdateFromFile(PDFileAttachment attachment, ASFile sourceFile, ASProgressMonitor monitor, ASConstText monitorText, void* monitorData)
Updates a file attachment from the given file. The attachment uses the filters specified in the attachment to encode the data. An exception is raised if the file could not be read or the attachment stream could not be updated.
|
PDFileAttachment |
Product availability: All |
Platform availability: All |
typedef OPAQUE_64_BITS PDFileAttachment;
A PDFileAttachment
represents an embedded file stored in a PDF file, and may be stored at various locations in a PDF file, including the EmbeddedFiles
name tree, FileAttachment
annotation types, and Multimedia
annotations.
See Also
File: PDExpT.h |
Line: 6826 |
PDFileAttachmentFromCosObj | () |
Product availability: All |
Platform availability: All |
PDFileAttachment PDFileAttachmentFromCosObj(CosObj cosAttachment)
Converts a file specification dictionary to a PDFileAttachment
object. An exception is raised if the parameter is not a file specification dictionary.
Parameters
cosAttachment — | The |
The file attachment object. |
File: PDProcs.h |
Line: 12022 |
PDFileAttachmentGetCosObj | () |
Product availability: All |
Platform availability: All |
CosObj PDFileAttachmentGetCosObj(PDFileAttachment attachment)
Returns a CosObj
representing the file specification dictionary of the file attachment.
Parameters
attachment — | The file attachment object. |
The |
File: PDProcs.h |
Line: 12028 |
PDFileAttachmentGetCreationDate | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetCreationDate(PDFileAttachment attachment, ASTimeRec* date)
Gets the creation date of the file attachment.
Parameters
attachment — | The file attachment object. |
|
date — |
|
File: PDProcs.h |
Line: 12055 |
PDFileAttachmentGetFieldDate | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetFieldDate(PDFileAttachment attachment, ASAtom fieldID, ASTimeRec* date)
Gets the value of the specified date field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
date — |
|
File: PDProcs.h |
Line: 12153 |
PDFileAttachmentGetFieldNumber | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetFieldNumber(PDFileAttachment attachment, ASAtom fieldID, float* number)
Gets the value of the specified numeric field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
number — | The number that will receive the field value. |
|
File: PDProcs.h |
Line: 12136 |
PDFileAttachmentGetFieldPrefix | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetFieldPrefix(PDFileAttachment attachment, ASAtom fieldName, ASText prefix)
Gets the specified prefix field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldName — | The field identifier. |
|
prefix — | The text object that will receive the prefix. |
File: PDProcs.h |
Line: 12170 |
PDFileAttachmentGetFieldStyle | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetFieldStyle(PDFileAttachment attachment, ASAtom fieldID, ASCab styles)
Gets the value of the specified text field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
styles — | ASCab object that will receive the field styles |
|
File: PDProcs.h |
Line: 12119 |
PDFileAttachmentGetFieldStyledText | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetFieldStyledText(PDFileAttachment attachment, ASAtom fieldID, ASText text)
Gets the value of the specified text field in the file attachment as styled text, in XML Text Layout Format.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
text — |
|
File: PDProcs.h |
Line: 12102 |
PDFileAttachmentGetFieldText | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetFieldText(PDFileAttachment attachment, ASAtom fieldID, ASText text)
Gets the value of the specified text field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
text — |
|
File: PDProcs.h |
Line: 12094 |
PDFileAttachmentGetFileName | () |
Product availability: All |
Platform availability: All |
ASText PDFileAttachmentGetFileName(PDFileAttachment attachment)
Gets the file name of the file attachment.
Parameters
attachment — | The file attachment. |
An |
File: PDProcs.h |
Line: 12068 |
PDFileAttachmentGetFileSize | () |
Product availability: All |
Platform availability: All |
ASUns32 PDFileAttachmentGetFileSize(PDFileAttachment attachment)
Returns the size, in bytes, that the file will occupy if exported to disk.
Parameters
attachment — | The file attachment object |
The size of the file attachment. It returns |
File: PDProcs.h |
Line: 12045 |
PDFileAttachmentGetModDate | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentGetModDate(PDFileAttachment attachment, ASTimeRec* date)
Gets the modification date of the file attachment.
Parameters
attachment — | The file attachment object. |
|
date — | A pointer to a date that will receive the modification date. |
|
File: PDProcs.h |
Line: 12062 |
PDFileAttachmentIsValid | () |
Product availability: All |
Platform availability: All |
ASBool PDFileAttachmentIsValid(PDFileAttachment attachment)
Tests a file attachment for validity.
Parameters
attachment — | The file attachment. |
|
File: PDProcs.h |
Line: 11936 |
PDFileAttachmentNewFromFile | () |
Product availability: All |
Platform availability: All |
PDFileAttachment PDFileAttachmentNewFromFile(CosDoc parentDoc, ASFile sourceFile, const ASAtom* filterNames, const ASArraySize numFilters, CosObj filterParams, ASProgressMonitor monitor, ASConstText monitorText, void* monitorData)
Creates a new file attachment from the given file. The resulting file specification dictionary is created for the given document, but is not referenced. The client must reference the resulting file specification dictionary by attaching it to another object in the PDF file, such as an annotation or name tree. An exception is raised if the file could not be read or the attachment stream could not be created.
Note that permissions must be checked by the caller before invoking this function.
For example, to have an attachment flate compressed and then ASCII base-85 encoded:
ASAtom filterNames[2]; filterNames[0] = ASAtomFromString("ASCII85Decode"); filterNames[1] = ASAtomFromString("FlateDecode"); PDFileAttachmentNewFromFile(parentDoc, sourceFile, filterNames, 2, CosNewNull(), NULL, NULL, NULL);
Parameters
parentDoc — | The |
|
sourceFile — | The |
|
filterNames — | An array of filters to apply to the file attachment stream. Filters are indentified by name, in accordance with section 3.3 of the PDF Reference. |
|
numFilters — | The number of elements in |
|
filterParams — | The filter parameters, represented as a |
|
monitor — | The |
|
monitorText — | The text for the monitor to display, or |
|
monitorData — | Opaque data that is specific to the monitor object. |
The new file attachment. |
File: PDProcs.h |
Line: 11982 |
PDFileAttachmentOpenStream | () |
Product availability: All |
Platform availability: All |
ASStm PDFileAttachmentOpenStream(PDFileAttachment attachment)
Returns a stream for reading the data from an existing file attachment. An exception is raised if the file attachment does not have a stream (it is not embedded) or the stream could not be opened. The caller is responsible for closing the returned stream.
Parameters
attachment — | The file attachment object. |
The file attachment stream. |
File: PDProcs.h |
Line: 12036 |
PDFileAttachmentSaveToFile | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentSaveToFile(PDFileAttachment attachment, ASFile destFile)
Copies the data embedded in the file attachment to the specified file. The file must be open for write or append. The caller is responsible for closing the file after this call returns. If an error is encountered during the write, some data may have been written to the destination file. This call will make no attempt at restoring the file after failure. An exception is raised if the file attachment has no embedded stream or if a file write error occurs.
Parameters
attachment — | The file attachment. |
|
destFile — | The file that will be written with the file attachment data. |
File: PDProcs.h |
Line: 12015 |
PDFileAttachmentSetFieldDate | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentSetFieldDate(PDFileAttachment attachment, ASAtom fieldID, const ASTimeRec* date)
Sets the specified date field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
date — |
Exceptions
D
(date). File: PDProcs.h |
Line: 12145 |
PDFileAttachmentSetFieldNumber | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentSetFieldNumber(PDFileAttachment attachment, ASAtom fieldID, float number)
Sets the specified numeric field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
number — | The number to use as the new value for the specified field. |
Exceptions
N
(number). File: PDProcs.h |
Line: 12128 |
PDFileAttachmentSetFieldPrefix | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentSetFieldPrefix(PDFileAttachment attachment, ASAtom fieldName, ASText text)
Sets the specified prefix field in the file attachment. The prefix allows additional text to be prepended to the visual appearance of a field without affecting its actual value.
Parameters
attachment — | The file attachment. |
|
fieldName — | The field identifier. |
|
text — | The prefix to use as the new value for the specified field. Note that if a |
Exceptions
File: PDProcs.h |
Line: 12163 |
PDFileAttachmentSetFieldStyle | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentSetFieldStyle(PDFileAttachment attachment, ASAtom fieldID, ASConstCab styles)
Sets the specified text field in the file attachment using styled text.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
styles — | ASConstCab containing field styles for the specified field. |
Exceptions
S
(text). File: PDProcs.h |
Line: 12111 |
PDFileAttachmentSetFieldStyledText | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentSetFieldStyledText(PDFileAttachment attachment, ASAtom fieldID, ASConstText text)
Sets the specified text field in the file attachment using styled text.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
text — | Text Layout Format XML containing the text to use as the new value for the specified field. |
Exceptions
S
(text). File: PDProcs.h |
Line: 12086 |
PDFileAttachmentSetFieldText | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentSetFieldText(PDFileAttachment attachment, ASAtom fieldID, ASText text)
Sets the specified text field in the file attachment.
Parameters
attachment — | The file attachment. |
|
fieldID — | The field identifier. |
|
text — |
Exceptions
S
(text). File: PDProcs.h |
Line: 12077 |
PDFileAttachmentUpdateFromFile | () |
Product availability: All |
Platform availability: All |
void PDFileAttachmentUpdateFromFile(PDFileAttachment attachment, ASFile sourceFile, ASProgressMonitor monitor, ASConstText monitorText, void* monitorData)
Updates a file attachment from the given file. The attachment uses the filters specified in the attachment to encode the data. An exception is raised if the file could not be read or the attachment stream could not be updated.
Note that permissions must be checked by the caller before invoking this function.
Parameters
attachment — | The file attachment. |
|
sourceFile — | The file to use as input for the update operation. |
|
monitor — | The |
|
monitorText — | The text for the monitor to display, or |
|
monitorData — | Opaque data that is specific to the monitor object. |
File: PDProcs.h |
Line: 12002 |