Hello, the link shared above is ok, it works for deploying chromic in a fly.io project.
Just in case, I’m trying to pass params to define an author, topic etc in my PDF but that doesn’t seem to be the right approach, any ideas?
params = [
info: %{
author: "Me myself & I",
subject: "Try to pass params"
}
]
{_, blob} =
[
content: """
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.tailwindcss.com">
</script>
<style>
table {
border-collapse: collapse;
font-size: 10px
}
p {
padding: 8px;
}
th {
font-weight: 700;
}
td, th {
border: 1px solid #999;
padding: 0.5rem;
text-align: left;
}
</style>
</head>
<body>
<div class="p-4">
#{table}
</div>
</body>
</html>
""",
header: """
<p style="padding: 8px;">#{filename}</p>
""",
footer: """
<p style="padding: 8px;">Gesti'up</p>
""",
size: :a4,
header_height: "40mm",
footer_height: "40mm"
]
|> ChromicPDF.Template.source_and_options()
|> ChromicPDF.print_to_pdf(params)
conn
|> put_resp_content_type("application/pdf")
|> put_resp_header("content-disposition", "attachment; filename=#{filename}.pdf")
|> put_root_layout(false)
|> send_resp(200, Base.decode64!(blob))






















