status = doc:SaveToFile(filename)
doc:SaveToFile()
saves the current document to a file.
Returns #HPDF_OK
on success, otherwise it returns an error code and the error handler is called.
#HPDF_INVALID_DOCUMENT
- An invalid document handle is set.
#HPDF_FAILED_TO_ALLOC_MEM
- Memory allocation failed.
#HPDF_FILE_IO_ERROR
- An error occurred while processing file I/O.