Skip to content

Commit e6f9d38

Browse files
Sandbox comments is added
1 parent 02f336b commit e6f9d38

File tree

1 file changed

+11
-1
lines changed
  • HTML to PDF/Blink/Convert-website-URL-to-PDF-document/.NET/Convert-website-URL-to-PDF-document

1 file changed

+11
-1
lines changed

HTML to PDF/Blink/Convert-website-URL-to-PDF-document/.NET/Convert-website-URL-to-PDF-document/Program.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66

77
//Initialize HTML to PDF converter.
88
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter();
9+
//Create blink converter settings
10+
BlinkConverterSettings blinkConverterSettings = new BlinkConverterSettings();
11+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
12+
{
13+
//Set command line arguments to run without the sandbox.
14+
blinkConverterSettings.CommandLineArguments.Add("--no-sandbox");
15+
blinkConverterSettings.CommandLineArguments.Add("--disable-setuid-sandbox");
16+
}
17+
//Assign Blink converter settings to HTML converter.
18+
htmlConverter.ConverterSettings = blinkConverterSettings;
919
//Convert URL to PDF document.
1020
PdfDocument document = htmlConverter.Convert("https://www.syncfusion.com");
1121
//Create file stream.
@@ -15,4 +25,4 @@
1525
document.Save(fileStream);
1626
}
1727
//Close the document.
18-
document.Close(true);
28+
document.Close(true);

0 commit comments

Comments
 (0)