相关文章推荐
销魂的洋葱
·
少狼:大电影 / Teen Wolf: ...
·
1 年前
·
文雅的海龟
·
河豚(河鲀的别称)_百度百科
·
1 年前
·
小百科
›
Spyder Python(开发人员如何使用)
pdf
html语言
python
叛逆的马克杯
2 月前
</noscript><nav id="desktop_nav" class="sticky-top d-none d-md-block" data-page-lockedmenu="false"><div class="titleBar dark"><div class="titleLogo"><a href="https://ironsoftware.com/zh/"><svg width="17" height="15" viewbox="0 0 17 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16.28 3.25317L15.5902 5.65762H9.93359L10.5774 3.25317H16.28Z" fill="#FDA509"/><path d="M6.30046 8.53589L5.65661 10.9875H0L0.597848 8.53589H6.30046Z" fill="#63C1A0"/><path d="M7.67937 3.25317L7.03552 5.65762H1.37891L2.02275 3.25317H7.67937Z" fill="#FDA509"/><path d="M7.03701 5.65919H4.59961L6.07125 0H8.50865L7.03701 5.65919Z" fill="#E01A59"/><path d="M14.8551 8.53589L14.2113 10.9875H8.55469L9.19853 8.53589H14.8551Z" fill="#63C1A0"/><path d="M10.164 14.2422H7.72656L9.19821 8.53589H11.6356L10.164 14.2422Z" fill="#89D3DF"/><path d="M12.417 5.65919H9.93359L11.4512 0H13.8886L12.417 5.65919Z" fill="#89D3DF"/><path d="M4.82909 14.2422H2.3457L3.81733 8.53589H6.30074L4.82909 14.2422Z" fill="#E01A59"/></svg> <span class="iron_name"><strong>IRON</strong>SOFTWARE</span></a></div><ul class="titleMenu"><li><a href="" class="collapseHover" data-bs-target="#collapseMenuProducts">产品<i class="fas fa-caret-down"/></a></li><li><a href="https://ironsoftware.com/zh/enterprise/" class="collapseHover" data-bs-target="#collapseMenuEnterprise">企业<i class="fas fa-caret-down"/></a></li><li><a href="" class="collapseHover" data-bs-target="#collapseMenuOpenSource">开源<i class="fas fa-caret-down"/></a></li><li><a href="" class="collapseHover" data-bs-target="#collapseMenuAboutUs">关于我们<i class="fas fa-caret-down"/></a></li><li><a href="https://ironsoftware.com/zh/contact-us/" target="_blank" class="">联系我们</a></li></ul><div class="titleRight"><div class="d-none d-xl-block iron_address overflow-hidden">205 N. Michigan Ave. Chicago, IL 60601, USA</div><div class="d-block" style="flex:0 1 15px;"/><div class="d-none d-xl-block iron_phone">+1 (312) 500-3060</div><div class="d-block" style="flex:0 1 32px;"/><div class="iron_slack d-none d-lg-block"><a class="d-flex align-items-center" href="https://ironsoftware.com/zh/company/iron-slack-community/"><span class="iron_slack_logo d-block"><svg width="14" height="14" viewbox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" class=""><path d="M2.95147 8.85032C2.95147 9.66401 2.29435 10.3217 1.4813 10.3217C0.668258 10.3217 0.0111376 9.66401 0.0111376 8.85032C0.0111376 8.03662 0.668258 7.37898 1.4813 7.37898H2.95147V8.85032ZM3.68655 8.85032C3.68655 8.03662 4.34368 7.37898 5.15672 7.37898C5.96977 7.37898 6.62689 8.03662 6.62689 8.85032V12.5287C6.62689 13.3424 5.96977 14 5.15672 14C4.34368 14 3.68655 13.3424 3.68655 12.5287V8.85032Z" fill="#E01E5A"/><path d="M5.15672 2.94268C4.34368 2.94268 3.68655 2.28503 3.68655 1.47134C3.68655 0.657643 4.34368 0 5.15672 0C5.96977 0 6.62689 0.657643 6.62689 1.47134V2.94268H5.15672ZM5.15672 3.68949C5.96977 3.68949 6.62689 4.34713 6.62689 5.16083C6.62689 5.97452 5.96977 6.63217 5.15672 6.63217H1.47017C0.65712 6.63217 0 5.97452 0 5.16083C0 4.34713 0.65712 3.68949 1.47017 3.68949H5.15672Z" fill="#36C5F0"/><path d="M11.0485 5.16083C11.0485 4.34713 11.7056 3.68949 12.5187 3.68949C13.3317 3.68949 13.9889 4.34713 13.9889 5.16083C13.9889 5.97452 13.3317 6.63217 12.5187 6.63217H11.0485V5.16083ZM10.3134 5.16083C10.3134 5.97452 9.65632 6.63217 8.84328 6.63217C8.03023 6.63217 7.37311 5.97452 7.37311 5.16083V1.47134C7.37311 0.657643 8.03023 0 8.84328 0C9.65632 0 10.3134 0.657643 10.3134 1.47134V5.16083Z" fill="#2EB67D"/><path d="M8.84328 11.0573C9.65632 11.0573 10.3134 11.715 10.3134 12.5287C10.3134 13.3424 9.65632 14 8.84328 14C8.03023 14 7.37311 13.3424 7.37311 12.5287V11.0573H8.84328ZM8.84328 10.3217C8.03023 10.3217 7.37311 9.66401 7.37311 8.85032C7.37311 8.03662 8.03023 7.37898 8.84328 7.37898H12.5298C13.3429 7.37898 14 8.03662 14 8.85032C14 9.66401 13.3429 10.3217 12.5298 10.3217H8.84328Z" fill="#ECB22E"/></svg></span>加入 Iron Slack</a></div><div class="d-block" style="flex:0 1 32px;"/><li class="iron_lang-menu dropdown" data-bs-target="#headerLangNameMenuDropdown"><span type="button" class="dropdown-toggle" id="iron_lang-menu__language-name_dropdown__current-language" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">简体中文</span><ul id="headerLangNameMenuDropdown" class="dropdown-menu" aria-labelledby="headerLangNameMenuDropdown"><li class="dropdown-item"><a class="i18n__distrans" data-language-code="en" data-href="/python/blog/python-pdf-tools/spyder-python-guide/" onclick="window.location='/python/blog/python-pdf-tools/spyder-python-guide/'">English</a></li><li class="dropdown-item"><a class="i18n__distrans" data-language-code="es" data-href="/es/python/blog/python-pdf-tools/spyder-python-guide/" onclick="window.location='/es/python/blog/python-pdf-tools/spyder-python-guide/'">Español</a></li><li class="dropdown-item"><a class="i18n__distrans" data-language-code="de" data-href="/de/python/blog/python-pdf-tools/spyder-python-guide/" onclick="window.location='/de/python/blog/python-pdf-tools/spyder-python-guide/'">Deutsch</a></li><li class="dropdown-item"><a class="i18n__distrans" data-language-code="fr" data-href="/fr/python/blog/python-pdf-tools/spyder-python-guide/" onclick="window.location='/fr/python/blog/python-pdf-tools/spyder-python-guide/'">Français</a></li><li class="dropdown-item"><a class="i18n__distrans" data-language-code="ja" data-href="/ja/python/blog/python-pdf-tools/spyder-python-guide/" onclick="window.location='/ja/python/blog/python-pdf-tools/spyder-python-guide/'">日本語</a></li><li class="dropdown-item"><a class="i18n__distrans" data-language-code="zh_TW" data-language-alias="zh-hant" data-href="/zh-hant/python/blog/python-pdf-tools/spyder-python-guide/" onclick="window.location='/zh-hant/python/blog/python-pdf-tools/spyder-python-guide/'">繁體中文</a></li></ul></li></div></div><section id="collapseMenuAboutUs" class="collapse menuCollapse"><div class="wrapper mx-auto justify-content-center" style=""><section class="menu_block"><h2>我们的公司</h2><ul class="listing"><li><a href="https://ironsoftware.com/zh/about-us/">关于我们 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/trust-center/">信任中心 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/news/company-news/">公司新闻 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/customers/">客户 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/about-us/ecogrant/">环境承诺 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/beta/">测试计划 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/news/company-news/2023-wrap-up/">2023年回顾 <i class="fa fa-caret-right"/></a></li></ul></section><section class="menu_block"><h2>销售伙伴</h2><ul class="listing"><li><a href="https://ironsoftware.com/zh/resellers/">全球经销商 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/merchant-of-record/">订购商 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/partners/itconsultancy/">咨询合作伙伴 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/partners/technology/">技术合作伙伴 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/partners/microsoftmvp/">微软最有价值专家 <i class="fa fa-caret-right"/></a></li><li><a href="https://ironsoftware.com/zh/partners/affiliate/">加入联盟 <i class="fa fa-caret-right"/></a></li></ul></section><section class="menu_block"><h2>联系我们</h2><ul class="listing"><li><a href="#live-chat-support" onclick="return window.HubSpotConversations.widget.open()"><div class="flex_wrapper"><i class="far fa-comment-alt leading_icon"/><span>在线聊天 <i class="fa fa-caret-right"/></span></div></a></li><li><a href="mailto:sales@ironsoftware.com"><div class="flex_wrapper"><i class="far fa-envelope leading_icon"/><span>发送电子邮件 <i class="fa fa-caret-right"/></span></div></a></li></ul><div class="hr"/><div class="address_info"><div class="flex_wrapper"><i class="fa fa-phone-volume leading_icon"/><span>+1 (312) 500-3060</span></div><div class="flex_wrapper"><i class="fa fa-location-dot leading_icon"/><span>205 北密歇根大道<br/>美国伊利诺伊州芝加哥 60601</span></div></div></section><section class="menu_block"><h2>Iron职业机会</h2><div style=" left:0; right:0; height:204px; bottom:0px;"><div class="careers_image_layer"><img loading="lazy" src="/img/company/about/who_we_are.webp" alt="加入我们的团队" class="img-fluid"/><a href="https://ironsoftware.com/zh/careers/" class="button" target="_blank">加入我们团队</a><div class="highlight">我们正在招聘</div></div></div></section></div></section><section id="collapseMenuProducts" class="collapse menuCollapse"><div class="wrapper mx-auto justify-content-center" style=""><div class="ironproduct-wrapper"><section class="menu_outer"><a class="menubox" href="/zh/" title="点击查看IronPDF主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironpdf-logo.svg" class="productSymbol" width="130" height="130" alt="ironpdf_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironpdf-text.svg" height="15" alt="ironpdf_logo"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="/">.NET</label></div><div class="break add_margin_top"/><div class="menuProgLn"><label class="progItem openWebsiteWithDataURL" data-url="/java/">Java</label><label class="progItem openWebsiteWithDataURL" data-url="/python/">Python</label><label class="progItem openWebsiteWithDataURL" data-url="/nodejs/">Node.js</label></div></div><div class="textDesc">创建、阅读和编辑PDF</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/word/" title="点击查看IronWord主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironword-logo.svg" class="productSymbol" width="130" height="130" alt="ironword_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironword-text-without-icon-white.svg" height="15" alt="ironword_logo"/><div class="break_top"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/word/">.NET</label></div></div><div class="textDesc">编辑 DOCX Word 文件<br/>无需Office互操作性</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/excel/" title="点击查看IronXL主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironxl-logo.svg" class="productSymbol" width="130" height="130" alt="ironxl_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironxl-text.svg" height="15" alt="ironxl_logo"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/excel/">.NET</label></div><div class="break add_margin_top"/><div class="menuProgLn"><label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/python/excel/">Python</label></div></div><div class="textDesc">编辑 Excel 和 CSV 文件。<br/>无需Office互操作性</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/ocr/" title="点击查看IronOCR主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironocr-logo.svg" class="productSymbol" width="130" height="130" alt="ironocr_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironocr-text.svg" height="15" alt="ironocr_logo"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/ocr/">.NET</label></div></div><div class="textDesc">图像转文字支持127种语言</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/barcode/" title="点击查看IronBarcode主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironbarcode-logo.svg" class="productSymbol" width="130" height="130" alt="ironbarcode_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironbarcode-text.svg" height="15" alt="ironbarcode_logo"/><div class="break_top"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/barcode/">.NET</label></div></div><div class="textDesc">读取和写入条形码</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/qr/" title="点击查看IronQR主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironqr-logo.svg" class="productSymbol" width="130" height="130" alt="ironqr_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironqr-text.svg" height="15" alt="ironqr_logo"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/qr/">.NET</label></div></div><div class="textDesc">使用机器学习检测读取和写入二维码</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/zip/" title="点击查看IronZIP主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironzip-logo.svg" class="productSymbol" width="130" height="130" alt="铁压缩_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironzip-text.svg" height="15" alt="铁压缩_logo"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/zip/">.NET</label></div></div><div class="textDesc">压缩和解压档案</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/print/" title="点击查看IronPrint主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironprint-logo.svg" class="productSymbol" width="130" height="130" alt="ironprint_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironprint-text.svg" height="15" alt="ironprint_logo"/><div class="break_top"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/print/">.NET</label></div></div><div class="textDesc">文件的自定义打印</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/csharp/webscraper/" title="点击查看IronWebScraper主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironwebscraper-logo.svg" class="productSymbol" width="130" height="130" alt="ironwebscraper_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironwebscraper-text.svg" height="15" alt="ironwebscraper_logo"/><div class="break_top"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/csharp/webscraper/">.NET</label></div></div><div class="textDesc">从网站提取结构化数据</div></a></section></div><div class="suite-offer-wrapper"><section class="menu_outer"><a class="menubox promotionBox" href="https://ironsoftware.com/zh/suite/" title="点击查看Iron Suite许可"><img loading="lazy" class="ironsuite-logo-white" src="/img/products/suite-logo-text-dotnet-large-white-v2__zh.svg" width="154" height="136"/> <img loading="lazy" class="ironsuite-logo-white mobile-view" src="/img/products/suite-logo-text-dotnet-large-white-v3.svg" width="215" height="116"/> <span class="title">全部9个适用于<br/>价格为2 </span><span class="action"><span class="promotionButton">使用 Iron Suite 节省 75%</span></span><div class="position-absolute" style="right:25px; bottom:8px;"><img loading="lazy" src="/img/svgs/teamseas-logo-for-dropdown.svg" alt="Iron Suites - 捐赠 $50" class="img-fluid" width="94" height="36"/></div></a></section></div></div></section><section id="collapseMenuEnterprise" class="collapse menuCollapse"><div class="wrapper mx-auto" style=""><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/enterprise/" title="点击查看企业主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironsuite-enterprise-icon.svg" class="productSymbol" width="130" height="130" alt="ironsuite-enterprise_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironsuite-enterprise-text-without-icon-white.svg" height="27" alt="ironsuite-enterprise_logo"/></div><div class="textDesc">企业许可</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/enterprise/securedoc/" title="点击查看 IronSecureDoc 主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironsecuredoc-logo.svg" class="productSymbol" width="130" height="130" alt="ironsecuredoc_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironsecuredoc-text-without-icon-white.svg" height="15" alt="ironsecuredoc_logo"/></div><div class="textDesc">PDF 安全与合规性</div></a></section></div></section><section id="collapseMenuOpenSource" class="collapse menuCollapse"><div class="wrapper mx-auto" style=""><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/open-source/csharp/drawing/" title="点击查看IronDrawing主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/irondrawing-logo.svg" class="productSymbol" width="130" height="130" alt="IronDrawing_标志"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/irondrawing-text-without-icon-white_2.svg" height="15" alt="IronDrawing_标志"/><div class="mainProLn">for <label class="progItem openWebsiteWithDataURL" data-url="https://ironsoftware.com/open-source/csharp/drawing/">.NET</label></div></div><div class="textDesc">System.Drawing.Common 替代品</div></a></section><section class="menu_outer"><a class="menubox" href="https://ironsoftware.com/zh/open-source/csharp/free-tools/json-to-csharp-converter/" title="点击查看IronFreeTools主页"><div class="productLogo"><img loading="lazy" src="/img/svgs/navbar/ironfreetools-logo.svg" class="productSymbol" width="130" height="130" alt="ironfreetools_logo"/><div class="shadow_overlay"/></div><div class="productLogoText d-flex flex-row align-items-end"><img loading="lazy" src="/img/products/ironfreetools-text-without-icon-white-text.svg" height="15" alt="ironfreetools_logo"/></div><div class="textDesc">免费软件开发工具</div></a></section></div></section><section id="devMenuDesktop"><div class="d-flex mx-auto" style="max-width:1470px; padding:2px; align-items:center; padding-left:18px; padding-right:18px;"><div class="d-flex dropdown-center programselect"><div class="productLogoWrapper"><a href="/zh/python/" title="点击查看IronPDF主页"><img loading="lazy" src="/img/products/ironpdf-logo-text.svg" alt="IronPDF - Python库" width="auto" height="34"/></a></div><div class="d-flex proglang_selector"><div class="textFor">for</div><div class="program-select align-self-center"><div class="dropdown-toggle-by-hover position-relative" data-bs-target="#devProgLangSelector" aria-expanded="false"><div class="dropdown-program-selected">Python</div><ul id="devProgLangSelector" class="dropdown-menu"><li><a href="/zh/" title="点击查看IronPDF for .NET">.NET</a></li><li><a href="/zh/java/" title="点击查看IronPDF for Java">Java <span class="navbarProgLN__sub">通过 gRPC</span></a></li><li><a href="/zh/python/" title="点击查看IronPDF for Python">Python <span class="navbarProgLN__sub">通过 .NET</span></a></li><li><a href="/zh/nodejs/" title="点击查看 IronPDF for Node.js">Node.js <span class="navbarProgLN__sub">通过 gRPC</span></a></li></ul></div></div></div></div><div class="flex-grow-1"/><div><ul class="devMenu"><li id="header-navbar-white-item-home"><a href="/zh/python/" title="主页" class="item active">主页</a></li><li id="header-navbar-white-item-licensing"><div class="menuGroup"><a href="/zh/python/licensing/" title="许可" class="item text-nowrap">许可<i class="fas fa-angle-down arrow"/></a><ul class="menuDropDown"><li id="header-navbar-white-item-buy-license"><a class="" href="/zh/python/licensing/"><span class="iwrap"><i class="fa-kit fa-licensing"/></span>许可</a></li><li id="header-navbar-white-item-eula"><a class="" href="/zh/python/licensing/#license-terms-modal-tabs-eula" data-modal-licensing-tab-id="license-terms-modal-tabs-eula"><span class="iwrap"><i class="fa-kit fa-eula"/></span>最终用户许可协议</a></li><li id="header-navbar-white-item-how-to-use-license"><a class="" href="/zh/python/how-to/license-keys/"><span class="iwrap"><i class="fa-regular fa-circle-question"/></span>如何使用许可证密钥</a></li><li class="free-trial" id="header-navbar-white-item-license-trial"><a class="js-modal-open" href="/zh/python/#trial-license" data-modal-id="trial-license" data-bs-toggle="modal" data-bs-target="#trial-license"><span class="iwrap"><i class="fa-regular fa-key"/></span>开始免费试用</a></li></ul></div></li><li id="header-navbar-white-item-docs"><div class="menuGroup"><a href="/zh/python/docs/" title="文档" class="item text-nowrap">文档<i class="fas fa-angle-down arrow"/></a><ul class="menuDropDown"><li id="header-navbar-white-item-get-started"><a class="" href="/zh/python/docs/"><span class="iwrap"><i class="fa-regular fa-rocket-launch"/></span>入门</a></li><li id="header-navbar-white-item-code-examples"><a class="" href="/zh/python/examples/using-html-to-create-a-pdf/"><span class="iwrap"><i class="fa-regular fa-code"/></span>代码示例</a></li><li id="header-navbar-white-item-tutorials"><a class="" href="/zh/python/tutorials/html-to-pdf/"><span class="iwrap"><i class="fa-regular fa-graduation-cap fa-flip-horizontal"/></span>教程</a></li><li id="header-navbar-white-item-faq"><a class="" href="/zh/python/how-to/license-keys/"><span class="iwrap"><i class="fa-regular fa-circle-question"/></span>操作指南</a></li><li id="header-navbar-white-item-troubleshooting"><a class="" href="/zh/python/troubleshooting/failed-to-locate-ironpdf/"><span class="iwrap"><i class="fas fa-wrench"/></span>故障排除</a></li><li class="api-ref" id="header-navbar-white-item-changelog"><a class="" href="/zh/python/product-updates/changelog/"><span class="iwrap"><i class="fa-regular fa-arrows-rotate"/></span>产品更新</a></li></ul></div></li></ul></div><div class="downloadButtonTop"><a id="header-navbar-white-cta-button text-nowrap" class="js-modal-open btn btn-red" href="#download-modal" target="_blank" data-modal-id="download-modal" title="点击查看 IronPDF 在 pypi.org 上的页面"><i class="pip-icon-white"/> <span>免费 pip 安装</span></a><div class="download_button_2407__wrapper"><a class="download_button_2407__button js-modal-open" href="https://pypi.org/project/IronPdf/" data-modal-id="download-modal" target="_blank"><span class="download_button_2407__main_icon_wrapper"><i class="fa-kit fa-pypi"/></span> 免费开始<i class="fa-solid fa-caret-down ms-2 download_button_2407__button__arrow"/></a><div class="download_button_2407__content"><div class="download_button_2407__menu"><a aria-label="" class="js-modal-open" target="_blank" href="https://pypi.org/project/IronPdf/" data-modal-id="download-modal"><span class="download_button_2407__icon_wrapper"><i class="fa-kit fa-pypi"/></span> pip 下载 </a><a href="#trial-license" class="the_trial" aria-label="" data-bs-toggle="modal" data-bs-target="#trial-license"><span class="download_button_2407__icon_wrapper"><i class="fa-solid fa-key"/></span>开始免费试用</a></div></div></div></div></div><div id="reading-progressbar"><div class="progress-bar"/></div></section></nav><nav id="mobile_nav" class="sticky-top d-block d-md-none"><div class="devTitleBar d-flex align-items-center shadow"><a href="#" data-bs-toggle="offcanvas" data-bs-target="#offCanvasProducts" aria-controls="menuoffcanvas" class="d-flex"><div style="background-color:#141414; height:40px; padding:0 10px;" class="d-flex align-items-center"><img loading="lazy" src="https://ironsoftware.com/img/svgs/logo-icon.svg" width="24" height="24"/><div style="font-size:10px; color:#fff;" class="align-self-end"><i class="fas fa-caret-down"/></div></div><div style="width:12px; height:40px;" class="theshard"><i class="fa-kit fa-shard"/></div></a><div class="d-flex flex-grow-1 align-items-end overflow-x-hidden"><div class="product_for"><a href="/zh/python/" title="IronPDF"><img loading="lazy" src="/img/products/ironpdf-text-without-icon-black.svg" alt="IronPDF - Python库" height="16"/><div class="textFor">对于</div></a></div><div id="plang_dropdown" class="xx_dropdown-center"><button type="button" data-bs-toggle="dropdown" class="btn btn-secondary dropdown-toggle" aria-expanded="false">Python</button><ul class="dropdown-menu shadow"><li><a href="/zh/" title="点击查看IronPDF for .NET">.NET</a></li><li><a href="/zh/java/" title="点击查看IronPDF for Java">Java</a></li><li><a href="/zh/python/" title="点击查看IronPDF for Python">Python</a></li><li><a href="/zh/nodejs/" title="点击查看 IronPDF for Node.js">Node.js</a></li></ul></div></div><div data-bs-toggle="offcanvas" data-bs-target="#offCanvasDev" aria-controls="menuoffcanvas" class="icon_bars cursorPointer"><i class="fas fa-bars"/></div></div><div id="offCanvasProducts" class="offcanvas devmode offcanvas-start" tabindex="-1" aria-labelledby="IronSoftwareProductsMenu"><div class="body transparent-scrollbar"><div class="accordion" id="accordionProductGroup"><ul class="layer1"><li class="home"><a href="https://ironsoftware.com/zh/" title="点击查看Iron Software主页">铁软件 <em>主页</em></a></li><li><div class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapseProducts" aria-expanded="false" aria-controls="collapseProducts">产品</div><ul id="collapseProducts" class="collapse layer2" data-bs-parent="#accordionProductGroup"><li><a href="https://ironsoftware.com/zh/suite/" class="productname" title="Click to view Iron Suite licensing"><div>IRON<span style="color:#e01a59;">SUITE</span></div></a></li><li><hr/></li><li><a href="/zh/" class="productname" title="Click to view the IronPDF homepage"><div>IRON<span style="color:#e01a59;">PDF</span></div><div class="badge update">更新</div></a></li><li><a href="https://ironsoftware.com/zh/csharp/word/" class="productname" title="Click to view the IronWord homepage"><div>IRON<span style="color:#89D3DF;">WORD</span></div></a></li><li><a href="https://ironsoftware.com/zh/csharp/excel/" class="productname" title="Click to view the IronXL homepage"><div>IRON<span style="color:#63c1a0;">XL</span></div></a></li><li><a href="https://ironsoftware.com/zh/csharp/ocr/" class="productname" title="Click to view the IronOCR homepage"><div>IRON<span style="color:#89d3df;">OCR</span></div></a></li><li><a href="https://ironsoftware.com/zh/csharp/barcode/" class="productname" title="Click to view the IronBarcode homepage"><div>IRON<span style="color:#63c1a0;">BARCODE</span></div></a></li><li><a href="https://ironsoftware.com/zh/csharp/qr/" class="productname" title="Click to view the IronQR homepage"><div>IRON<span style="color:#63c1a0;">QR</span></div></a></li><li><a href="https://ironsoftware.com/zh/csharp/zip/" class="productname" title="Click to view the IronZIP homepage"><div>IRON<span style="color:#FDA509;">ZIP</span></div></a></li><li><a href="https://ironsoftware.com/zh/csharp/print/" class="productname" title="Click to view the IronPRINT homepage"><div>IRON<span style="color:#FDA509;">PRINT</span></div></a></li><li><a href="https://ironsoftware.com/zh/csharp/webscraper/" class="productname" title="Click to view the IronWebScraper homepage"><div>IRON<span style="color:#fda509;">WEBSCRAPER</span></div></a></li></ul></li><li><div class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapseEnterprise" aria-expanded="false" aria-controls="collapseEnterprise">企业</div><ul id="collapseEnterprise" class="layer2 collapse" data-bs-parent="#accordionProductGroup"><li><a href="https://ironsoftware.com/zh/enterprise/securedoc/" class="productname" title="点击查看IronSECUREDOC主页"><div>铁<span style="color:#ef5214;">安全数据中心</span></div></a></li></ul></li><li><div class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapseOpenSource" aria-expanded="false" aria-controls="collapseOpenSource">开源</div><ul id="collapseOpenSource" class="layer2 collapse" data-bs-parent="#accordionProductGroup"><li><a href="https://ironsoftware.com/zh/open-source/csharp/drawing/docs/" class="productname" title="点击查看IronDRAWING主页"><div>铁<span style="color:#63C1A0;">绘图</span></div></a></li><li><a href="https://ironsoftware.com/zh/open-source/csharp/free-tools/json-to-csharp-converter/" class="productname" title="点击查看IronFREETOOLS主页"><div>铁<span style="color:#fda509;">FREETOOLS</span></div></a></li></ul></li><li><div class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapseAboutUs" aria-expanded="false" aria-controls="collapseOpenSource">关于我们</div><ul id="collapseAboutUs" class="layer2 collapse" data-bs-parent="#accordionProductGroup"><li><a href="https://ironsoftware.com/zh/about-us/" title="点击查看关于我们页面"><div>关于我们</div></a></li><li><a href="https://ironsoftware.com/zh/news/company-news/" title="点击查看公司新闻页面"><div>公司新闻</div></a></li><li><a href="https://ironsoftware.com/zh/customers/" title="点击查看客户页面"><div>客户</div></a></li><li><a href="https://ironsoftware.com/zh/about-us/ecogrant/" title="点击查看环境承诺页面"><div>环境承诺</div></a></li><li><a href="https://ironsoftware.com/zh/beta/" title="点击查看测试版程序页面"><div>测试计划</div></a></li><li><a href="https://ironsoftware.com/zh/news/company-news/2023-wrap-up/" title="点击查看2023年回顾页面"><div>2023年回顾</div></a></li><li><a href="https://ironsoftware.com/zh/#live-chat-support" title="与我们的团队聊天" onclick="return window.HubSpotConversations.widget.open()"><div>在线聊天</div></a></li><li><a href="https://ironsoftware.com/zh/resellers/" title="点击查看全球经销商页面"><div>全球经销商</div></a></li><li><a href="https://ironsoftware.com/zh/careers/" title="点击查看职业页面"><div>加入我们的团队</div></a></li></ul></li><li><a href="https://ironsoftware.com/zh/contact-us/" title="点击查看联系我们页面">联系我们</a></li></ul></div></div><div class="/h-100" data-bs-dismiss="offcanvas"/></div><div id="offCanvasDev" class="offcanvas offcanvas-end" tabindex="-1" aria-labelledby="IronSoftwareDeveloperMenu"><div class="body transparent-scrollbar /h-100"><div class="accordion" id="accordionDevGroup"><ul class="layer1"><li><a href="/zh/python/" class="item"><span class="iwrap"><i class="fa-regular fa-home"/></span>主页</a></li><li><div class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-1" aria-expanded="false" aria-controls="collapseProducts"><span class="iwrap"><i class="fa-kit fa-licensing"/></span>许可</div><ul id="collapse-1" class="collapse layer2" data-bs-parent="#accordionDevGroup"><li><a class="" href="/zh/python/licensing/"><span class="iwrap"><i class="fa-kit fa-licensing"/></span>许可</a></li><li><a class="" href="/zh/python/licensing/" data-modal-licensing-tab-id="license-terms-modal-tabs-eula"><span class="iwrap"><i class="fa-kit fa-eula"/></span>最终用户许可协议</a></li><li><a class="" href="/zh/python/how-to/license-keys/"><span class="iwrap"><i class="fa-regular fa-circle-question"/></span>如何使用许可证密钥</a></li><li><hr/></li><li><a class="js-modal-open" href="/zh/python/" data-modal-id="trial-license" data-bs-toggle="modal" data-bs-target="#trial-license"><span class="iwrap"><i class="fa-regular fa-key"/></span>开始免费试用</a></li></ul></li><li><div class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#collapse-2" aria-expanded="false" aria-controls="collapseProducts"><span class="iwrap"><i class="fa-regular fa-book"/></span>文档</div><ul id="collapse-2" class="collapse layer2" data-bs-parent="#accordionDevGroup"><li><a class="" href="/zh/python/docs/"><span class="iwrap"><i class="fa-regular fa-rocket-launch"/></span>入门</a></li><li><a class="" href="/zh/python/examples/using-html-to-create-a-pdf/"><span class="iwrap"><i class="fa-regular fa-code"/></span>代码示例</a></li><li><a class="" href="/zh/python/tutorials/html-to-pdf/"><span class="iwrap"><i class="fa-regular fa-graduation-cap fa-flip-horizontal"/></span>教程</a></li><li><a class="" href="/zh/python/how-to/license-keys/"><span class="iwrap"><i class="fa-regular fa-circle-question"/></span>操作指南</a></li><li><a class="" href="/zh/python/troubleshooting/failed-to-locate-ironpdf/"><span class="iwrap"><i class="fas fa-wrench"/></span>故障排除</a></li><li><hr/></li><li><a class="" href="/zh/python/product-updates/changelog/"><span class="iwrap"><i class="fa-regular fa-arrows-rotate"/></span>产品更新</a></li></ul></li></ul></div><div class="/h-100" data-bs-dismiss="offcanvas"/></div></div></nav><div id="header-navbar-search" class="js-search search-box shadow" data-visible-class="search-box_visible"><div class="js-search__close search-box__backdrop"><div class="js-search__close-exception search-box__container"><div class="js-search-offset-block search-box__field"><label class="search-box__label"><span class="search-box__label-icon"><i class="fa-solid fa-magnifying-glass"/> </span><input id="header-navbar-search-input" class="js-search__input search-box__label-input" type="search" autocomplete="off" placeholder="搜索API、代码示例和教程"/></label> <button class="js-search__close search-box__close"/></div><div class="js-search__results search-box__results search-box__results_horizontal" data-visible-class="search-box__results_visible"><div class="search-box__list-wrapper"><div class="js-search__list-overflow search-box__list"><div id="header-navbar-search-results-list" class="js-search__list search-box__list-inner" data-insights-index="ironpdf-python__zh"/></div></div><div id="header-navbar-search-results-preview" class="search-box__preview-wrapper"><div class="js-search__preview-overflow search-box__preview"><div class="js-search__preview search-box__preview-inner"><div class="js-search__preview-icon-wrapper search-box__preview-icon-wrapper" data-visible-class="search-box__preview-icon-wrapper_visible"><i class="js-search__preview-icon search-box__preview-icon" data-added-class-before=""/></div><div class="js-search__preview-title search-box__preview-title" data-visible-class="search-box__preview-title_visible"/><div class="js-search__preview-breadcrumbs search-box__preview-breadcrumbs" data-visible-class="search-box__preview-breadcrumbs_visible"/><div class="js-search__preview-content search-box__preview-content" data-visible-class="search-box__preview-content_visible"/></div></div></div></div><div id="header-navbar-search-message" class="js-search__message search-box__results search-box__results_padding-bottom" data-visible-class="search-box__results_visible"><div class="search-box__results-icon"><img loading="lazy" class="js-search__message-icon search-box__results-icon-img" src="/img/svgs/search-no-results.svg" alt="消息图标"/></div><div class="js-search__message-text search-box__results-text"/></div></div></div></div><header id="header" class="products-header products-header_margin-top-desktop"><div class="banner banner--padding-30 banner__product-home-top-image--left-ironpdf banner__blog-header-w-code-example"><div class="row mx-auto container-fluid banner__container_margin-bottom banner__container--padding-left"><div class="col-12 col-md-5 position-for-dark-mode"><p class="product-homepage-header product-homepage-header--ironpdf-python">Python PDF库</p><ul class="list-unstyled banner-list"><li>适用于 Python 3+ 的 HTML 转 PDF 转换器</li><li>可用作 <a href="/zh/" target="_blank"><strong>.NET</strong></a>, <a href="/zh/java/" target="_blank"><strong>Java</strong></a>, <strong><a href="/zh/nodejs/" target="_blank">Node.js</a></strong> 和 <strong><a href="/zh/python/">Python</a></strong> PDF生成器</li><li>使用Python创建、编辑或读取PDF文本的50多个功能</li></ul><div class="banner__buttons banner__buttons--blog"><a class="btn btn-red btn-red--margin-right-20 blog-explore-cta-ab" href="/zh/python/">探索 IronPDF <i class="navbar__item-icon fas fa-chevron-right fa-chevron-right--font-size-13"/> </a><a id="page-home-section-banner-cta-button" class="js-modal-open banner__link-white-text" href="https://pypi.org/project/IronPdf/" target="_blank" data-modal-id="trial-license-after-download" title="点击查看 IronPDF 在 pypi.org 上的页面"><i class="pip-icon-white pip-icon-white2--top-1"/> <span>免费 pip 安装</span> <i class="navbar__item-icon fas fa-chevron-right fa-chevron-right--font-size-13"/> </a><a class="js-modal-open banner__link-white-text banner__link-white-text--start-free-trial" data-modal-id="trial-license" href="#trial-license"><i class="fas fa-key"/> Start Free Trial</a></div></div><div class="tutorial-examples tutorial-examples--blog col-md-7" id="code-examples"><div class="tutorial-examples__background-linear-gradient"/><div class="examples-box examples-box_margin-left examples-box--ironpdf-blog"><div class="hidden col left-bar"><h2 style="font-family: 'Gotham-Black';">示例</h2><div id="code-dropdown"><select class="selectpicker" data-style="btn-iron" data-width="100%"/></div><div class="nav-side-menu" style="height: 277px;"><i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"/><div class="menu-list"><ul id="menu-content" class="menu-content collapse out" data-collapse-proxy="#code-dropdown select"><li data-code-content="sample-using-html-to-create-a-pdf" data-hash-url="true"><a href="javascript:void(0)">HTML 转 PDF</a></li><li data-code-content="sample-file-to-pdf" data-hash-url="true"><a href="javascript:void(0)">HTML 文件转 PDF</a></li><li data-code-content="sample-converting-a-url-to-a-pdf" data-hash-url="true"><a href="javascript:void(0)">URL 到 PDF</a></li><li data-code-content="sample-image-to-pdf" data-hash-url="true"><a href="javascript:void(0)">图像转换为PDF</a></li></ul></div></div></div><div class="col right-bar"><div class="code-content lander show" id="sample-using-html-to-create-a-pdf"><div class="code_window add-shadow"><div class="code_window_title"><span style="margin-right: 10px;"><i class="vs-icon2"/> </span><span class="filename" style="margin-left: 0; margin-right: 19px;">HTML 转 PDF</span> <a class="btn-run fancybox" href="/zh/img/code-examples/run-html-to-pdf.pdf" data-fancybox="" data-type="pdf" data-src="/img/code-examples/run-html-to-pdf.pdf"><i class="fa fa-play"/> 运行</a></div><div class="code_window_content"><pre class="prettyprint linenums lang-cs"><code>from ironpdf import * # Instantiate Renderer renderer = ChromePdfRenderer() # Create a PDF from a HTML string using Python pdf = renderer.RenderHtmlAsPdf("<h1>Hello World</h1>") # Export to a file or Stream pdf.SaveAs("output.pdf") # Advanced Example with HTML Assets # Load external html assets: Images, CSS and JavaScript. # An optional BasePath 'C:\site\assets\' is set as the file location to load assets from myAdvancedPdf = renderer.RenderHtmlAsPdf("<img src='icons/iron.png'>", r"C:\site\assets") myAdvancedPdf.SaveAs("html-with-assets.pdf")</code></pre></div><div class="code_window_bottom"/></div></div><div class="code-content lander hide" id="sample-file-to-pdf"><div class="code_window add-shadow"><div class="code_window_title"><span style="margin-right: 10px;"><i class="vs-icon2"/> </span><span class="filename" style="margin-left: 0; margin-right: 19px;">HTML 文件转 PDF</span> <a class="btn-run fancybox" href="/zh/img/code-examples/run-html-file-to-pdf.pdf" data-fancybox="" data-type="pdf" data-src="/img/code-examples/run-html-file-to-pdf.pdf"><i class="fa fa-play"/> 运行</a></div><div class="code_window_content"><pre class="prettyprint linenums lang-cs"><code>from ironpdf import * # Instantiate Renderer renderer = ChromePdfRenderer() # Create a PDF from an existing HTML file using Python pdf = renderer.RenderHtmlFileAsPdf("example.html") # Export to a file or Stream pdf.SaveAs("output.pdf")</code></pre></div><div class="code_window_bottom"/></div></div><div class="code-content lander hide" id="sample-converting-a-url-to-a-pdf"><div class="code_window add-shadow"><div class="code_window_title"><span style="margin-right: 10px;"><i class="vs-icon2"/> </span><span class="filename" style="margin-left: 0; margin-right: 19px;">URL 到 PDF</span> <a class="btn-run fancybox" href="/zh/img/code-examples/run-url-to-pdf.pdf" data-fancybox="" data-type="pdf" data-src="/img/code-examples/run-url-to-pdf.pdf"><i class="fa fa-play"/> 运行</a></div><div class="code_window_content"><pre class="prettyprint linenums lang-cs"><code>from ironpdf import * # Instantiate Renderer renderer = ChromePdfRenderer() # Create a PDF from a URL or local file path pdf = renderer.RenderUrlAsPdf("https://ironpdf.com/") # Export to a file or Stream pdf.SaveAs("url.pdf")</code></pre></div><div class="code_window_bottom"/></div></div><div class="code-content lander hide" id="sample-image-to-pdf"><div class="code_window add-shadow"><div class="code_window_title"><span style="margin-right: 10px;"><i class="vs-icon2"/> </span><span class="filename" style="margin-left: 0; margin-right: 19px;">图像转换为PDF</span></div><div class="code_window_content"><pre class="prettyprint linenums lang-cs"><code>from ironpdf import * # One or more images as a list. This example selects all JPEG images in a specific 'assets' folder. image_files = [os.path.join("assets", f) for f in os.listdir("assets") if f.lower().endswith(('.jpg', '.jpeg'))] directory_list = List[str]() for i in range(len(image_files)):
推荐文章
销魂的洋葱
·
少狼:大电影 / Teen Wolf: The Movie (2023) 4K高清版本下载-4k家园
1 年前
文雅的海龟
·
河豚(河鲀的别称)_百度百科
1 年前