I am using AWS Lambda for generating pdf where html-pdf
is the npm package. everything works flawless but the problem is with Hindi
character. the characters appear gibberish and understandable something like as shown in attached image.
Packages used
- html-pdf
- ejs
Things i tried:
i used same nodejs based code on my local machine and it was working as expected. but not working on Lambda (nodejs v6.10/8.10)
By default, Lambda does not output in binary. It base64 encodes all of your output.
If your PDF is served back via the API Gateway, you can reverse this with a change in the API Gateway in order to get binary with the following steps below the first image:
*/*
Then re-deploy the API. See following image and steps:
Here is a AWS forum post with a similar PDF problem to yours. Hope this helps.