pdf.to Open in urlscan Pro
204.48.21.33  Public Scan

Submitted URL: http://api.mp4.to/
Effective URL: https://pdf.to/api/
Submission: On May 24 via manual from CZ — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

NAV
python

 * 
 * Von PDF konvertieren
   * PDF zu DOCX
   * PDF zu DOC
   * PDF zu JPG
   * PDF zu PNG
   * PDF zu XLSX
   * PDF zu XLS
   * PDF zu PPTX
   * PDF zu PPT
   * PDF zu TXT
   * PDF zu HTML
   * PDF zu ODT
   * PDF zu CSV
   * PDF zu ePub
   * PDF zu TIFF
   * PDF zu BMP
   * PDF zu SVG
   * PDF zu ZIP
   * PDF zu WebP
   * PDF zu GIF
   * PDF zu PSD
 * In PDF konvertieren
   * DOCX zu PDF
   * DOC zu PDF
   * 
   * JPG zu PDF
   * PNG zu PDF
   * PPTX zu PDF
   * PPT zu PDF
   * TXT zu PDF
   * HTML zu PDF
   * ODT zu PDF
   * CSV zu PDF
   * ePub zu PDF
   * BMP zu PDF
   * SVG zu PDF
   * TIFF zu PDF
   * WebP zu PDF
   * GIF zu PDF
   * PSD zu PDF
 * PDF komprimieren
   * PDF komprimieren

 * Melden Sie sich für einen Entwicklerschlüssel an

Willkommen bei der PDF.to API-Dokumentation

Um einen Entwicklerschlüssel zu erhalten, gehen Sie bitte zuEntwicklerportal

Authorization: <api_key>

Bitte ersetzen Sie `<api_key> ` mit Ihrem eigenen API-Schlüssel wie
`sdklajljlajsdlfjasdfj`


VON PDF KONVERTIEREN


PDF ZU DOCX

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-docx',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))



> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.docx


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU DOC

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-doc',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()
# PDF komprimieren

## PDF komprimieren

```python
import requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-compress',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein

get_results(convert_files(api_url, params, headers)) ```

> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.doc


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU JPG

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-jpg',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.jpg


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU PNG

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-png',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.png


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU XLSX

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-xlsx',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.xlsx


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU XLS

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-xls',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.xls


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU PPTX

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-pptx',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pptx


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU PPT

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-ppt',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.ppt


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU TXT

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-txt',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.txt


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU HTML

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-html',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.html


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU ODT

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-odt',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.odt


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU CSV

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-csv',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.csv


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU EPUB

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-epub',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.epub


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU TIFF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-tiff',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.tiff


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU BMP

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-bmp',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.bmp


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU SVG

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-svg',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.svg


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU ZIP

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-zip',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.zip


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU WEBP

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-webp',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.webp


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU GIF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-gif',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.gif


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF ZU PSD

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-psd',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.psd


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


IN PDF KONVERTIEREN


DOCX ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.docx', 'testfiles/blah.docx', 'testfiles/blah.docx']
params = {
    'lang': 'en',
    'convert_to': 'docx-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


DOC ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'doc-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein




Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'xlsx-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


JPG ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'jpg-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PNG ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'png-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PPTX ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pptx-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PPT ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'ppt-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


TXT ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.txt', 'testfiles/blah.txt', 'testfiles/blah.txt']
params = {
    'lang': 'en',
    'convert_to': 'txt-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


HTML ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.html', 'testfiles/blah.html', 'testfiles/blah.html']
params = {
    'lang': 'en',
    'convert_to': 'html-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


ODT ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.odt', 'testfiles/blah.odt', 'testfiles/blah.odt']
params = {
    'lang': 'en',
    'convert_to': 'odt-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


CSV ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.csv', 'testfiles/blah.csv', 'testfiles/blah.csv']
params = {
    'lang': 'en',
    'convert_to': 'csv-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


EPUB ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'epub-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


BMP ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.bmp', 'testfiles/blah.bmp', 'testfiles/blah.bmp']
params = {
    'lang': 'en',
    'convert_to': 'bmp-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


SVG ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.svg', 'testfiles/blah.svg', 'testfiles/blah.svg']
params = {
    'lang': 'en',
    'convert_to': 'svg-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


TIFF ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.tiff', 'testfiles/blah.tiff', 'testfiles/blah.tiff']
params = {
    'lang': 'en',
    'convert_to': 'tiff-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


WEBP ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'webp-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


GIF ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.gif', 'testfiles/blah.gif', 'testfiles/blah.gif']
params = {
    'lang': 'en',
    'convert_to': 'gif-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PSD ZU PDF

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.psd', 'testfiles/blah.psd', 'testfiles/blah.psd']
params = {
    'lang': 'en',
    'convert_to': 'psd-pdf',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein


PDF KOMPRIMIEREN


PDF KOMPRIMIEREN

Copy to Clipboardimport requests
import time
import shutil
import json

headers = {'Authorization': 'yourapikeyfoundinadmin'}
file_list = ['testfiles/blah.pdf', 'testfiles/blah.pdf', 'testfiles/blah.pdf']
params = {
    'lang': 'en',
    'convert_to': 'pdf-compress',
    'ocr': False
}

api_url = 'https://api.pdf.to/v1/convert/'
results_url = 'https://api.pdf.to/v1/results/'


def download_file(url, local_filename):
    with requests.get("https://api.pdf.to/%s" % url, stream=True) as r:
        with open(local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)
    return local_filename


def convert_files(api_url, params, headers):
    files = [eval(f'("files", open("{file}", "rb"))') for file in file_list]
    print(files)
    r = requests.post(
        url=api_url,
        files=files,
        data=params,
        headers=headers
    )
    return r.json()


def get_results(params):
    if params.get('error'):
        return params.get('error')
    r = requests.post(
        url=results_url,
        data=params
    )
    data = r.json()
    finished = data.get('finished')
    while not finished:
        if int(data.get('queue_count')) > 0:
            print('queue: %s' % data.get('queue_count'))
        time.sleep(5)
        results = get_results(params)
        print(results)
        results = json.dumps(results)
        if results:
            break
    if finished:
        print(data.get('files'))
        for f in data.get('files'):
            print(f.get('url'))
            download_file("%s" % f.get('url'), "%s" % f.get('filename'))
        return {"finished": "files downloaded"}
    return r.json()


get_results(convert_files(api_url, params, headers))


> Wird zurückkehren

Copy to Clipboard/path/to/local/file_processed.pdf


Um mehrere zu erstellen, fügen Sie einfach weitere Dateien in Ihre Liste ein

python