0

我使用xdocreport速度库将模板转换ODTPDF. 在我的机器上本地(Windows)一切都很好。但是当我在服务器上尝试相同时,Linux它甚至无法处理速度模板,结果我被PDF未处理的$my_any_variable字段破坏了,整个 PDF 大部分是空的:示例

摇篮依赖:

implementation( "fr.opensagres.xdocreport:fr.opensagres.xdocreport.converter.odt.odfdom:2.0.2")
implementation( "fr.opensagres.xdocreport:fr.opensagres.xdocreport.document.odt:2.0.2")
implementation( "fr.opensagres.xdocreport:fr.opensagres.xdocreport.template.velocity:2.0.2")

代码:

            IXDocReport report = XDocReportRegistry.getRegistry().loadReport(
                    inputStream, TemplateEngineKind.Velocity);
            IContext context = report.createContext();
            context.putMap(getMapParameters(application, printFormParameters));
            ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
            Options options = Options.getTo(ConverterTypeTo.PDF).via(
                    ConverterTypeVia.ODFDOM);
            report.convert(context, options, byteArray);
            byte[] bytes = byteArray.toByteArray();
4

0 回答 0