IronPDF 故障排除 PDF版本 PDF 文件版本 Curtis Chau 已更新:2025年6月1日 下载 IronPDF NuGet 下载 DLL 下载 Windows 安装程序 免费试用 LLM副本 LLM副本 将页面复制为 Markdown 格式,用于 LLMs 在 ChatGPT 中打开 向 ChatGPT 咨询此页面 在双子座打开 向 Gemini 询问此页面 在 Grok 中打开 向 Grok 询问此页面 打开困惑 向 Perplexity 询问有关此页面的信息 分享 在 Facebook 上分享 分享到 X(Twitter) 在 LinkedIn 上分享 复制链接 电子邮件文章 This article was translated from English: Does it need improvement? Translated View the article in English 如何更改 PDF 版本? PDF 版本标签根据您创建 PDF 时使用的功能设置。 例如: 使用基本 PDF 没有使用高级功能时,可能是 1.4 添加一个高级功能,例如图层,意味着版本标签更新为 1.7 从 PDF 中移除图层将使版本标签改回 1.4 PDF 创建工具总是尝试使用最低的 PDF 版本以确保兼容性。 然而,可以通过IronPDF将 PDF 文件版本从 1.4 更改为 1.7 的一个技巧是结合使用 PdfDocument.Merge() 静态方法和 PdfDocument.RemovePage() 方法。 下面的代码片段演示了如何做到这一点: using IronPdf; var renderer = new ChromePdfRenderer(); // Render the initial PDF that needs its version changed. var pdf1 = renderer.RenderHtmlAsPdf("<h1>Hello, this is the required PDF</h1>"); // Render a mock PDF to use with the Merge() method. var pdf2 = renderer.RenderHtmlAsPdf("<h1>This is a mock PDF</h1>"); // Merge the two PDFs. This will update the version to 1.7 if new features from pdf2 are used. var pdf3 = PdfDocument.Merge(pdf1, pdf2); // Remove the page from the mock PDF, keeping only the original content. var pdf4 = pdf3.RemovePage(1); // Save the resulting PDF document. It should have a version updated to 1.7. pdf4.SaveAs("anothermerged.pdf"); using IronPdf; var renderer = new ChromePdfRenderer(); // Render the initial PDF that needs its version changed. var pdf1 = renderer.RenderHtmlAsPdf("<h1>Hello, this is the required PDF</h1>"); // Render a mock PDF to use with the Merge() method. var pdf2 = renderer.RenderHtmlAsPdf("<h1>This is a mock PDF</h1>"); // Merge the two PDFs. This will update the version to 1.7 if new features from pdf2 are used. var pdf3 = PdfDocument.Merge(pdf1, pdf2); // Remove the page from the mock PDF, keeping only the original content. var pdf4 = pdf3.RemovePage(1); // Save the resulting PDF document. It should have a version updated to 1.7. pdf4.SaveAs("anothermerged.pdf"); $vbLabelText $csharpLabel 您可以检查生成的 PDF 输出的 PDF 版本。 另一方面,您 也可以 手动在 PDF 中更改版本标签,例如从 1.4 到 2.0,但那只是一个标签,并不会以任何实质性方式改变 PDF 本身。 Curtis Chau 立即与工程团队聊天 技术作家 Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。 准备开始了吗? Nuget 下载 17,803,474 | 版本: 2026.3 刚刚发布 免费试用 免费 NuGet 下载 总下载量:17,803,474 查看许可证 还在滚动吗? 想快速获得证据? PM > Install-Package IronPdf 运行示例看着你的HTML代码变成PDF文件。 免费 NuGet 下载 总下载量:17,803,474 查看许可证