adobe.pdfservices.operation.pdfjobs.params.html_to_pdf package

Submodules

adobe.pdfservices.operation.pdfjobs.params.html_to_pdf.html_to_pdf_params module

class adobe.pdfservices.operation.pdfjobs.params.html_to_pdf.html_to_pdf_params.HTMLtoPDFParams(*, json: str = '{}', include_header_footer: bool = False, page_layout: ~adobe.pdfservices.operation.pdfjobs.params.html_to_pdf.page_layout.PageLayout = <adobe.pdfservices.operation.pdfjobs.params.html_to_pdf.page_layout.PageLayout object>)

Bases: PDFServicesJobParams

Parameters for converting HTML to PDF using HTMLtoPDFJob

Constructs a new HTMLtoPDFParams instance.

Parameters:
  • json (str) –

    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:

    <script src='./json.js' type='text/javascript'></script>

    where json.js refers to the JSON data,</pre> And also Requires javascript in the source html file to make use of this JSON data to manipulate the HTML DOM. (Optional, use key-value)

  • include_header_footer (bool) –

    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.

    (Optional, use key-value)

  • page_layout (PageLayout) – Intended page layout of the resulting PDF file. (Optional, use key-value)

Returns:

Returns true if default header and footer will be included in the resulting PDF file. - The default header consists of the date and the document title. - The default footer consists of the file name and page number.

Return type:

bool

get_json()
Returns:

Returns JSON data that will be used to manipulate HTML DOM before it is converted into PDF file. 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:

<script src='./json.js' type='text/javascript'></script>

where json.js refers to the JSON data,</pre> And also Requires javascript in the source html file to make use of this JSON data to manipulate the HTML DOM.

Return type:

str

get_page_layout()
Returns:

Intended page layout of the resulting PDF file.

Return type:

bool

adobe.pdfservices.operation.pdfjobs.params.html_to_pdf.page_layout module

class adobe.pdfservices.operation.pdfjobs.params.html_to_pdf.page_layout.PageLayout(page_height: float = 11.0, page_width: float = 8.5)

Bases: object

Represents a page layout with dimensions in inches.

Constructor to initialize a default page layout. The default layout sets the height as 11 inches and width as 8.5 inches.

Parameters:
  • page_height (float) – Height of the page in inches, can not be None

  • page_width (float) – Width of the page in inches

DEFAULT_PAGE_HEIGHT = 11.0

Default value of the page height (in inches)

DEFAULT_PAGE_WIDTH = 8.5

Default value of the page width (in inches)

json_hint = {'page_height': 'pageHeight', 'page_width': 'pageWidth'}
to_json()
Returns:

JSON representation of this class, used internally by sdk.

Module contents