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()
|
public PuppeteerPdfGeneratorService()
|
||||||
{
|
{
|
||||||
// Descargar Chromium si no está
|
// NO USAR BrowserFetcher NUNCA en entorno productivo Docker
|
||||||
new BrowserFetcher().DownloadAsync().GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
// Lanzar Chromium persistente
|
|
||||||
_browser = Puppeteer.LaunchAsync(new LaunchOptions
|
_browser = Puppeteer.LaunchAsync(new LaunchOptions
|
||||||
{
|
{
|
||||||
Headless = true,
|
Headless = true,
|
||||||
ExecutablePath = "/usr/bin/chromium",
|
ExecutablePath = "/usr/bin/chromium", // ruta de chromium en la imagen docker
|
||||||
Args = new[]
|
Args = new[] { "--no-sandbox", "--disable-setuid-sandbox" }
|
||||||
{
|
|
||||||
"--no-sandbox",
|
|
||||||
"--disable-setuid-sandbox"
|
|
||||||
}
|
|
||||||
}).GetAwaiter().GetResult();
|
}).GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
public async Task<byte[]> GeneratePdfFromHtmlAsync(string htmlContent, PdfGenerationOptions options = null)
|
public async Task<byte[]> GeneratePdfFromHtmlAsync(string htmlContent, PdfGenerationOptions options = null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user