Posted 26 February 2021, 8:54 pm EST
Hi,
I’m using this method to render a PageDocument (from an already set up RDLX file with parameters and/or datasets) in a Linux Docker container:
pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
This came from an example here: https://www.grapecity.com/activereportsnet/docs/v15/online/rendering-to-pdf.html.
This works fine when running locally on Windows. However, if I try to run in a Linux Docker container I get this error:
An unexpected error occurred. Additional information: ‘TextFormat has no associated Font, and a default font could not be found. To avoid this situation, assign an available font to FontCollection.SystemFonts.DefaultFont if it is null.’
I’m trying to generate the PDF as a response from a Web Api as well, and the response has this error:
Could not load file or assembly ‘System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’. The system cannot find the file specified.
Do I need to handle rendering in Linux differently? I found this other thread where perhaps we need to add some default fonts to the Docker container (https://www.grapecity.com/forums/documents-word/saveaspdf-problems). This has not yet worked for me, though.