Pdf generator

hello morning team am trying to generate a pdf document on the server but at the point of doing that it saying error were found at the given arguments

{; generator_faild, " "} in elixir

Some more detailed information would be really beneficial to help you solve the problem.

1 Like

Ubanta server i would also love to know how to config the pdf generator in the config file

Probably Ubuntu right?
You really need to be more specific. Otherwise, there is no way to help you.

yes Ubuntu server

def custreportpdf_exp(conn, params) do

process_reportcustreport(conn, @current, params)

end

defp process_reportcustreport(conn, source, params) do

conn =

conn

|> put_resp_header(

“content-disposition”,

“attachment; filename=ZRA_CUSTOMS_REPORT_#{Timex.today()}.csv”

  )

|> put_resp_content_type(“text/csv”)

params

|> Map.delete("_csrf_token")

customs = Finances.list_zra_aw_assessment()

|> Otc.Workers.Customs.generate()

|> process_cust_report_pdf(conn)

end

defp process_cust_report_pdf(content, conn) do

datetime = Timex.now() |> DateTime.truncate(:second) |> DateTime.to_naive() |> Timex.shift(hours: 2)

conn =

conn

|> put_resp_header(

“content-disposition”,

“attachment; filename=ZRA_CUSTOMS_REPORT As at #{datetime}.pdf”

)

|> put_resp_content_type(“text/pdf”)

send_resp(conn, 200, content)

end

so it is failing
at the point of generating

config :pdf_generator,
wkhtml_path: “/apps/data/enviroments/misc”
that is what is seating in my config file

How do I ask a good question? - Help Center - Stack Overflow

1 Like

You should wrap your code with ``` to increase readability.

You should also provide enough information, mentionning wkhtml only in your last post is not something we could have guessed :slight_smile: