def datapackage_to_pdf(datapackage):
    '\n    datapackage: datapackage schema as a dictionary\n    returns: binary content with the PDF or None if the conversion failed.\n    '
    markdown = datapackage_to_markdown(datapackage)
    f = NamedTemporaryFile(suffix='.pdf', delete=False)
    f.close()
    command_line = ['pandoc', '--to=latex', f'--output={f.name}']
    try:
        pandoc_process = subprocess.run(command_line, input=markdown)
    except FileNotFoundError:
        os.unlink(f.name)
        raise OSError(f'FileNotFoundError trying to execute: {command_line}')
    except subprocess.CalledProcessError:
        os.unlink(f.name)
        raise RuntimeError(f'CalledProcessError trying to execute: {command_line}')
    if (pandoc_process.returncode != 0):
        os.unlink(f.name)
        raise RuntimeError(f'Command {command_line} returned a PDF file of size 0')
    pdf_file = open(f.name, 'rb')
    pdf_content = pdf_file.read()
    os.unlink(f.name)
    return pdf_content
datapackage: datapackage schema as a dictionary
returns: binary content with the PDF or None if the conversion failed.
def datapackage_to_pdf(datapackage):
    '\n    datapackage: datapackage schema as a dictionary\n    returns: binary content with the PDF or None if the conversion failed.\n    '
    markdown = datapackage_to_markdown(datapackage)
    f = NamedTemporaryFile(suffix='.pdf', delete=False)
    f.close()
    command_line = ['pandoc', '--to=latex', f'--output={f.name}']
    try:
        pandoc_process = subprocess.run(command_line, input=markdown)
    except FileNotFoundError:
        os.unlink(f.name)
        raise OSError(f'FileNotFoundError trying to execute: {command_line}')
    except subprocess.CalledProcessError:
        os.unlink(f.name)
        raise RuntimeError(f'CalledProcessError trying to execute: {command_line}')
    if (pandoc_process.returncode != 0):
        os.unlink(f.name)
        raise RuntimeError(f'Command {command_line} returned a PDF file of size 0')
    pdf_file = open(f.name, 'rb')
    pdf_content = pdf_file.read()
    os.unlink(f.name)
    return pdf_content