File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 66
77//Initialize HTML to PDF converter.
88HtmlToPdfConverter 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.
1020PdfDocument document = htmlConverter . Convert ( "https://www.syncfusion.com" ) ;
1121//Create file stream.
1525 document . Save ( fileStream ) ;
1626}
1727//Close the document.
18- document . Close ( true ) ;
28+ document . Close ( true ) ;
You can’t perform that action at this time.
0 commit comments