如何在 Google 云中运行 IronPDF for Java

This article was translated from English: Does it need improvement?
Translated
View the article in English

注意:我们尚未全面测试对 Google Cloud 的支持,但如果您想尝试,我们有一些工具可以帮助您。 所需设置.

重要:必需的设置

    <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>

                <!--  required for Docker-->
                <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>
XML
  • 由于启动缓慢,将 "超时 "设置为 "330 秒"。
  • 将 "内存大小 "至少设为 "2048 MB"。
  • EphemeralStorage Size 设置为至少 `1024 MB。
  • 在某些环境中,可能需要指向一个 IronPdfEngineWorkingDirectory 并为其设置执行权限:
    Setting.setIronPdfEngineWorkingDirectory(Paths.get("/tmp/"));
JAVA
    RUN chmod 777 /tmp/