Package com.pdfgate
Class GeneratePdfParams.Builder
java.lang.Object
com.pdfgate.GeneratePdfParams.Builder
- Enclosing class:
GeneratePdfParams
Builder for
GeneratePdfParams.-
Method Summary
Modifier and TypeMethodDescriptionauthentication(GeneratePdfParams.GeneratePdfAuthentication authentication) Sets authentication credentials for protected web content.build()Builds parameters that request a JSON document response.clickSelector(String clickSelector) Sets a selector to click before rendering.clickSelectorChainSetup(GeneratePdfParams.ClickSelectorChainSetup clickSelectorChainSetup) Sets the click selector chain setup.Sets additional CSS to apply during rendering.Sets the delay in milliseconds before rendering.emulateMediaType(GeneratePdfParams.EmulateMediaType emulateMediaType) Sets the CSS media type to emulate.enableFormFields(Boolean enableFormFields) Sets whether to include interactive form fields in the output.Sets the footer HTML to apply on each page.Sets the header HTML to apply on each page.Sets the custom page height in pixels.Sets raw HTML content to render.httpHeaders(Map<String, String> httpHeaders) Sets custom HTTP headers used when loading the target URL.javascript(String javascript) Sets JavaScript to run before rendering.loadImages(Boolean loadImages) Sets whether to wait for all images to load before rendering.Sets the page margins.Sets metadata to attach to the generated document.orientation(GeneratePdfParams.FileOrientation orientation) Sets the page orientation.pageRanges(String pageRanges) Sets the page ranges to include (for example, "1-5" or "1,3,5").pageSizeType(GeneratePdfParams.PageSizeType pageSizeType) Sets the page size preset.preSignedUrlExpiresIn(Long preSignedUrlExpiresIn) Sets the pre-signed URL expiration time in seconds.printBackground(Boolean printBackground) Sets whether to print background graphics.Sets the scale factor applied during rendering.Sets the render timeout in milliseconds.Sets the public URL to render.Sets a custom user agent string.viewport(GeneratePdfParams.Viewport viewport) Sets the viewport dimensions for rendering.waitForNetworkIdle(Boolean waitForNetworkIdle) Sets whether to wait for network idle before rendering.waitForSelector(String waitForSelector) Sets a selector to wait for before rendering.Sets the custom page width in pixels.
-
Method Details
-
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
Sets the pre-signed URL expiration time in seconds.- Parameters:
preSignedUrlExpiresIn- expiration time in seconds.- Returns:
- this builder.
-
pageSizeType
Sets the page size preset.- Parameters:
pageSizeType- page size preset.- Returns:
- this builder.
-
width
Sets the custom page width in pixels.- Parameters:
width- custom page width in pixels.- Returns:
- this builder.
-
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
Sets the header HTML to apply on each page.- Parameters:
header- header HTML to apply on each page.- Returns:
- this builder.
-
margin
Sets the page margins.- Parameters:
margin- page margins.- Returns:
- this builder.
-
timeout
Sets the render timeout in milliseconds.- Parameters:
timeout- render timeout in milliseconds.- Returns:
- this builder.
-
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
Sets custom HTTP headers used when loading the target URL.- Parameters:
httpHeaders- custom HTTP headers.- Returns:
- this builder.
-
metadata
Sets metadata to attach to the generated document.- Parameters:
metadata- metadata to attach to the generated document.- Returns:
- this builder.
-
waitForSelector
Sets a selector to wait for before rendering.- Parameters:
waitForSelector- selector to wait for before rendering.- Returns:
- this builder.
-
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
Sets whether to wait for network idle before rendering.- Parameters:
waitForNetworkIdle- whether to wait for network idle.- Returns:
- this builder.
-
enableFormFields
Sets whether to include interactive form fields in the output.- Parameters:
enableFormFields- whether to include interactive form fields.- Returns:
- this builder.
-
delay
Sets the delay in milliseconds before rendering.- Parameters:
delay- delay in milliseconds before rendering.- Returns:
- this builder.
-
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
Sets the scale factor applied during rendering.- Parameters:
scale- scale factor applied during rendering.- Returns:
- this builder.
-
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
Sets whether to print background graphics.- Parameters:
printBackground- whether to print background graphics.- Returns:
- this builder.
-
userAgent
Sets a custom user agent string.- Parameters:
userAgent- custom user agent string.- Returns:
- this builder.
-
authentication
public GeneratePdfParams.Builder authentication(GeneratePdfParams.GeneratePdfAuthentication 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
Builds parameters that request a JSON document response.- Returns:
- parameters configured for JSON responses.
-