Package com.pdfgate

Class GeneratePdfParams.Builder

java.lang.Object
com.pdfgate.GeneratePdfParams.Builder
Enclosing class:
GeneratePdfParams

public static final class GeneratePdfParams.Builder extends Object
Builder for GeneratePdfParams.
  • Method Details

    • html

      public GeneratePdfParams.Builder html(String html)
      Sets raw HTML content to render.
      Parameters:
      html - raw HTML content to render.
      Returns:
      this builder.
    • url

      Sets the public URL to render.
      Parameters:
      url - the public URL to render.
      Returns:
      this builder.
    • preSignedUrlExpiresIn

      public GeneratePdfParams.Builder preSignedUrlExpiresIn(Long preSignedUrlExpiresIn)
      Sets the pre-signed URL expiration time in seconds.
      Parameters:
      preSignedUrlExpiresIn - expiration time in seconds.
      Returns:
      this builder.
    • pageSizeType

      public GeneratePdfParams.Builder pageSizeType(GeneratePdfParams.PageSizeType pageSizeType)
      Sets the page size preset.
      Parameters:
      pageSizeType - page size preset.
      Returns:
      this builder.
    • width

      public GeneratePdfParams.Builder width(Integer width)
      Sets the custom page width in pixels.
      Parameters:
      width - custom page width in pixels.
      Returns:
      this builder.
    • height

      public GeneratePdfParams.Builder height(Integer height)
      Sets the custom page height in pixels.
      Parameters:
      height - custom page height in pixels.
      Returns:
      this builder.
    • orientation

      Sets the page orientation.
      Parameters:
      orientation - page orientation.
      Returns:
      this builder.
    • header

      public GeneratePdfParams.Builder header(String header)
      Sets the header HTML to apply on each page.
      Parameters:
      header - header HTML to apply on each page.
      Returns:
      this builder.
    • footer

      public GeneratePdfParams.Builder footer(String footer)
      Sets the footer HTML to apply on each page.
      Parameters:
      footer - footer HTML to apply on each page.
      Returns:
      this builder.
    • margin

      Sets the page margins.
      Parameters:
      margin - page margins.
      Returns:
      this builder.
    • timeout

      public GeneratePdfParams.Builder timeout(Integer timeout)
      Sets the render timeout in milliseconds.
      Parameters:
      timeout - render timeout in milliseconds.
      Returns:
      this builder.
    • javascript

      public GeneratePdfParams.Builder javascript(String javascript)
      Sets JavaScript to run before rendering.
      Parameters:
      javascript - JavaScript to run before rendering.
      Returns:
      this builder.
    • css

      Sets additional CSS to apply during rendering.
      Parameters:
      css - additional CSS to apply during rendering.
      Returns:
      this builder.
    • emulateMediaType

      public GeneratePdfParams.Builder emulateMediaType(GeneratePdfParams.EmulateMediaType emulateMediaType)
      Sets the CSS media type to emulate.
      Parameters:
      emulateMediaType - CSS media type to emulate.
      Returns:
      this builder.
    • httpHeaders

      public GeneratePdfParams.Builder httpHeaders(Map<String,String> httpHeaders)
      Sets custom HTTP headers used when loading the target URL.
      Parameters:
      httpHeaders - custom HTTP headers.
      Returns:
      this builder.
    • metadata

      public GeneratePdfParams.Builder metadata(Object metadata)
      Sets metadata to attach to the generated document.
      Parameters:
      metadata - metadata to attach to the generated document.
      Returns:
      this builder.
    • waitForSelector

      public GeneratePdfParams.Builder waitForSelector(String waitForSelector)
      Sets a selector to wait for before rendering.
      Parameters:
      waitForSelector - selector to wait for before rendering.
      Returns:
      this builder.
    • clickSelector

      public GeneratePdfParams.Builder clickSelector(String clickSelector)
      Sets a selector to click before rendering.
      Parameters:
      clickSelector - selector to click before rendering.
      Returns:
      this builder.
    • clickSelectorChainSetup

      public GeneratePdfParams.Builder clickSelectorChainSetup(GeneratePdfParams.ClickSelectorChainSetup clickSelectorChainSetup)
      Sets the click selector chain setup.
      Parameters:
      clickSelectorChainSetup - click selector chain setup.
      Returns:
      this builder.
    • waitForNetworkIdle

      public GeneratePdfParams.Builder waitForNetworkIdle(Boolean waitForNetworkIdle)
      Sets whether to wait for network idle before rendering.
      Parameters:
      waitForNetworkIdle - whether to wait for network idle.
      Returns:
      this builder.
    • enableFormFields

      public GeneratePdfParams.Builder enableFormFields(Boolean enableFormFields)
      Sets whether to include interactive form fields in the output.
      Parameters:
      enableFormFields - whether to include interactive form fields.
      Returns:
      this builder.
    • delay

      public GeneratePdfParams.Builder delay(Integer delay)
      Sets the delay in milliseconds before rendering.
      Parameters:
      delay - delay in milliseconds before rendering.
      Returns:
      this builder.
    • loadImages

      public GeneratePdfParams.Builder loadImages(Boolean loadImages)
      Sets whether to wait for all images to load before rendering.
      Parameters:
      loadImages - whether to wait for all images to load.
      Returns:
      this builder.
    • scale

      public GeneratePdfParams.Builder scale(Double scale)
      Sets the scale factor applied during rendering.
      Parameters:
      scale - scale factor applied during rendering.
      Returns:
      this builder.
    • pageRanges

      public GeneratePdfParams.Builder pageRanges(String pageRanges)
      Sets the page ranges to include (for example, "1-5" or "1,3,5").
      Parameters:
      pageRanges - page ranges to include.
      Returns:
      this builder.
    • printBackground

      public GeneratePdfParams.Builder printBackground(Boolean printBackground)
      Sets whether to print background graphics.
      Parameters:
      printBackground - whether to print background graphics.
      Returns:
      this builder.
    • userAgent

      public GeneratePdfParams.Builder userAgent(String userAgent)
      Sets a custom user agent string.
      Parameters:
      userAgent - custom user agent string.
      Returns:
      this builder.
    • authentication

      Sets authentication credentials for protected web content.
      Parameters:
      authentication - authentication credentials for protected web content.
      Returns:
      this builder.
    • viewport

      Sets the viewport dimensions for rendering.
      Parameters:
      viewport - viewport dimensions for rendering.
      Returns:
      this builder.
    • build

      public GeneratePdfParams build()
      Builds parameters that request a JSON document response.
      Returns:
      parameters configured for JSON responses.