class_docstr: A class of the initial plot object.
  
  Do not use this class explicitly.
  
  Instead, you should construct its objects with functions `ggplot()`,
  `corr_plot(...).points().build()` etc.
class_docstr_tok: ["A","class","of","the","initial","plot","object",".","Do","not","use","this","class","explicitly",".","Instead",",","you","should","construct","its","objects","with","functions","`","ggplot","(",")","`",",","`","corr_plot","(","...",")",".points","(",")",".build","(",")","`","etc","."]
docstr: Export a plot to a file or to a file-like object in PDF format.
  
  Parameters
  ----------
  self : `PlotSpec`
      Plot specification to export.
  path : str, file-like object
      Сan be either a string specifying a file path or a file-like object.
      If a string is provided, the result will be exported to the file at that path.
      If a file-like object is provided, the result will be exported to that object.
  scale : float
      Scaling factor for raster output. Default value is 2.0.
  
  Returns
  -------
  str
      Absolute pathname of created file or None if file-like object is provided.
  
  Notes
  -----
  Export to PDF file uses the CairoSVG library.
  CairoSVG is free and distributed under the LGPL-3.0 license.
  For more details visit: https://cairosvg.org/documentation/
  
  Examples
  --------
  .. jupyter-execute::
      :linenos:
      :emphasize-lines: 13
  
      import numpy as np
      import io
      import os
      from lets_plot import *
      from IPython import display
      LetsPlot.setup_html()
      n = 60
      np.random.seed(42)
      x = np.random.choice(list('abcde'), size=n)
      y = np.random.normal(size=n)
      p = ggplot({'x': x, 'y': y}, aes(x='x', y='y')) + geom_jitter()
      file_like = io.BytesIO()
      p.to_pdf(file_like)
code: def to_pdf(self, path, scale: float = None) -> str:
      """
      Export a plot to a file or to a file-like object in PDF format.
  
      Parameters
      ----------
      self : `PlotSpec`
          Plot specification to export.
      path : str, file-like object
          Сan be either a string specifying a file path or a file-like object.
          If a string is provided, the result will be exported to the file at that path.
          If a file-like object is provided, the result will be exported to that object.
      scale : float
          Scaling factor for raster output. Default value is 2.0.
  
      Returns
      -------
      str
          Absolute pathname of created file or None if file-like object is provided.
  
      Notes
      -----
      Export to PDF file uses the CairoSVG library.
      CairoSVG is free and distributed under the LGPL-3.0 license.
      For more details visit: https://cairosvg.org/documentation/
  
      Examples
      --------
      .. jupyter-execute::
          :linenos:
          :emphasize-lines: 13
  
          import numpy as np
          import io
          import os
          from lets_plot import *
          from IPython import display
          LetsPlot.setup_html()
          n = 60
          np.random.seed(42)
          x = np.random.choice(list('abcde'), size=n)
          y = np.random.normal(size=n)
          p = ggplot({'x': x, 'y': y}, aes(x='x', y='y')) + geom_jitter()
          file_like = io.BytesIO()
          p.to_pdf(file_like)
      """
      return _export_as_raster(self, path, scale, "pdf")
  
imports: import io
  import json
  import os
  from typing import Union
  from lets_plot._global_settings import get_global_bool, has_global_value, FRAGMENTS_ENABLED
label_desc: Use image node_id 13 for calling the PlotSpec obj's underlying member method code with example usage: obj.to_pdf(path, scale) and returns: _export_as_raster