I need to edit metadata of PDF file created with minimagick, to be specific, title of pdf. I can set filename, no problem, but I haven't found any solution how to change that title. For example it apears in chrome pdf title thing when PDF is open.
This is snippet of my code:
pdf = MiniMagick::Image.open(template_image_path)
pdf.combine_options do |c|
calibrate_name_text(c, name)
end
result.format 'pdf'
File.open(result.path, 'r') do |f|
send_data f.read, type: 'application/pdf', filename: 'pdf_file.pdf'
end
This is title, even when pdf name if for example 'pdf_file':
When I use send_file function like this I got error in console:
send_file result.path, type: 'application/pdf', filename: 'pdf_file.pdf', url_based_filename: false
composite: gAMA: CRC error `' @ warning/png.c/MagickPNGWarningHandler/1746.
And pdf file has status 'Failed - Network error'
Thank you for your help