selectpdf 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +79 -2
- data/lib/selectpdf.rb +1099 -4
- data/samples/pdf_merge.rb +40 -0
- data/samples/pdf_to_text.rb +45 -0
- data/samples/search_pdf.rb +38 -0
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eaf046e0be6119e542567c9aaa8619c54e7f6c99819a84c9d96f2b7b38d21af
|
4
|
+
data.tar.gz: 3cab0ed9984ebd11cfa25dde675327a94ffd37203e9e35e57932910fbd5e956f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 106e81246f60e07de4cd302133b317624c79784b852974fb77092d3d31ea28d11dc74ec29bda1552c48cb4f7473f0457a42fd187c18893a9d2d9cdc9fa2a83d7
|
7
|
+
data.tar.gz: 026b2222f8282cbf80f0e5b8a8684d0de2ea4a3eb366bb39638175088dcfb75549f9f46d259a08ec205a1df51f6a778c5968c305fab961656c04b9204b7b63ed
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -14,9 +14,7 @@ SelectPdf HTML To PDF Online REST API is a professional solution that lets you c
|
|
14
14
|
* Hide web page elements during the conversion.
|
15
15
|
* Automatically generate bookmarks during the html to pdf conversion.
|
16
16
|
* Support for partial page conversion.
|
17
|
-
* Easy integration, no third party libraries needed.
|
18
17
|
* Works in all programming languages.
|
19
|
-
* No installation required.
|
20
18
|
|
21
19
|
Sign up for for free to get instant API access to SelectPdf [HTML to PDF API](https://selectpdf.com/html-to-pdf-api/).
|
22
20
|
|
@@ -42,3 +40,82 @@ Sign up for for free to get instant API access to SelectPdf [HTML to PDF API](ht
|
|
42
40
|
print("An error occurred: #{e}")
|
43
41
|
end
|
44
42
|
|
43
|
+
## Pdf Merge API
|
44
|
+
|
45
|
+
SelectPdf Pdf Merge REST API is an online solution that lets you merge local or remote PDFs into a final PDF document.
|
46
|
+
|
47
|
+
### Features
|
48
|
+
|
49
|
+
* Merge local PDF document.
|
50
|
+
* Merge remote PDF from public url.
|
51
|
+
* Set PDF viewer options and PDF document information.
|
52
|
+
* Secure generated PDF with a password.
|
53
|
+
* Works in all programming languages.
|
54
|
+
|
55
|
+
See [PDF Merge API](https://selectpdf.com/pdf-merge-api/) page for full list of parameters.
|
56
|
+
|
57
|
+
### Sample Code
|
58
|
+
|
59
|
+
require 'selectpdf'
|
60
|
+
print "This is SelectPdf-#{SelectPdf::CLIENT_VERSION}\n"
|
61
|
+
|
62
|
+
test_url = 'https://selectpdf.com/demo/files/selectpdf.pdf'
|
63
|
+
test_pdf = 'Input.pdf'
|
64
|
+
local_file = 'Result.pdf'
|
65
|
+
api_key = 'Your API key here'
|
66
|
+
|
67
|
+
begin
|
68
|
+
client = SelectPdf::PdfMergeClient.new(api_key)
|
69
|
+
|
70
|
+
# specify the pdf files that will be merged (order will be preserved in the final pdf)
|
71
|
+
client.add_file(test_pdf) # add PDF from local file
|
72
|
+
client.add_url_file(test_url) # add PDF from public url
|
73
|
+
|
74
|
+
# merge pdfs to local file
|
75
|
+
client.save_to_file(local_file)
|
76
|
+
rescue SelectPdf::ApiException => e
|
77
|
+
print("An error occurred: #{e}")
|
78
|
+
end
|
79
|
+
|
80
|
+
## Pdf To Text API
|
81
|
+
|
82
|
+
SelectPdf Pdf To Text REST API is an online solution that lets you extract text from your PDF documents or search your PDF document for certain words.
|
83
|
+
|
84
|
+
### Features
|
85
|
+
|
86
|
+
* Extract text from PDF.
|
87
|
+
* Search PDF.
|
88
|
+
* Specify start and end page for partial file processing.
|
89
|
+
* Specify output format (plain text or html).
|
90
|
+
* Use a PDF from an online location (url) or upload a local PDF document.
|
91
|
+
|
92
|
+
See [Pdf To Text API](https://selectpdf.com/pdf-to-text-api/) page for full list of parameters.
|
93
|
+
|
94
|
+
### Sample Code
|
95
|
+
|
96
|
+
require 'selectpdf'
|
97
|
+
print "This is SelectPdf-#{SelectPdf::CLIENT_VERSION}\n"
|
98
|
+
|
99
|
+
test_pdf = 'Input.pdf'
|
100
|
+
local_file = 'Result.txt'
|
101
|
+
api_key = 'Your API key here'
|
102
|
+
|
103
|
+
begin
|
104
|
+
client = SelectPdf::PdfToTextClient.new(api_key)
|
105
|
+
|
106
|
+
# set parameters - see full list at https://selectpdf.com/pdf-to-text-api/
|
107
|
+
client.start_page = 1 # start page (processing starts from here)
|
108
|
+
client.end_page = 0 # end page (set 0 to process file til the end)
|
109
|
+
client.output_format = SelectPdf::OutputFormat::TEXT # set output format (Text or HTML)
|
110
|
+
|
111
|
+
print "Starting pdf to text ...\n"
|
112
|
+
|
113
|
+
# convert local pdf to local text file
|
114
|
+
client.text_from_file_to_file(test_pdf, local_file)
|
115
|
+
|
116
|
+
print "Finished! Number of pages processed: #{client.number_of_pages}.\n"
|
117
|
+
rescue SelectPdf::ApiException => e
|
118
|
+
print("An error occurred: #{e}")
|
119
|
+
end
|
120
|
+
|
121
|
+
|