.. _section_examples_summary_mols2pdf:

Depicting Molecules in Multi-Page
================================================================================


A program that converts molecular structures into a multipage :file:`PDF` image.


Command Line Interface
--------------------------------------------------------------------------------

A description of the command line interface can be obtained by
executing the program with the --help argument.

.. oe:language:: c++

   .. code-block:: console

      prompt> mols2pdf --help

.. oe:language:: python

   .. code-block:: console

      prompt> python mols2pdf.py --help

.. oe:language:: java

   .. code-block:: console

      prompt> java Mols2PDF --help

.. oe:language:: csharp

   .. code-block:: console

      prompt> Mols2PDF --help


will generate the following output:


.. code-block:: console

    Simple parameter list
    input/output options :
      -in : Input filename
      -out : Output filename
      -ringdict : User-defined 2D ring dictionary

    molecule display options :
      -aromstyle : Aromatic ring display style
      -atomcolor : Atom coloring style
      -atomlabelfontscale : Atom label font scale
      -atomprop : Atom property display
      -atomstereostyle : Atom stereo display style
      -bondcolor : Bond coloring style
      -bondprop : Bond property display
      -bondstereostyle : Bond stereo display style
      -hydrstyle : Hydrogen display style
      -linewidth : Default bond line width
      -protgroupdisp : Protective group display style
      -scale : Scaling of the depicted molecule
      -superdisp : Super atom display style
      -titleloc : Location of the molecule title

    prepare depiction options :
      -clearcoords : Clear and regenerate 2D coordinates of molecule(s)
      -orientation : Set the preferred orientation of 2D coordinates
      -suppressH : Suppress explicit hydrogens of molecule(s)

    report options :
      -colsperpage : Number of columns per page
      -pageheight : Page height
      -pageorientation : Page orientation
      -pagesize : Page size
      -pagewidth : Page width
      -rowsperpage : Number of rows per page

.. seealso::

   * :ref:`section_multipage_report` chapter

.. note::

   The above program can generate 2D coordinates with user-defined 2D ring layouts when using the
   **-ringdict** parameter.

   See also the :ref:`section_example_oechem_2D_coordinate_generation` section of
   the **OEChem TK** manual that shows examples about how to generate and
   utilize user-defined ring dictionaries.

Code
--------------------------------------------------------------------------------

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`mols2pdf.cpp <../../../../sublibs/tklibs/depict/examples/mols2pdf.cpp>`
         and
         :download:`mols2pdf.txt <../../../../sublibs/tklibs/depict/examples/mols2pdf.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: mols2pdf.cpp
         :language: c++

      with interface file

      .. oe:source:: mols2pdf.txt
         :language: c++

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`mols2pdf.py <../../../../wrappers/python/examples/depict/mols2pdf.py>`

      .. literalinclude:: ../../../../wrappers/python/examples/depict/mols2pdf.py


   .. only:: oepdf

      .. oe:source:: mols2pdf.py
         :language: python


.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`Mols2PDF.java <../../../../wrappers/java/examples/openeye/examples/oedepict/Mols2PDF.java>`
         and
         :download:`Mols2PDF.txt <../../../../wrappers/java/examples/openeye/examples/oedepict/Mols2PDF.txt>`
         interface file

   .. only:: oepdf

      .. oe:source:: Mols2PDF.java
         :language: java

      with interface file

      .. oe:source:: Mols2PDF.txt
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`Mols2PDF.cs <../../../../wrappers/csharp/Csharp-Examples/OEDepict/Mols2PDF.cs>`

   .. only:: oepdf

      .. oe:source:: Mols2PDF.cs
         :language: csharp

.. seealso::

   * :ref:`chapter_multipage` chapter

   * :oe:func:`OEDepict::OEConfigureReportOptions` function
   * :oe:func:`OEDepict::OEConfigurePrepareDepictionOptions` function
   * :oe:func:`OEDepict::OEConfigure2DMolDisplayOptions` function
   * :ref:`OEReportOptions <OEDepict_OEReportOptions>` class
   * :oe:func:`OEDepict::OESetupReportOptions` function
   * :ref:`OEReport <OEDepict_OEReport>` class
   * :ref:`OEPrepareDepictionOptions <OEDepict_OEPrepareDepictionOptions>` class
   * :oe:func:`OEDepict::OESetupPrepareDepictionOptions` function
   * :ref:`OE2DMolDisplayOptions <OEDepict_OE2DMolDisplayOptions>` class
   * :oe:func:`OEDepict::OESetup2DMolDisplayOptions` function
   * :oe:func:`OEDepict::OEPrepareDepiction` function
   * :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` class
   * :oe:func:`OEDepict::OERenderMolecule` function
   * :ref:`OEFont <OEDepict_OEFont>` class
   * :oe:func:`OEDepict::OEDrawTextToCenter` function
   * :oe:func:`OEDepict::OEWriteReport` function
