Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

pdf data format writer

Copyright: 2019 Shamim Rezaie <shamim@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 223 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: writer  - X-Ref

pdf data format writer

__construct()   X-Ref
writer constructor.


send_http_headers()   X-Ref
No description

start_output_to_file()   X-Ref
Start output to file, note that the actual writing of the file is done in {@see close_output_to_file()}


start_output()   X-Ref
No description

start_sheet($columns)   X-Ref
No description

supports_html()   X-Ref
Method to define whether the dataformat supports export of HTML

return: bool

export_html_image_source(\stored_file $file)   X-Ref
When exporting images, we need to return their Base64 encoded content. Otherwise TCPDF will create a HTTP
request for them, which will lead to the login page (i.e. not the image it expects) and throw an exception

Note: ideally we would copy the file to a temp location and return it's path, but a bug in TCPDF currently
prevents that

param: \stored_file $file
return: string|null

write_record($record, $rownum)   X-Ref
Write a single record

param: array $record
param: int $rownum

close_output()   X-Ref
No description

close_output_to_file()   X-Ref
Write data to disk

return: bool

print_heading(\pdf $pdf)   X-Ref
Prints the heading row for a given PDF.

param: \pdf $pdf A pdf to print headings in

get_heading_height()   X-Ref
Returns the heading height.

return: int