Apologies if I'm stating the obvious here, but the errors looks like you are actually missing the two files mentioned.
Have you confirmed that those files are present on your web server in the /bin/ folder or installed into the GAC?
If you do, perhaps you have the wrong package from the wkhtmltopdf distribution? I believe the file libgcc_s_dw2-1.dll is used by the C++ compiler which may indicate you are running the source rather than the compiled version.
Last thought for you to consider - if this is running on Azure make sure you use the 64-bit distribution...I have seen a similar issue when attempting to use 32-bit assemblies on Azure WebApps.
installed it into my project (within App_Data/wkhtmltopdf)
I modified the path in my code to string PDF_CONVERTER = Server.MapPath("/App_data/wkhtmltopdf/bin/wkhtmltopdf.exe");, because after installation this was available
Now when I call the page it runs and generates the PDF, so that is a success!
Hi, I am a noob and trying to do something similar. How are you calling the page? what does the URL look like that passes an HTML page URL to the pdf.cshtml?
Trying to run an exe from a web application usually causes a security violation, unless you have full access to the server so you can install the package on the server and assign the permissions that needed to run it from the website. I think this may be the case for you. The error messages lead me to believe that the dll's are either....
missing from the install package
not were the program expects to find them
the server is denying access to them.
For web applications, online pdf conversions are usually done with a 3rd party dll that is copied to the bin folder of the web app. I use SautinSoft for my pdfs.
Generating PDF
Hi,
I'm looking for a solution for generating PDF in Umbraco 8. I found https://wkhtmltopdf.org/ , a lot of people recommend it, although I can't make it work. I created a pdf.cshtml view and added this code (https://our.umbraco.com/forum/umbraco-7/using-umbraco-7/71210-best-and-most-flexible-pdf-generator):
When I call the page, two error messages pop up
and after the following on the screen:
Any advice?
Hi Levente -
Apologies if I'm stating the obvious here, but the errors looks like you are actually missing the two files mentioned.
Have you confirmed that those files are present on your web server in the
/bin/
folder or installed into the GAC?If you do, perhaps you have the wrong package from the wkhtmltopdf distribution? I believe the file
libgcc_s_dw2-1.dll
is used by the C++ compiler which may indicate you are running the source rather than the compiled version.Last thought for you to consider - if this is running on Azure make sure you use the 64-bit distribution...I have seen a similar issue when attempting to use 32-bit assemblies on Azure WebApps.
-Paul
Hi Paul,
Thank you for your reply. I just tried the following on my localhost:
string PDF_CONVERTER = Server.MapPath("/App_data/wkhtmltopdf/bin/wkhtmltopdf.exe");
, because after installation this was availableNow when I call the page it runs and generates the PDF, so that is a success!
Hi, I am a noob and trying to do something similar. How are you calling the page? what does the URL look like that passes an HTML page URL to the pdf.cshtml?
Hi Levente,
Trying to run an exe from a web application usually causes a security violation, unless you have full access to the server so you can install the package on the server and assign the permissions that needed to run it from the website. I think this may be the case for you. The error messages lead me to believe that the dll's are either....
For web applications, online pdf conversions are usually done with a 3rd party dll that is copied to the bin folder of the web app. I use SautinSoft for my pdfs.
https://www.sautinsoft.com/products/pdf-vision/index.php
The code to create it looks like this:
_pdf.PageStyle.PageMarginRight.Inch(float.Parse("0.5")); _pdf.PageStyle.PageMarginTop.Inch(float.Parse("0.0")); _pdf.PageStyle.PageMarginBottom.Inch(float.Parse("0.5")); _pdf.PageStyle.PageOrientation.Portrait(); _pdf.PageStyle.PageMarginLeft.Inch(float.Parse("0.5")); _pdf.ConvertHtmlStringToPDFFile(html, fileName);
is working on a reply...