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. 重要提示:必需設置 由於IronPDF需要在運行時執行二進位文件,因此不支援 Zip 部署。 預設的雲端函數 Docker 映像無法正常運作,因為它們缺少 Chrome 正常運作所需的軟體包。 有關更多信息,請參閱Google Cloud 系統包。 請使用自訂 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 上不支持 Zip 部署 PDF 庫? 不支持 Zip 部署,因為 IronPDF 需要在運行時執行二進制文件,而這在標準 Zip 部署方法中是無法實現的。 在 Google Cloud 上部署 PDF 庫需要哪些附加依賴項? 可能需要的附加依賴項包括 perfmark-api、grpc-okhttp 和 grpc-netty-shaded。這些依賴項確保部署後庫能正常運行。 如何在 Google Cloud Docker 映像中處理 PDF 庫的包需求? 默認的 Cloud Function Docker 映像缺少 Chrome 所需的包。使用自定義 Dockerfile 安裝所有必需包,並按照 IronPDF Linux 部署指南中的指示進行操作。 是否有特定的 Maven 插件需要在 Docker 環境中部署 PDF 庫? 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 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。 準備好開始了嗎? 版本: 2026.3 剛剛發布 開始免費試用 免費 Maven 下載 查看許可證 還在捲動嗎? 想要快速證明? 執行範例 觀看您的 HTML 變成 PDF。 免費 Maven 下載 查看許可證