Content for pdf response helper #115
-
What type of or example of content does the pdf response helper accept? I tried using a blob but that failed so I am not sure what content to add there in other to use the pdf response. My example: export let loader: LoaderFunction = async ({ request }) => {
return pdf(
new Blob(
["<html> <body> <h1>Hello World</h1></body> </html>"],
{ type: "text/html" }
)
);
}; The above example I tried does not work and the pdf gives an error: |
Beta Was this translation helpful? Give feedback.
Answered by
sergiodxa
Nov 22, 2022
Replies: 1 comment
-
You need to pass an actual PDF file, the helper doesn’t convert HTML to PDF, it sets the correct Content-Type. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sergiodxa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to pass an actual PDF file, the helper doesn’t convert HTML to PDF, it sets the correct Content-Type.