Package com.pdfgate

Class GeneratePdfParams

java.lang.Object
com.pdfgate.GeneratePdfParams

public final class GeneratePdfParams extends Object
Parameters for generating a PDF from raw HTML or a public URL.

Provide either html or url. Additional options control page size, margins, rendering behavior, media emulation, and advanced wait conditions. Responses are JSON-only; use GeneratePdfParams.Builder.build() for a PdfGateDocument response.

  • Method Details

    • builder

      public static GeneratePdfParams.Builder builder()
      Creates a new builder for generate PDF parameters.
      Returns:
      the builder for generate PDF parameters.
    • getHtml

      public String getHtml()
      Returns the raw HTML content to render.
      Returns:
      the raw HTML content to render.
    • getUrl

      public String getUrl()
      Returns the public URL to render.
      Returns:
      the public URL to render.
    • getJsonResponse

      public Boolean getJsonResponse()
      Returns whether the API should return JSON instead of raw bytes.
      Returns:
      whether the API should return JSON instead of raw bytes.
    • isJsonResponse

      public boolean isJsonResponse()
      Returns whether the API should return JSON instead of raw bytes.
      Returns:
      whether the API should return JSON instead of raw bytes.
    • getPreSignedUrlExpiresIn

      public Long getPreSignedUrlExpiresIn()
      Returns the pre-signed URL expiration time in seconds, if provided.
      Returns:
      the pre-signed URL expiration time in seconds, if provided.
    • getPageSizeType

      public GeneratePdfParams.PageSizeType getPageSizeType()
      Returns the requested page size preset.
      Returns:
      the requested page size preset.
    • getWidth

      public Integer getWidth()
      Returns the custom page width in pixels, if provided.
      Returns:
      the custom page width in pixels, if provided.
    • getHeight

      public Integer getHeight()
      Returns the custom page height in pixels, if provided.
      Returns:
      the custom page height in pixels, if provided.
    • getOrientation

      public GeneratePdfParams.FileOrientation getOrientation()
      Returns the page orientation, if provided.
      Returns:
      the page orientation, if provided.
    • getHeader

      public String getHeader()
      Returns the HTML header applied to each page, if provided.
      Returns:
      the HTML header applied to each page, if provided.
    • getFooter

      public String getFooter()
      Returns the HTML footer applied to each page, if provided.
      Returns:
      the HTML footer applied to each page, if provided.
    • getMargin

      public GeneratePdfParams.PdfPageMargin getMargin()
      Returns the page margins, if provided.
      Returns:
      the page margins, if provided.
    • getTimeout

      public Integer getTimeout()
      Returns the timeout in milliseconds for the render, if provided.
      Returns:
      the timeout in milliseconds for the render, if provided.
    • getJavascript

      public String getJavascript()
      Returns JavaScript to run before rendering, if provided.
      Returns:
      JavaScript to run before rendering, if provided.
    • getCss

      public String getCss()
      Returns additional CSS to apply during rendering, if provided.
      Returns:
      additional CSS to apply during rendering, if provided.
    • getEmulateMediaType

      public GeneratePdfParams.EmulateMediaType getEmulateMediaType()
      Returns the CSS media type to emulate during rendering, if provided.
      Returns:
      the CSS media type to emulate during rendering, if provided.
    • getHttpHeaders

      public Map<String,String> getHttpHeaders()
      Returns custom HTTP headers applied when loading the target URL, if provided.
      Returns:
      custom HTTP headers applied when loading the target URL, if provided.
    • getMetadata

      public Object getMetadata()
      Returns metadata to attach to the generated document, if provided.
      Returns:
      metadata to attach to the generated document, if provided.
    • getWaitForSelector

      public String getWaitForSelector()
      Returns the selector to wait for before rendering, if provided.
      Returns:
      the selector to wait for before rendering, if provided.
    • getClickSelector

      public String getClickSelector()
      Returns the selector to click before rendering, if provided.
      Returns:
      the selector to click before rendering, if provided.
    • getClickSelectorChainSetup

      public GeneratePdfParams.ClickSelectorChainSetup getClickSelectorChainSetup()
      Returns click chain setup used before rendering, if provided.
      Returns:
      click chain setup used before rendering, if provided.
    • getWaitForNetworkIdle

      public Boolean getWaitForNetworkIdle()
      Returns whether to wait for network idle before rendering, if provided.
      Returns:
      whether to wait for network idle before rendering, if provided.
    • getEnableFormFields

      public Boolean getEnableFormFields()
      Returns whether interactive form fields should be enabled, if provided.
      Returns:
      whether interactive form fields should be enabled, if provided.
    • getDelay

      public Integer getDelay()
      Returns the delay in milliseconds before rendering, if provided.
      Returns:
      the delay in milliseconds before rendering, if provided.
    • getLoadImages

      public Boolean getLoadImages()
      Returns whether images must load before rendering, if provided.
      Returns:
      whether images must load before rendering, if provided.
    • getScale

      public Double getScale()
      Returns the scale factor applied during rendering, if provided.
      Returns:
      the scale factor applied during rendering, if provided.
    • getPageRanges

      public String getPageRanges()
      Returns the page ranges to include, if provided.
      Returns:
      the page ranges to include, if provided.
    • getPrintBackground

      public Boolean getPrintBackground()
      Returns whether to print background graphics, if provided.
      Returns:
      whether to print background graphics, if provided.
    • getUserAgent

      public String getUserAgent()
      Returns the custom user agent string, if provided.
      Returns:
      the custom user agent string, if provided.
    • getAuthentication

      public GeneratePdfParams.GeneratePdfAuthentication getAuthentication()
      Returns authentication credentials for protected content, if provided.
      Returns:
      authentication credentials for protected content, if provided.
    • getViewport

      public GeneratePdfParams.Viewport getViewport()
      Returns the viewport size for rendering, if provided.
      Returns:
      the viewport size for rendering, if provided.