from ironpdf import *
import concurrent.futures
import uuid
# Instantiate Renderer
renderer = ChromePdfRenderer()
htmlStrings = ["<h1>Html#1</h1>", "<h1>Html#2</h1>", "<h1>Html#3</h1>"]
with concurrent.futures.ThreadPoolExecutor() as executor:
futures = []
for html in htmlStrings:
futures.append(executor.submit(renderer.RenderHtmlAsPdf, html))
# do something with each pdfDocument
for future in concurrent.futures.as_completed(futures):
pdf = future.result()
pdf.SaveAs(f"{uuid.uuid4()}.pdf")
# do something with each pdf
#Instantiate Renderer
#do something with each pdfDocument
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: from ironpdf import * import concurrent.futures import uuid renderer = ChromePdfRenderer() htmlStrings = ["<h1>Html#1</h1>", "<h1>Html#2</h1>", "<h1>Html#3</h1>"] with TryCast(concurrent.futures.ThreadPoolExecutor(), executor): futures = [] for html in htmlStrings: futures.append(executor.submit(renderer.RenderHtmlAsPdf, html)) for future in concurrent.futures.as_completed(futures): pdf = future.result() pdf.SaveAs(f"{uuid.uuid4()}.pdf")
() for html in htmlStrings: futures.append(executor.submit(renderer.RenderHtmlAsPdf, html)) for future in concurrent.futures.as_completed(futures): pdf = future.result() pdf.SaveAs(f"{uuid.uuid4()}.pdf")
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: from ironpdf import * import concurrent.futures import uuid renderer = ChromePdfRenderer() htmlStrings = ["<h1>Html#1</h1>", "<h1>Html#2</h1>", "<h1>Html#3</h1>"] with TryCast(concurrent.futures.ThreadPoolExecutor(), executor): futures = [] for html in htmlStrings: futures.append(executor.submit(renderer.RenderHtmlAsPdf, html)) for future in concurrent.futures.as_completed(futures): pdf
("<h1>Html#1</h1>", "<h1>Html#2</h1>", "<h1>Html#3</h1>") [with] TryCast(concurrent.futures.ThreadPoolExecutor(), executor): futures = () for html in htmlStrings: futures.append(executor.submit(renderer.RenderHtmlAsPdf, html)) for future in concurrent.futures.as_completed(futures): pdf
'INSTANT VB WARNING: An assignment within expression was extracted from the following statement:
'ORIGINAL LINE: from ironpdf import * import concurrent.futures import uuid renderer = ChromePdfRenderer() htmlStrings = ["<h1>Html#1</h1>", "<h1>Html#2</h1>", "<h1>Html#3</h1>"] with TryCast(concurrent.futures.ThreadPoolExecutor(), executor): futures
ChromePdfRenderer() htmlStrings = ("<h1>Html#1</h1>", "<h1>Html#2</h1>", "<h1>Html#3</h1>") [with] TryCast(concurrent.futures.ThreadPoolExecutor(), executor): futures
from ironpdf import * import concurrent.futures import uuid renderer = ChromePdfRenderer() htmlStrings
#do something with each pdf