June 18, 2019 at 13:56#27216
We’re currently using PD4ML v4, and are having a little trouble getting Batik working as an external renderer in Java. On the GitHub page it states “PD4ML provides a way to plug Batik, JEuclid or another library and to associate it with a particular or custom tag (<svg>, <math>, <etc>)”.
What are the steps required to “plug Batik” into PD4ML? We have the PD4ML v4 library and the Batik library on our classpath. As far as I can see, the only Batik related class in PD4ML is BatikSvgCustomTag, so I’m assuming that it has something to do with that, unless I’m missing something obvious.
June 19, 2019 at 10:18#30209
- This topic was modified 4 years, 5 months ago by PD4ML.
Batik requires quite a lot of third-party components to run. Probably some of them are missing in your environment.
In Maven-driven projects it is sufficient just to add
I’ve also shown JEuclid MathML dependency above for a case you (or someone else) need to have them both. JEuclid also pulls a lot of additional components and some of them conflict with Batik dependencies. The above version combination is safe and works fine.June 19, 2019 at 10:46#30210
We’ve got the Batik-all dependency setup fine. The issue is more with the Java steps required to use Batik within PD4ML. The code that we have is essentially as follows:
this.pd4ml = new com.pd4ml.PD4ML();
Dimension dimension= PD4Constants.A4;
pd4ml.setPageSize(new PageSize(dimension.width, dimension.height));
Insets insets = new java.awt.Insets(5,5,5,5);
pd4ml.setPageMargins(new PageMargins(insets.left, insets.top, insets.right, insets.bottom));
I’m not exactly sure where Batik fits in this process, though I’d imagine it’d be somewhere between readHTML and writePDF.
To clarify exactly what the issue is, we are trying to render a SVG textpath (which doesn’t seem to be supported by the PD4ML in-built SVG renderer), so we’re trying to use Batik within the code that we currently have, but are not sure how.
Is there a method that needs to be called in order to load Batik into PD4ML?
Kind regardsJune 19, 2019 at 11:00#30211
When PD4ML encounters
No explicit API calls needed to activate it.
Batik is more strict regarding SVG syntax, so if it starts to panic e.g. because of missing namespace xmlns=”http://www.w3.org/2000/svg” in <svg> tag – that means Batik is definitely in action.
You may explicitly disable Batik by
com.pd4ml.plugins.BatikSvgCustomTag.disable = true;July 1, 2019 at 09:13
The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.