You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defmodulePdfMerger.MergePdfsdodefmethod(input_files,output_file)doifpdftk_installed?()domerge_pdfs(input_files,output_file)elseIO.puts("Error: pdftk is not installed.")endenddefpcommand_exists?(command)doSystem.cmd("which",[command])=={"/usr/bin/#{command}\n",0}enddefppdftk_installed?docommand_exists?("pdftk")enddefpmerge_pdfs(input_files,output_file)doinput_files_string=Enum.join(input_files," ")output_file=Path.expand(output_file){output,status}=System.cmd("pdftk",["#{input_files_string}","cat","output","#{output_file}"])IO.inspect("pdftk #{input_files_string} cat output #{output_file}")casestatusdo0->IO.puts("PDFs merged successfully.")_->IO.puts("Error: PDF merging failed.")endendend
The text was updated successfully, but these errors were encountered:
could you implement something like this here
The text was updated successfully, but these errors were encountered: