Hi, I've been using 0.14.0 for PDF generation and recently tried to upgrade to 0.17.1 (can't go higher because stuck with CE2). I'm not sure if I'm doing something wrong or if there is an issue with the library. I'm using java 11, not sure if that could cause issues. I've tried with laika versions 0.16.1 and 0.17.0 as well but I get the same error. Here is a small example using ZIO.
import zio.interop.catz._
import laika.io.implicits._
val blocker = Blocker.liftExecutionContext(
ExecutionContext.fromExecutor(Executors.newCachedThreadPool()),
)
val parser: MarkupParser = MarkupParser.of(Markdown).build
val renderer: Resource[Task, BinaryTreeRenderer[Task]] =
Renderer.of(PDF).io(blocker).sequential[Task].build
parser.parse("hello") match {
case Left(error) => Task.fail(new IllegalArgumentException(s"Could not parse markdown $error"))
case Right(doc) =>
(for {
file <- Managed.makeEffect[File](File.createTempFile("KYC", ".pdf"))(_.delete())
_ <- Managed.effect(println("Created file"))
_ <- renderer.toManagedZIO.tapM(
_.from(DocumentTreeRoot(DocumentTree(doc.path, Seq(doc)))).toFile(file).render,
)
_ <- Managed.effect(println("Rendered pdf"))
} yield file).use(file => Task.succeed(println(file.getAbsolutePath)))
}
// Output
Created file
[Fatal Error] :3:48: The prefix "fo" for element "fo:block" is not bound.
org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 48; The prefix "fo" for element "fo:block" is not bound.
javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 48; The prefix "fo" for element "fo:block" is not bound.
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
at laika.render.pdf.PDFRenderer.$anonfun$render$16(PDFRenderer.scala:76)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
Hi, I've been using 0.14.0 for PDF generation and recently tried to upgrade to 0.17.1 (can't go higher because stuck with CE2). I'm not sure if I'm doing something wrong or if there is an issue with the library. I'm using java 11, not sure if that could cause issues. I've tried with laika versions 0.16.1 and 0.17.0 as well but I get the same error. Here is a small example using ZIO.