I have uploaded 1 PDF then convert it to xlsx file. I have tried different ways but not getting actual output.pdf2xls only displays single line format not whole file data. I want whole PDF file data to display on xlsx file.
i have one method convert PDF to xlsx but not display proper format.
def do_excel_to_pdf
@user=User.create!(pdf: params[:pdf])
@path_in = @user.pdf.path
temp1 = @user.pdf.path
@path_out = @user.pdf.path.slice(0..@user.pdf.path.rindex(/\//))
query = "libreoffice --headless --invisible --convert-to pdf " + @path_in + " --outdir " + @path_out
system(query)
file = @path_out+@user.pdf.original_filename.slice(0..@user.pdf.original_filename.rindex('.')-1)+".pdf"
send_file file, :type=>"application/msexcel", :x_sendfile=>true
end
if any one use please help me, any gem any script.