From 68f3fb3b119d43967431ce32fd12779677405ada Mon Sep 17 00:00:00 2001 From: Tomas Rutkauskas Date: Mon, 9 Nov 2026 15:46:13 +0200 Subject: [PATCH] examples: use the converters the API spec documents The production API spec (https://v2.convertapi.com/info/openapi) has no web -> pdf and no any -> zip converter. convert_url_to_pdf.py now converts the URL with html -> pdf (same Url and FileName parameters) and links the html-to-pdf page. conversions_chaining.py passes from_format = 'file' to the ZIP step: without a source format the library sends every zip conversion to any -> zip. Co-Authored-By: Claude Opus 5.5 --- examples/conversions_chaining.py | 2 +- examples/convert_url_to_pdf.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/conversions_chaining.py b/examples/conversions_chaining.py index 9e61a36..183b186 100644 --- a/examples/conversions_chaining.py +++ b/examples/conversions_chaining.py @@ -13,7 +13,7 @@ print("Conversions done. Cost: %s. Total files created: %s" % (jpg_result.conversion_cost, len(jpg_result.files))) -zip_result = convertapi.convert('zip', { 'Files': jpg_result.files }) +zip_result = convertapi.convert('zip', { 'Files': jpg_result.files }, from_format = 'file') print("Conversions done. Cost: %s. Total files created: %s" % (zip_result.conversion_cost, len(zip_result.files))) diff --git a/examples/convert_url_to_pdf.py b/examples/convert_url_to_pdf.py index 8e44273..fd942a8 100644 --- a/examples/convert_url_to_pdf.py +++ b/examples/convert_url_to_pdf.py @@ -5,7 +5,7 @@ convertapi.api_credentials = os.environ['API_TOKEN'] # your api token # Example of converting Web Page URL to PDF file -# https://www.convertapi.com/web-to-pdf +# https://www.convertapi.com/html-to-pdf result = convertapi.convert( 'pdf', @@ -13,7 +13,7 @@ 'Url': 'https://en.wikipedia.org/wiki/Data_conversion', 'FileName': 'web-example', }, - from_format = 'web', + from_format = 'html', timeout = 180, )