selectpdf 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +2 -0
- data/README.md +44 -0
- data/lib/selectpdf.rb +1528 -0
- data/samples/html_to_pdf_headers_and_footers.rb +61 -0
- data/samples/html_to_pdf_main.rb +64 -0
- data/samples/simple_html_string_to_pdf.rb +19 -0
- data/samples/simple_url_to_pdf.rb +19 -0
- metadata +53 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e1b01d19459d947fb94bf4f77dc1aafbba803a743048833cdc09e4afe28fd503
|
4
|
+
data.tar.gz: '076768d12da86311acb539d4db80e13386dc5f787ffbd0b154a199d9c5f7f37e'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a437743ef3ddca89b6226abe8e8796f563b02c536880087c7059fba6dfe386056aa422b3bcca0cc3c9bd502e5e39a50dde355cd9aa7496bc828a09541533ff1b
|
7
|
+
data.tar.gz: 12a433f79e0bcbab9a7ca9e63d5d2cf071de04e1470d2b929c1737e03369eb502037c751aaa04a5ad09bf7a001cc58306f9ec5c7c3abb490be021b8121976e09
|
data/CHANGELOG.md
ADDED
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# SelectPdf Online REST API - Ruby Client
|
2
|
+
|
3
|
+
## HTML To PDF API - Ruby Client
|
4
|
+
|
5
|
+
SelectPdf HTML To PDF Online REST API is a professional solution that lets you create PDF from web pages and raw HTML code in your applications. The API is easy to use and the integration takes only a few lines of code.
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* Create PDF from any web page or html string.
|
10
|
+
* Full html5/css3/javascript support.
|
11
|
+
* Set PDF options such as page size and orientation, margins, security, web page settings.
|
12
|
+
* Set PDF viewer options and PDF document information.
|
13
|
+
* Create custom headers and footers for the pdf document.
|
14
|
+
* Hide web page elements during the conversion.
|
15
|
+
* Automatically generate bookmarks during the html to pdf conversion.
|
16
|
+
* Support for partial page conversion.
|
17
|
+
* Easy integration, no third party libraries needed.
|
18
|
+
* Works in all programming languages.
|
19
|
+
* No installation required.
|
20
|
+
|
21
|
+
Sign up for for free to get instant API access to SelectPdf [HTML to PDF API](https://selectpdf.com/html-to-pdf-api/).
|
22
|
+
|
23
|
+
### Sample Code
|
24
|
+
|
25
|
+
require 'selectpdf'
|
26
|
+
print "This is SelectPdf-#{SelectPdf::CLIENT_VERSION}\n"
|
27
|
+
|
28
|
+
url = 'https://selectpdf.com'
|
29
|
+
local_file = 'Test.pdf'
|
30
|
+
api_key = 'Your API key here'
|
31
|
+
|
32
|
+
begin
|
33
|
+
api = SelectPdf::HtmlToPdfClient.new(api_key)
|
34
|
+
|
35
|
+
api.page_size = SelectPdf::PageSize::A4
|
36
|
+
api.margins = 0
|
37
|
+
api.page_numbers = FALSE
|
38
|
+
api.page_breaks_enhanced_algorithm = TRUE
|
39
|
+
|
40
|
+
api.convert_url_to_file(url, local_file)
|
41
|
+
rescue SelectPdf::ApiException => e
|
42
|
+
print("An error occurred: #{e}")
|
43
|
+
end
|
44
|
+
|