docstr: Converts the image from SVG to PDF using chrome.
docstr_tok: ["Converts","the","image","from","SVG","to","PDF","using","chrome","."]
code: def convert(self, _from: str, _to: str) -> bool:
      """Converts the image from SVG to PDF using chrome."""
      with open(_from, "r") as f:
          svg = f.read()
  
      HTML = (
          "<html><head><style>body {margin: 0; }</style><script>function init() {const element = document.querySelector('svg');const positionInfo = element.getBoundingClientRect();const height = positionInfo.height;const width = positionInfo.width;const style = document.createElement('style');style.innerHTML = `@page {margin: 0; size: ${width}px ${height}px}`;document.head.appendChild(style); }window.onload = init;</script></head><body>%s</body></html>"
          % (svg)
      )
      temp_name = f"{_from}.html"
      with open(temp_name, "w") as f:
          f.write(HTML)
  
      chromium = self.chromium_command()
      code = self.command_runner(chromium, _to, temp_name)
      if code != 0:
          chrome = self.chrome_command()
          code = self.command_runner(chrome, _to, temp_name)
      if code != 0:
          logger.error(
              "Fail to convert svg to pdf. Make sure Chromium or Chrome is installed."
          )
          exit(1)
      return True
  
file_path: sympy/doc/ext/convert-svg-to-pdf.py
imports: from __future__ import annotations
  from sphinx.transforms.post_transforms.images import ImageConverter
  from sphinx.util import logging
  import os
  import platform
  from typing import Any
  from sphinx.application import Sphinx
label_desc: Use image node_id 5 for calling the Converter obj's underlying member method code with example usage: obj.convert(_from, _to) and returns: True