HakanL / WkHtmlToPdf-DotNet

C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
GNU Lesser General Public License v3.0
366 stars 66 forks source link

Gmail is detecting pdf generated by WkHtmlToPdf-DotNet as malware #104

Closed poncejj closed 1 year ago

poncejj commented 1 year ago

When I try to send an email with an attached pdf that was generated by WkHtmlToPdfDotNet, it detects that is malicious and block me the mail.

Here is the code I convert the HTML to PDF ` var doc = new HtmlToPdfDocument() { GlobalSettings = { ColorMode = ColorMode.Color, Orientation = orientation, PaperSize = PaperKind.A4, Out = fileName, } };

            foreach (var item in pages)
            {
                var page = new ObjectSettings()
                {
                    PagesCount = true,
                    WebSettings = { DefaultEncoding = "utf-8" },
                    HtmlContent = item,
                };

                doc.Objects.Add(page);
            }

            _converter.Convert(doc);

` This is the error I got:

image

HakanL commented 1 year ago

It's impossible for us to know what causes Gmail to trigger this. Plus this project doesn't manipulate the PDF, this is just a wrapper, if anything it's something you can bring up to the wkhtmltopdf project, but be aware that you will need to include more details as the above screenshot won't indicate why it was blocked.