View Source Api2pdf.Chrome (Api2pdf v0.1.2)
Convert HTML document, web page to PDF or Image using Headless Chrome backend.
Link to this section Summary
Functions
Convert HTML document to Image with default configuration.
Convert HTML document to PDF with default configuration.
Send a convert request with an option to specify complete parameters that are supported by the API.
Convert URL to image with default configuration.
Convert URL to PDF with default configuration.
Link to this section Functions
Convert HTML document to Image with default configuration.
For a full control of request options please use request/2
.
examples
Examples
Api2pdf.Chrome.html_to_image("<p>", tag: "some-tag")
Convert HTML document to PDF with default configuration.
For a full control of request options please use request/2
.
examples
Examples
Api2pdf.Chrome.html_to_pdf("<p>", tag: "some-tag")
@spec request( %{ :__struct__ => Api2pdf.Model.ChromeHtmlToImageRequest | Api2pdf.Model.ChromeHtmlToPdfRequest | Api2pdf.Model.ChromeUrlToImageRequest | Api2pdf.Model.ChromeUrlToPdfRequest, optional(any()) => any() }, keyword() ) :: {:error, any()} | {:ok, ApiSuccessResponse.t()}
Send a convert request with an option to specify complete parameters that are supported by the API.
Payloads are modeled in the form of struct and options is keyword.
Available request payloads:
Api2pdf.Model.ChromeHtmlToImageRequest
Api2pdf.Model.ChromeHtmlToPdfRequest
Api2pdf.Model.ChromeUrlToImageRequest
Api2pdf.Model.ChromeUrlToPdfRequest
examples
Examples
payload = %Api2pdf.Model.ChromeHtmlToPdfRequest{url: "https://example.com", inline: false}
result = request(payload, tag: "some-tag")
Convert URL to image with default configuration.
For a full control of request options please use request/2
.
examples
Examples
Api2pdf.Chrome.url_to_image("https://example.com", tag: "some-tag")
Convert URL to PDF with default configuration.
For a full control of request options please use request/2
.
examples
Examples
Api2pdf.Chrome.url_to_pdf("https://example.com", tag: "some-tag")