Open Then Save A Document

i have a model Student(id, name, file)

in order to save the file for the student, i have first to open a file template which is a document file, write the student information by hand and then save the document as PDF file

is there any way to do this?

thank you

You can save the template as PDF and load it through a PDF rendered (I personally use pdf extension with mPDF library), write all needed info, and generate the final PDF.