from ironpdf import * import os # Set application scope temp path my_temp_path = "C:/safe/location/" os.environ["TEMP"] = my_temp_path os.environ["TMP"] = my_temp_path # Set IronPDF temp path Installation.TempFolderPath = os.path.join(my_temp_path, "IronPdfTemp") string = os.path.join(my_temp_path, "IronPdfTemp") # Your PDF generation and editing code here renderer = ChromePdfRenderer() doc = renderer.RenderHtmlAsPdf("<h1>Html with CSS and Images</h1>") doc.SaveAs("example.pdf")
設定臨時PDF文件路徑