FileAttachment Class Documentation

class FileAttachment

Namespace:datalogics_interface

Detailed Description

A file attachment. Any file can be attached to the PDF document.

The class allows to create attachment and manipulate by its content.

Uses types

Constructor & Destructor Documentation

FileAttachment

FileAttachment(Document & doc, const std::string & file_name)

Parameters

doc: Document &

The PDF document (reference).

file_name: const std::string &

The path to file which will be attached to the document.

Allows to add attachment into the PDF document.

FileAttachment

FileAttachment(Document & doc, const std::string & file_name, const std::string & key_name)

Parameters

doc: Document &

The PDF document (reference).

file_name: const std::string &

The path to file which will be attached to the document.

key_name: const std::string &

Allows to add attachment into the PDF document.

~FileAttachment

~FileAttachment()

Member Function Documentation

get_af_relationship

AFRelationship get_af_relationship()

Returns:

AFRelationship

The attachment's Associated File relationship.

Gets the attachment's Associated File relationship.

get_file_name

std::string get_file_name()

Returns:

std::string

The attachment's file name.

Gets the attachment's file name.

get_file_size

size_t get_file_size()

Returns:

size_t

The attachment's size in bytes.

Gets the attachment's file size.

save_to_file

void save_to_file(const std::string & file_name)

Parameters

file_name: const std::string &

The path where attachment will be saved.

Returns:

void

Allows to save attachment to the specified file.

set_af_relationship

void set_af_relationship(AFRelationship relationship)

Parameters

relationship: AFRelationship

The Associated File relationship to set.

Returns:

void

Sets the attachment's Associated File relationship.

update_from_file

void update_from_file(const std::string & file_name)

Parameters

file_name: const std::string &

The path to the file from which attachment will be updated.

Returns:

void

Allows to update attachment from another file.