Class HTMLToPDFParams.Builder
- java.lang.Object
-
- com.adobe.pdfservices.operation.pdfjobs.params.htmltopdf.HTMLToPDFParams.Builder
-
- Enclosing class:
- HTMLToPDFParams
public static class HTMLToPDFParams.Builder extends Object
Builds aHTMLToPDFParams
instance.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs aBuilder
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HTMLToPDFParams
build()
Returns a newHTMLToPDFParams
instance built from the current state of this builder.HTMLToPDFParams.Builder
includeHeaderFooter(boolean includeHeaderFooter)
Sets the includeHeaderFooter parameter.HTMLToPDFParams.Builder
withDataToMerge(org.json.JSONObject dataToMerge)
Sets the data to be used by the javascript in the source html file to manipulate the HTML DOM before it gets converted to PDF.HTMLToPDFParams.Builder
withPageLayout(PageLayout pageLayout)
Sets the pageLayout parameter.
-
-
-
Method Detail
-
includeHeaderFooter
public HTMLToPDFParams.Builder includeHeaderFooter(boolean includeHeaderFooter)
Sets the includeHeaderFooter parameter. If true, default header and footer will be included in resulting PDF. The default header consists of the date and the document title. The default footer consists of the file name and page number.- Parameters:
includeHeaderFooter
- true if default header and footer should be included in the resulting PDF. Default value istrue
.- Returns:
- this Builder instance to add any additional parameters
-
withPageLayout
public HTMLToPDFParams.Builder withPageLayout(PageLayout pageLayout)
Sets the pageLayout parameter.- Parameters:
pageLayout
- intended page layout of the resulting PDF file.- Returns:
- this Builder instance to add any additional parameters
-
withDataToMerge
public HTMLToPDFParams.Builder withDataToMerge(org.json.JSONObject dataToMerge)
Sets the data to be used by the javascript in the source html file to manipulate the HTML DOM before it gets converted to PDF. This mechanism is intended to be used to supply data that might otherwise be retrieved using ajax requests.To make use of this mechanism, the source html file must include a script element such as:
And also Requires javascript in the source html file to make use of this JSON data to manipulate the HTML DOM.<script src='./json.js' type='text/javascript'></script>
where json.js refers to the JSON data,- Parameters:
dataToMerge
- JSON object- Returns:
- this Builder instance to add any additional parameters
-
build
public HTMLToPDFParams build()
Returns a newHTMLToPDFParams
instance built from the current state of this builder.- Returns:
- a new
HTMLtoPDFParams
instance.
-
-