View Source Api2pdf.Wkhtml (Api2pdf v0.1.2)
Convert HTML document or web page to PDF using Wkhtml backend.
Link to this section Summary
Functions
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 PDF with default configuration.
Link to this section Functions
@spec html_to_pdf( String.t(), keyword() ) :: {:error, any()} | {:ok, Api2pdf.Model.ApiSuccessResponse.t()}
Convert HTML document to PDF with default configuration.
For a full control of request options please use request/2
.
examples
Examples
Api2pdf.Wkhtml.html_to_pdf("<p>", tag: "some-tag")
@spec request(struct(), keyword()) :: {:error, any()} | {:ok, Api2pdf.Model.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:
examples
Examples
payload = %Api2pdf.Model.WkhtmlUrlToPdfRequest{url: "https://example.com", inline: false}
result = request(payload, tag: "some-tag")
@spec url_to_pdf( String.t(), keyword() ) :: {:error, any()} | {:ok, Api2pdf.Model.ApiSuccessResponse.t()}
Convert URL to PDF with default configuration.
For a full control of request options please use request/2
.
examples
Examples
Api2pdf.Wkhtml.url_to_pdf("https://example.com", tag: "some-tag")