Collections:
"babel ... -o svg -xP300" Bug - width="px" height="px"
Why "babel ... -o svg -xP300" command is not able scale a molecule SVG image?
✍: FYIcenter.com
The "babel ... -o svg -xP300" command has a code bug that results
incorrect attributes, width="px" height="px", in the top level "svg" element.
in both Open 2.3 and 2.4 releases.
However, "obabel ... -o svg -xP300" command works correctly in both Open 2.3 and 2.4 releases.
Commands below shows you the incorrectly generated width="px" height="px" attributes from "babel" command in Open Babel 2.4.
fyicenter$ babel -version
No output file or format spec!
Open Babel 2.4.1 -- May 25 2020 -- 08:24:13
Usage: babel [-i<input-type>] <name> [-o<output-type>] <name>
Try -H option for more information.
WARNING: babel is deprecated and will be removed in a future release
of Open Babel. You should use obabel instead. For information
on the differences please see:
http://openbabel.org/docs/current/Command-line_tools/babel.html
fyicenter$ obabel -:CCCCCCC -O carbon-chain.sdf --gen2D
1 molecule converted
fyicenter$ babel carbon-chain.sdf carbon-chain.svg -xP300
1 molecule converted
20 audit log messages
fyicenter$ grep viewBox carbon-chain.svg
... x="0" y="0" width="px" height="px" viewBox="0 0 100 100">
<svg width="100" height="100" x="0" y="0" viewBox="0 0 253.205 140"
fyicenter$ obabel -:CCCCCCC -O carbon-chain.svg --gen2D -xP300
1 molecule converted
fyicenter$ grep viewBox carbon-chain.svg
... x="0" y="0" width="300px" height="300px" viewBox="0 0 100 100">
<svg width="100" height="100" x="0" y="0" viewBox="0 0 253.205 140"
Commands below shows you the incorrectly generated width="px" height="px" attributes from "babel" command in Open Babel 2.3.
fyicenter$ babel -version No output file or format spec! Open Babel 2.3.1 -- Oct 13 2011 -- 15:14:47 Usage: babel [-i<input-type>] <name> [-o<output-type>] <name> Try -H option for more information. fyicenter$ obabel -:CCCCCCC -O carbon-chain.sdf --gen2D 1 molecule converted fyicenter$ babel carbon-chain.sdf carbon-chain.svg -xP300 1 molecule converted 25 audit log messages fyicenter$ grep viewBox carbon-chain.svg ... x="0" y="0" width="px" height="px" viewBox="0 0 100 100"> <svg width="100" height="100" x="0" y="0" viewBox="0 0 253.205 140" fyicenter$ obabel -:CCCCCCC -O carbon-chain.svg --gen2D -xP300 1 molecule converted fyicenter$ grep viewBox carbon-chain.svg ... x="0" y="0" width="300px" height="300px" viewBox="0 0 100 100"> <svg width="100" height="100" x="0" y="0" viewBox="0 0 253.205 140"
The good news is that the "babel" command is deprecated and will be removed in a future release. So we don't have to worry about it any more.
⇒ "babel ... -o svg -xd -xP300" Bug - Option -d takes a parameter
⇐ Scaling SVG Images using "viewBox" Attribute
2020-07-22, 1869🔥, 0💬
Popular Posts:
Molecule Summary: ID: FYI-1003824 Names: InChIKey: FMMOOAYVCKXGMF-MVKOLZDDS A-NSMILES: CCCCC/C=C/C/C...
Molecule Summary: ID: FYI-1000336 SMILES: CC(=C)C1CCC2(C1C3CCC4C5( CCC(=O)C(C5CCC4(C3(CC2)C )C)(C)C)C)...
Molecule Summary: ID: FYI-1003873 Names: InChIKey: GEZCPJUCCNBSRC-UHFFFAOYS A-NSMILES: O=C(O)C(Cl)(C...
Molecule Summary: ID: FYI-1002280 Names: InChIKey: DMDJOVOGXDCDTE-UHFFFAOYS A-NSMILES: CC1(C)C=Cc2c(...
Molecule Summary: ID: FYI-1002883 Names: InChIKey: IXYAZXOFFMOIPJ-UHFFFAOYS A-NSMILES: COC(=O)c2cc(S...