![]() |
#include <FileSpec.h>
Public Member Functions | |
FileSpec (SDF::Obj f) | |
Create a FileSpec and initialize it using given Cos/SDF object. | |
FileSpec (const FileSpec &d) | |
Copy constructor. | |
FileSpec & | operator= (const FileSpec &d) |
Assignment operator. | |
bool | operator== (const FileSpec &d) |
Compares two FileSpec-s for equality. | |
bool | IsValid () const |
bool | Export (const UString &save_as="") const |
The function saves the data referenced by this FileSpec to an external file. | |
Filters::Filter | GetFileData () const |
The function returns data referenced by this FileSpec. | |
UString | GetFilePath () const |
void | SetDesc (const UString &desc) |
The functions sets the descriptive text associated with the file specification. | |
SDF::Obj | GetSDFObj () const |
Static Public Member Functions | |
static FileSpec | Create (SDF::SDFDoc &doc, const char *path, bool embed=true) |
Creates a file specification for the given file. | |
static FileSpec | CreateURL (SDF::SDFDoc &doc, const char *url) |
Creates a URL file specification. |
A PDF file can refer to the contents of another file by using a file specification, which can take either of the following forms:
Although the file designated by a file specification is normally external to the PDF file referring to it, it is also possible to embed the file allowing its contents to be stored or transmitted along with the PDF file. However, embedding a file does not change the presumption that it is external to (or separate from) the PDF file.
For more details on file specifications, please refer to Section 3.10, 'File Specifications' in the PDF Reference Manual.
pdftron::PDF::FileSpec::FileSpec | ( | SDF::Obj | f | ) |
Create a FileSpec and initialize it using given Cos/SDF object.
pdftron::PDF::FileSpec::FileSpec | ( | const FileSpec & | d | ) |
Copy constructor.
static FileSpec pdftron::PDF::FileSpec::Create | ( | SDF::SDFDoc & | doc, | |
const char * | path, | |||
bool | embed = true | |||
) | [static] |
Creates a file specification for the given file.
By default, the specified file is embedded in PDF.
doc | - A document to which the FileSpec should be added. To obtain SDFDoc from PDFDoc use PDFDoc::GetSDFDoc() or Obj::GetDoc(). | |
path | - The path to convert into a file specification. | |
embed | - A flag indicating whether to embed specified in the PDF. By default, all files are embedded. |
static FileSpec pdftron::PDF::FileSpec::CreateURL | ( | SDF::SDFDoc & | doc, | |
const char * | url | |||
) | [static] |
Creates a URL file specification.
doc | - A document to which the FileSpec should be added. To obtain SDFDoc from PDFDoc use PDFDoc::GetSDFDoc() or Obj::GetDoc(). | |
url | - A uniform resource locator (URL) of the form defined in Internet RFC 1738, Uniform Resource Locators Specification. |
bool pdftron::PDF::FileSpec::operator== | ( | const FileSpec & | d | ) |
Compares two FileSpec-s for equality.
The comparison will return true only if both annotations share the same underlying SDF/Cos object.
bool pdftron::PDF::FileSpec::IsValid | ( | ) | const |
bool pdftron::PDF::FileSpec::Export | ( | const UString & | save_as = "" |
) | const |
The function saves the data referenced by this FileSpec to an external file.
save_as | An optional parameter indicating the filepath and filename where the data should be saved. If this parameter is not specified, the function will attempt to save the file using FileSpec.GetFilePath(). |
Filters::Filter pdftron::PDF::FileSpec::GetFileData | ( | ) | const |
The function returns data referenced by this FileSpec.
UString pdftron::PDF::FileSpec::GetFilePath | ( | ) | const |
void pdftron::PDF::FileSpec::SetDesc | ( | const UString & | desc | ) |
The functions sets the descriptive text associated with the file specification.
This test is typically used in the EmbeddedFiles name tree.
SDF::Obj pdftron::PDF::FileSpec::GetSDFObj | ( | ) | const |