Foxit PDF SDK
|
Public Member Functions | |
FileSpec (const FileSpec &other) | |
Constructor, with another file specification object. More... | |
FileSpec (const PDFDoc &document) | |
Constructor. More... | |
FileSpec (const PDFDoc &document, objects::PDFObject *pdf_object) | |
Constructor, from an existing file specification PDF object in a PDF document. More... | |
~FileSpec () | |
Destructor. | |
bool | Embed (const wchar_t *file_path) |
Embed the whole content of a file which is specified by file path. More... | |
bool | Embed (foxit::common::file::StreamCallback *stream) |
Embed a file by using foxit::common::file::StreamCallback. More... | |
bool | Embed (foxit::pdf::objects::PDFObject *pdf_object) |
(Only support in PDF 2.0) Embed the whole content of a PDF stream object or a PDF reference object which refers to a PDF stream object, when current file specification object is used as an associated file. More... | |
bool | ExportToFile (const wchar_t *path) const |
Export the file data that represented in current file specification directly into a file. More... | |
bool | ExportToFileStream (foxit::common::file::StreamCallback *stream) const |
Export the file data that represented in current file specification through a stream callback object. More... | |
AssociatedFiles::Relationship | GetAssociteFileRelationship () const |
(Only supported in PDF 2.0) Get the associated file relationship when current file specification is used as an associated file. More... | |
String | GetChecksum () const |
Get the checksum for embedded file. More... | |
int64 | GetCompressedEmbeddedFileSize () const |
Get the compressed file size of embedded file. More... | |
DateTime | GetCreationDateTime () const |
Get creation date and time about when the embedded file was created. More... | |
String | GetDescription () const |
Get the descriptive text associated with current file specification. More... | |
objects::PDFDictionary * | GetDict () const |
Get the PDF dictionary of current file specification. More... | |
common::file::ReaderCallback * | GetFileData () const |
Get the file data of embedded file. More... | |
WString | GetFileName () const |
Get the file name. More... | |
int64 | GetFileSize () const |
Get the size of embedded file (uncompressed file size). More... | |
DateTime | GetModifiedDateTime () const |
Get modified date and time about when the embedded file was last modified. More... | |
String | GetSubtype () const |
(Only support in PDF 2.0) Get the MIME type value for "Subtype" key for embedded file when current file specification is used as an associated file. More... | |
bool | IsEmbedded () const |
Check whether current file specification object represents an embedded file or not. More... | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
bool | operator!= (const FileSpec &other) const |
Not equal operator. More... | |
FileSpec & | operator= (const FileSpec &other) |
Assign operator. More... | |
bool | operator== (const FileSpec &other) const |
Equal operator. More... | |
void | SetAssociteFileRelationship (AssociatedFiles::Relationship associfile_relationship) |
(Only supported in PDF 2.0) Set the associated file relationship when current file specification is used as an associated file. More... | |
void | SetChecksum (const String &checksum) |
Set the checksum for embedded file. (Not affect local file) More... | |
void | SetCreationDateTime (const DateTime &date_time) |
Set the creation date and time for the embedded file. (Not affect local file) More... | |
void | SetDescription (const String &description) |
Set the descriptive text associated with current file specification. More... | |
void | SetFileName (const wchar_t *file_name) |
Set the file name. More... | |
void | SetModifiedDateTime (const DateTime &date_time) |
Set last modified date and time for the embedded file. (Not affect local file) More... | |
void | SetSubtype (const String &subtype="application/octet-stream") |
(Only support in PDF 2.0) Set the MIME type value for "Subtype" key for embedded file (Not affect local file) when current file specification is used as an associated file. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
A PDF file can refer to the contents of another file by using a file specification. File specification can simply represents the file path of another file, or represents the whole content of another file, which is embedded to current PDF file.
|
explicit |
Constructor.
This constructor is to construct a new file specification object (without any data).
[in] | document | A valid PDF document object, to which the new file specification object will belongs. |
|
explicit |
Constructor, from an existing file specification PDF object in a PDF document.
[in] | document | A valid PDF document object, to which the file specification PDF object belongs. |
[in] | pdf_object | A valid PDF object which represents an existing file specification object in the PDF document. It should be either a dictionary object or a PDF reference object:
|
foxit::pdf::FileSpec::FileSpec | ( | const FileSpec & | other | ) |
Constructor, with another file specification object.
[in] | other | Another file specification object. |
bool foxit::pdf::FileSpec::Embed | ( | const wchar_t * | file_path | ) |
Embed the whole content of a file which is specified by file path.
When this function succeeds, the whole content of specified file will be embedded to the PDF document that current file specification belongs to.
[in] | file_path | A full path of an existing local file. |
bool foxit::pdf::FileSpec::Embed | ( | foxit::common::file::StreamCallback * | stream | ) |
Embed a file by using foxit::common::file::StreamCallback.
When this function succeeds, please keep input stream callback object valid until the PDF file (which current file specification belongs to) is saved or closed.
[in] | stream | A foxit::common::file::StreamCallback object which is implemented by user to read the file content. |
bool foxit::pdf::FileSpec::Embed | ( | foxit::pdf::objects::PDFObject * | pdf_object | ) |
(Only support in PDF 2.0) Embed the whole content of a PDF stream object or a PDF reference object which refers to a PDF stream object, when current file specification object is used as an associated file.
When this function succeeds, the whole content of specified PDF stream object will be embedded to the PDF document that current file specification belongs to.
[in] | pdf_object | A valid PDF object. It should be either a PDF stream object or a PDF reference object which refers to a PDF stream object. |
bool foxit::pdf::FileSpec::ExportToFile | ( | const wchar_t * | path | ) | const |
Export the file data that represented in current file specification directly into a file.
[in] | path | A full path of a file to which the data will be saved. |
bool foxit::pdf::FileSpec::ExportToFileStream | ( | foxit::common::file::StreamCallback * | stream | ) | const |
Export the file data that represented in current file specification through a stream callback object.
[in] | stream | A foxit::common::file::StreamCallback object which is implemented by user to save the file data. |
AssociatedFiles::Relationship foxit::pdf::FileSpec::GetAssociteFileRelationship | ( | ) | const |
(Only supported in PDF 2.0) Get the associated file relationship when current file specification is used as an associated file.
String foxit::pdf::FileSpec::GetChecksum | ( | ) | const |
Get the checksum for embedded file.
This function is only useful when current file specification object represents an embedded file. A 16-byte string that is the checksum of the bytes of the uncompressed embedded file. The checksum is calculated by applying the standard MD5 message-digest algorithm to the bytes of the embedded file stream.
If current file specification object does not represent an embedded file, this function will return an empty string.
int64 foxit::pdf::FileSpec::GetCompressedEmbeddedFileSize | ( | ) | const |
Get the compressed file size of embedded file.
This function is only useful when current file specification object represents an embedded file. If current file specification object does not represent an embedded file, this function will return 0 directly.
DateTime foxit::pdf::FileSpec::GetCreationDateTime | ( | ) | const |
Get creation date and time about when the embedded file was created.
This function is only useful when current file specification object represents an embedded file. If current file specification object does not represent an embedded file, this function will return a date and time object will all value 0.
String foxit::pdf::FileSpec::GetDescription | ( | ) | const |
Get the descriptive text associated with current file specification.
objects::PDFDictionary* foxit::pdf::FileSpec::GetDict | ( | ) | const |
Get the PDF dictionary of current file specification.
common::file::ReaderCallback* foxit::pdf::FileSpec::GetFileData | ( | ) | const |
Get the file data of embedded file.
WString foxit::pdf::FileSpec::GetFileName | ( | ) | const |
Get the file name.
int64 foxit::pdf::FileSpec::GetFileSize | ( | ) | const |
Get the size of embedded file (uncompressed file size).
This function is only useful when current file specification object represents an embedded file. If current file specification object does not represent an embedded file, this function will return 0 directly.
DateTime foxit::pdf::FileSpec::GetModifiedDateTime | ( | ) | const |
Get modified date and time about when the embedded file was last modified.
This function is only useful when current file specification object represents an embedded file. If current file specification object does not represent an embedded file, this function will return a date and time object will all value 0.
String foxit::pdf::FileSpec::GetSubtype | ( | ) | const |
(Only support in PDF 2.0) Get the MIME type value for "Subtype" key for embedded file when current file specification is used as an associated file.
This function is only useful when current file specification object represents an embedded file and used as associated file.
bool foxit::pdf::FileSpec::IsEmbedded | ( | ) | const |
Check whether current file specification object represents an embedded file or not.
bool foxit::pdf::FileSpec::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
bool foxit::pdf::FileSpec::operator!= | ( | const FileSpec & | other | ) | const |
Not equal operator.
[in] | other | Another file specification object. This function will check if current object is not equal to this one. |
Assign operator.
[in] | other | Another file specification object, whose value would be assigned to current object. |
bool foxit::pdf::FileSpec::operator== | ( | const FileSpec & | other | ) | const |
Equal operator.
[in] | other | Another file specification object. This function will check if current object is equal to this one. |
void foxit::pdf::FileSpec::SetAssociteFileRelationship | ( | AssociatedFiles::Relationship | associfile_relationship | ) |
(Only supported in PDF 2.0) Set the associated file relationship when current file specification is used as an associated file.
This function is required for a newly created associated file specification object.
[in] | associfile_relationship | The associated file relationship to be set. Please refer to values starting from AssociatedFiles::e_RelationshipSource and this would be one of these values. |
void foxit::pdf::FileSpec::SetChecksum | ( | const String & | checksum | ) |
Set the checksum for embedded file. (Not affect local file)
This function is only useful if current file specification object represents an embedded file.
A 16-byte string that is the checksum of the bytes of the uncompressed embedded file. The checksum is calculated by applying the standard MD5 message-digest algorithm to the bytes of the embedded file stream.
[in] | checksum | A checksum to be set. |
void foxit::pdf::FileSpec::SetCreationDateTime | ( | const DateTime & | date_time | ) |
Set the creation date and time for the embedded file. (Not affect local file)
This function is only useful when current file specification object represents an embedded file.
[in] | date_time | The creation date and time to be set. |
void foxit::pdf::FileSpec::SetDescription | ( | const String & | description | ) |
Set the descriptive text associated with current file specification.
[in] | description | A descriptive text to be set. It should not be an empty string. |
void foxit::pdf::FileSpec::SetFileName | ( | const wchar_t * | file_name | ) |
Set the file name.
This function is required for a new file specification object (not constructed from an existing file specification PDF object).
[in] | file_name | The file name to be set. It should not be an empty string. |
void foxit::pdf::FileSpec::SetModifiedDateTime | ( | const DateTime & | date_time | ) |
Set last modified date and time for the embedded file. (Not affect local file)
This function is only useful when current file specification object represents an embedded file.
[in] | date_time | The last modified date and time to be set. |
void foxit::pdf::FileSpec::SetSubtype | ( | const String & | subtype = "application/octet-stream" | ) |
(Only support in PDF 2.0) Set the MIME type value for "Subtype" key for embedded file (Not affect local file) when current file specification is used as an associated file.
This function is only useful when current file specification object represents an embedded file and used as associated file.
[in] | subtype | A valid MIME type value. Default value: "application/octet-stream". |