Files
baclight/app/controllers/id_card/print_data_controller.rb
T

49 lines
2.0 KiB
Ruby
Raw Normal View History

2026-03-19 00:42:27 -04:00
module IdCard
class PrintDataController < ApplicationController
2026-05-06 13:28:16 -04:00
# def generate_sample
# @employer = Employer.find_by(slug: params[:employer_slug])
# sample_cards_pdf = IdCardPrinterService::SampleCardsGenerator.new(@employer).call
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# send_data sample_cards_pdf.to_pdf,
# filename: "#{@employer.name.parameterize(separator: "_")}_sample_cards_#{Date.today}.pdf",
# type: "application/pdf",
# disposition: 'attachment'
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# end
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# def generate_print
# @employer = Employer.find_by(slug: params[:employer_slug])
# cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "PrintCard").call
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# send_data cards_pdf.to_pdf,
# filename: "#{@employer.name.parameterize(separator: "_")}_print_cards_#{Date.today}.pdf",
# type: "application/pdf",
# disposition: 'attachment'
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# end
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# def generate_mobile_display
# @employer = Employer.find_by(slug: params[:employer_slug])
# cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "MobileDisplayCard").call
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# send_data cards_pdf.to_pdf,
# filename: "#{@employer.name.parameterize(separator: "_")}_mobile_display_cards_#{Date.today}.pdf",
# type: "application/pdf",
# disposition: 'attachment'
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# end
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# def generate_full_page
# @employer = Employer.find_by(slug: params[:employer_slug])
# cards_pdf = IdCardPrinterService::EmployerCardsGenerator.new(@employer, "FullPageCard", true).call
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# cards_pdf.rewind
# send_data cards_pdf.sysread,
# filename: "#{@employer.name.parameterize(separator: "_")}_full_page_cards_#{Date.today}.zip",
# type: 'application/zip',
# disposition: 'attachment'
2026-03-19 00:42:27 -04:00
2026-05-06 13:28:16 -04:00
# end
2026-03-19 00:42:27 -04:00
end
end