MDL-68500 dataformat: allow instances to export to local file.

This commit is contained in:
Paul Holden
2020-05-04 09:32:44 +01:00
parent cd391f9922
commit 1de3b81983
6 changed files with 262 additions and 11 deletions
+18
View File
@@ -72,6 +72,13 @@ class writer extends \core\dataformat\base {
public function send_http_headers() {
}
/**
* Start output to file, note that the actual writing of the file is done in {@see close_output_to_file()}
*/
public function start_output_to_file(): void {
$this->start_output();
}
public function start_output() {
$this->pdf->AddPage('L');
}
@@ -126,6 +133,17 @@ class writer extends \core\dataformat\base {
$this->pdf->Output($filename, 'D');
}
/**
* Write data to disk
*
* @return bool
*/
public function close_output_to_file(): bool {
$this->pdf->Output($this->filepath, 'F');
return true;
}
/**
* Prints the heading row.
*/