Update PuppeterService /chromium
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 2m56s
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 2m56s
This commit is contained in:
parent
8060bdcf43
commit
82343b53c8
@ -11,19 +11,12 @@ namespace Transversal.Services
|
||||
|
||||
public PuppeteerPdfGeneratorService()
|
||||
{
|
||||
// Descargar Chromium si no está
|
||||
new BrowserFetcher().DownloadAsync().GetAwaiter().GetResult();
|
||||
|
||||
// Lanzar Chromium persistente
|
||||
// NO USAR BrowserFetcher NUNCA en entorno productivo Docker
|
||||
_browser = Puppeteer.LaunchAsync(new LaunchOptions
|
||||
{
|
||||
Headless = true,
|
||||
ExecutablePath = "/usr/bin/chromium",
|
||||
Args = new[]
|
||||
{
|
||||
"--no-sandbox",
|
||||
"--disable-setuid-sandbox"
|
||||
}
|
||||
ExecutablePath = "/usr/bin/chromium", // ruta de chromium en la imagen docker
|
||||
Args = new[] { "--no-sandbox", "--disable-setuid-sandbox" }
|
||||
}).GetAwaiter().GetResult();
|
||||
}
|
||||
public async Task<byte[]> GeneratePdfFromHtmlAsync(string htmlContent, PdfGenerationOptions options = null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user