docstamp/svg_utils.py
def rsvg_export(input_file, output_file, dpi=90, rsvg_binpath=None):
    """ Calls the `rsvg-convert` command, to convert a svg to a PDF (with unicode).

    Parameters
    ----------

    rsvg_binpath: str
        Path to `rsvg-convert` command

    input_file: str
        Path to the input file

    output_file: str
        Path to the output file

    Returns
    -------
    return_value
        Command call return value

    """
    if not os.path.exists(input_file):
        log.error('File {} not found.'.format(input_file))
        raise IOError((0, 'File not found.', input_file))

    if rsvg_binpath is None:
        rsvg_binpath = which('rsvg-convert')
        check_command(rsvg_binpath)

    args_strings = []
    args_strings += ["-f pdf"]
    args_strings += ["-o {}".format(output_file)]
    args_strings += ["--dpi-x {}".format(dpi)]
    args_strings += ["--dpi-y {}".format(dpi)]
    args_strings += [input_file]

    return call_command(rsvg_binpath, args_strings)
def rsvg_export(input_file, output_file, dpi=90, rsvg_binpath=None):
    """ Calls the `rsvg-convert` command, to convert a svg to a PDF (with unicode).

    Parameters
    ----------

    rsvg_binpath: str
        Path to `rsvg-convert` command

    input_file: str
        Path to the input file

    output_file: str
        Path to the output file

    Returns
    -------
    return_value
        Command call return value

    """
    if not os.path.exists(input_file):
        log.error('File {} not found.'.format(input_file))
        raise IOError((0, 'File not found.', input_file))

    if rsvg_binpath is None:
        rsvg_binpath = which('rsvg-convert')
        check_command(rsvg_binpath)

    args_strings = []
    args_strings += ["-f pdf"]
    args_strings += ["-o {}".format(output_file)]
    args_strings += ["--dpi-x {}".format(dpi)]
    args_strings += ["--dpi-y {}".format(dpi)]
    args_strings += [input_file]

    return call_command(rsvg_binpath, args_strings)
def rsvg_export ( input_file , output_file , dpi = 90 , rsvg_binpath = None ) : if not os . path . exists ( input_file ) : log . error ( 'File {} not found.' . format ( input_file ) ) raise IOError ( ( 0 , 'File not found.' , input_file ) ) if rsvg_binpath is None : rsvg_binpath = which ( 'rsvg-convert' ) check_command ( rsvg_binpath ) args_strings = [ ] args_strings += [ "-f pdf" ] args_strings += [ "-o {}" . format ( output_file ) ] args_strings += [ "--dpi-x {}" . format ( dpi ) ] args_strings += [ "--dpi-y {}" . format ( dpi ) ] args_strings += [ input_file ] return call_command ( rsvg_binpath , args_strings )
Calls the `rsvg-convert` command, to convert a svg to a PDF (with unicode).

    Parameters
    ----------

    rsvg_binpath: str
        Path to `rsvg-convert` command

    input_file: str
        Path to the input file

    output_file: str
        Path to the output file

    Returns
    -------
    return_value
        Command call return value
Calls the rsvg - convert command to convert a svg to a PDF ( with unicode ) .