-
This sample is based around
Haukcode.DinkToPdf
which is a fork of https://github.com/rdvojmoc/DinkToPdf https://www.nuget.org/packages/Haukcode.DinkToPdf/ -
Note that you need to include the correct
libwkhtmltox
for your platform. See links in the repos above. -
Tested on Azure Functions v3 running on a Standard Windows App Service Plan. Last time I checked concumption plans were not supported because the don't support GDI+.
To test this function in the azure portal you simply need to post some HTML in the request body. For example:
<!DOCTYPE html>
<html>
<head><meta charset='UTF-8'>
<title>Title</title>
</head>
<body>Body text...</body>
</html>
28/04/2020: Updated for azure functions v3 using a different nuget package
Ah so close... this method appears to hang when you send it HTML with inline images using the dataURI trick
update moving to an app plan fixed it :-)