@jan_blaha
This is my example
https://github.com/lamnouar/jsreport
Posts made by lamnouar
-
RE: Pagination numbers are missing when generation in a container
@jan_blaha
Still not working https://playground.jsreport.net/w/lamnouar/yV7~9HuI,
The same code is working fine locally ( windows),
It looks like pageNumber and totalPages have some issues on docker.
Just to mention that I tested locally on ubuntu and it is working fine -
RE: Pagination numbers are missing when generation in a container
@jan_blaha This is the example https://playground.jsreport.net/w/lamnouar/yV7~9HuI
This is my c# code
var rs = new LocalReporting() .Configure(config => { return config; }) .RunInDirectory(Path.Combine(Path.GetTempPath(), "jsreports")) .UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? JsReportBinary.GetBinary() : jsreport.Binary.Linux.JsReportBinary.GetBinary()) .AsUtility() .Create(); var report = await rs.RenderAsync(new RenderRequest() { Template = new Template() { Recipe = Recipe.ChromePdf, Engine = Engine.None, Content = html, Chrome = new Chrome() { DisplayHeaderFooter = true, FooterTemplate = GetPdfFooter(), HeaderTemplate = "<span></span>", Landscape = true, MarginLeft = "1in", MarginBottom = "1in", MarginRight = "1in" }, } }); using var memoryStream = new MemoryStream(); await report.Content.CopyToAsync(memoryStream); return memoryStream.ToArray(); private string GetPdfFooter() { return @$"<table style='margin: 30px 70px; text-align:right; width:100%;'> <td>Page <span class=""pageNumber""></span> | <span class=""totalPages""></span></td></table>"; }
Part of DockerFile
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /app RUN apt update && apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11- xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb- release xdg-utils wget libatk-bridge2.0-0 libgbm-dev ENV chrome_launchOptions_args --no-sandbox,--disable-dev-shm-usage RUN mkdir jsreports RUN chmod +rwx ./jsreports COPY . . RUN dotnet restore
-
Pagination numbers are missing when generation in a container
Hello,
I use this template for the footer
<table style='margin: 30px 70px; text-align:right; width:100%;'>
<td>Page <span class='pageNumber'></span> | <span class='totalPages'></span></td></table>It is working fine in windows, but when I generate the pdf in a container the numbers are missing