User 041aab2e15
15-12-2015 11:36:17
We were using Jchem version 6.1 for one of our product. We ran into an issue with pdf generation logic while trying to upgrade to Jchem version 15.3.30. We use itext version 2.1.7 for pdf generation. When attempting to render molecules in a small pdf cell, we see following exception: "com.lowagie.text.DocumentException: java.lang.IllegalArgumentException: Font size too small: 0.0". Though the exception is from pdf generation library, we believe the underlying issue is to do with jchem upgrade to the version 15.3.30 as pdf generation library (itext) has not been changed.
Attaching a sample code (MoleculeOnSmallCanvas.java) that shows the problem. The following are instructions to execute the sample code.
Using JChem version 6.1
javac -cp guava-15.0.jar:itext-rtf-2.1.7.jar:itext-2.1.7.jar:jchem-6.1.3.jar:rt.jar:. MoleculeOnSmallCanvas.java
java -cp
guava-15.0.jar:itext-rtf-2.1.7.jar:itext-2.1.7.jar:jchem-6.1.3.jar:rt.jar:. MoleculeOnSmallCanvas
Ouptut: test.pdf has the structure rendered properly (Will have to zoom too see it properly).
Using JChem version 15.3.30
javac -cp
guava-15.0.jar:itext-rtf-2.1.7.jar:itext-2.1.7.jar:jchem-15.3.30.0.jar:rt.jar:. MoleculeOnSmallCanvas.java
java -cp
guava-15.0.jar:itext-rtf-2.1.7.jar:itext-2.1.7.jar:jchem-15.3.30.0.jar:rt.jar:. MoleculeOnSmallCanvas
Output: Exception: "com.lowagie.text.DocumentException: java.lang.IllegalArgumentException: Font size too small: 0.0".