IronPDF 开始 创建编辑 PDF Java AWS Lambda 如何在 Google Cloud 中运行 IronPDF for Java. Curtis Chau 已更新:2026年1月25日 下载 IronPDF Maven 下载 JAR 下载 免费试用 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 Note: We have not fully tested support with Google Cloud, but if you want to try, we have some Required Settings. 重要:必要设置 不支持 Zip 部署,因为 IronPDF 需要在运行时执行二进制文件。 默认的云功能 Docker 映像无法工作,因为它们缺少 Chrome 浏览器正常运行所需的软件包。 有关详细信息,请参阅 Google 云系统软件包。 请使用自定义的 Dockerfile 并安装所有必需的软件包。 请在我们的Linux部署指南中了解更多相关信息。 将 ironpdf-engine-linux-x64 依赖项添加到您的项目中(将版本号更改为最新版本): <dependency> <groupId>com.ironsoftware</groupId> <artifactId>ironpdf-engine-linux-x64</artifactId> <version>2022.xx.x</version> </dependency> <dependency> <groupId>com.ironsoftware</groupId> <artifactId>ironpdf-engine-linux-x64</artifactId> <version>2022.xx.x</version> </dependency> XML 该插件可能是必需的: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> </transformers> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>3.2.4</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> </transformers> </configuration> </execution> </executions> </plugin> XML 这些依赖项可能是必需的: <dependency> <groupId>io.perfmark</groupId> <artifactId>perfmark-api</artifactId> <version>0.26.0</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-okhttp</artifactId> <version>1.50.2</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-netty-shaded</artifactId> <version>1.50.2</version> </dependency> <dependency> <groupId>io.perfmark</groupId> <artifactId>perfmark-api</artifactId> <version>0.26.0</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-okhttp</artifactId> <version>1.50.2</version> </dependency> <dependency> <groupId>io.grpc</groupId> <artifactId>grpc-netty-shaded</artifactId> <version>1.50.2</version> </dependency> XML 由于启动缓慢,请将 timeout 设置为 330 seconds。 将 memory size 设置为至少 2048 MB。 将 Ephemeral Storage Size 设置为至少 1024 MB。 在某些环境下,您可能需要指定一个 IronPdfEngineWorkingDirectory 并为其设置执行权限: // Set the working directory for the IronPDF Engine Setting.setIronPdfEngineWorkingDirectory(Paths.get("/tmp/")); // Set the working directory for the IronPDF Engine Setting.setIronPdfEngineWorkingDirectory(Paths.get("/tmp/")); JAVA # Grant full read/write/execute permissions to the /tmp directory RUN chmod 777 /tmp/ 常见问题解答 如何在 Google Cloud 上设置 Java 的 PDF 库? 要在 Google Cloud 上设置 PDF 库,使用自定义 Dockerfile 按照 IronPDF Linux 部署指南安装所有必要软件包。包括 ironpdf-engine-linux-x64 依赖项,并配置特定的设置以获得最佳性能。 在 Google Cloud 上运行 PDF 库所需的特定设置是什么? 在 Google Cloud 上运行 PDF 库时,使用 330 秒的超时时间,内存大小至少为 2048 MB,临时存储大小至少为 1024 MB。此外,设置 IronPDFEngineWorkingDirectory 并确保该目录的执行权限。 为什么 Google Cloud 上的 PDF 库不支持 Zip 部署? 不支持 Zip 部署,因为 IronPDF 需要在运行时执行二进制文件,这对标准 Zip 部署方法不可行。 在 Google Cloud 上部署 PDF 库需要哪些额外的依赖项? 可能需要的其他依赖项包括 perfmark-api、grpc-okhttp 和 grpc-netty-shaded。这些可以确保库在部署时正常运行。 如何在 Google Cloud Docker 映像中处理 PDF 库的软件包需求? 默认的 Cloud Function Docker 映像缺少 Chrome 所需的软件包。使用自定义 Dockerfile 按照 IronPDF Linux 部署指南安装所有必要的软件包。 在 Docker 环境中部署 PDF 库是否需要特定的 Maven 插件? maven-shade-plugin 可能是 Docker 环境所需。它应该被配置以使用转换器,特别是在处理复杂依赖项时。 如何在 Docker 环境中设置 PDF 引擎的工作目录? 您可以使用 Setting.setIronPDFEngineWorkingDirectory(Paths.get("/tmp/")) 设置 PDF 引擎的工作目录。确保使用类似于 RUN chmod 777 /tmp/ 的命令在 Dockerfile 中授予必要的权限。 Curtis Chau 立即与工程团队聊天 技术作家 Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。 准备开始了吗? 版本: 2026.3 刚刚发布 免费试用 免费 Maven 下载 查看许可证 还在滚动吗? 想快速获得证据? 运行示例看着你的HTML代码变成PDF文件。 免费 Maven 下载 查看许可证