Skip to content

Commit 81d3644

Browse files
committed
Bumped v0.14.0
Signed-off-by: Vishal Rana <[email protected]>
1 parent f483cab commit 81d3644

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

pdf.go

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,22 @@
11
package labstack
22

33
type (
4-
PDFExtractImageRequest struct {
4+
PDFImageRequest struct {
55
File string
66
}
77

8-
PDFExtractImageResponse struct {
9-
*Download
10-
}
11-
12-
PDFToImageRequest struct {
13-
File string
14-
}
15-
16-
PDFToImageResponse struct {
8+
PDFImageResponse struct {
179
*Download
1810
}
1911
)
2012

21-
func (c *Client) PDFExtractImage(req *PDFExtractImageRequest) (res *PDFExtractImageResponse, err *APIError) {
22-
res = new(PDFExtractImageResponse)
23-
_, e := c.resty.R().
24-
SetFile("file", req.File).
25-
SetResult(res).
26-
SetError(err).
27-
Post("/pdf/extract-image")
28-
if e != nil {
29-
err = new(APIError)
30-
err.Message = e.Error()
31-
}
32-
return
33-
}
34-
35-
func (c *Client) PDFToImage(req *PDFToImageRequest) (res *PDFToImageResponse, err *APIError) {
36-
res = new(PDFToImageResponse)
13+
func (c *Client) PDFImage(req *PDFImageRequest) (res *PDFImageResponse, err *APIError) {
14+
res = new(PDFImageResponse)
3715
_, e := c.resty.R().
3816
SetFile("file", req.File).
3917
SetResult(res).
4018
SetError(err).
41-
Post("/pdf/to-image")
19+
Post("/pdf/image")
4220
if e != nil {
4321
err = new(APIError)
4422
err.Message = e.Error()

webpage.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
package labstack
22

33
type (
4-
WebpageToPDFRequest struct {
4+
WebpagePDFRequest struct {
55
URL string `json:"url"`
66
Size string `json:"size"`
77
Layout string `json:"width"`
88
}
99

10-
WebpageToPDFResponse struct {
10+
WebpagePDFResponse struct {
1111
*Download
1212
}
1313
)
1414

15-
func (c *Client) WebpageToPDF(req *WebpageToPDFRequest) (res *WebpageToPDFResponse, err *APIError) {
16-
res = new(WebpageToPDFResponse)
15+
func (c *Client) WebpagePDF(req *WebpagePDFRequest) (res *WebpagePDFResponse, err *APIError) {
16+
res = new(WebpagePDFResponse)
1717
_, e := c.resty.R().
1818
SetBody(req).
1919
SetResult(res).
2020
SetError(err).
21-
Post("/webpage/to-pdf")
21+
Post("/webpage/pdf")
2222
if e != nil {
2323
err = new(APIError)
2424
err.Message = e.Error()

0 commit comments

Comments
 (0)