Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
pdf-customizer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7260c8aa
authored
2016-04-22 09:05:27 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
new api calls
1 parent
304f606f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
12 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/PdfController.php
app/Http/routes.php
app/Http/Controllers/ApiController.php
View file @
7260c8a
...
...
@@ -31,7 +31,7 @@ class ApiController extends Controller
{
$json
=
'{"pdf":[{"name":"Sample PDF Document","folder":"Sample","pdfLocation":"http://hotelpodlipou.sk/uploads/files/sample.pdf"}],"changes":[{"label":"none","locationUp":"400","locationRight":90,"pages":"1","content":"
LOGO_text_black
.jpg","z-index":null,"idstylesPDF":1,"order":"2","style":null,"idchange_typePDF":2,"change_type":"2","fileLocation":"https://image.freepik.com/free-vector/logo-sample-text_355-558.jpg"},{"label":"text style","locationUp":"60","locationRight":290,"pages":"1","content":"519.642.4404 London","z-index":null,"idstylesPDF":2,"order":"1","style":"a:3:{s:11:\"font-family\";s:11:\"TradeGothic\";s:9:\"font-size\";s:2:\"14\";s:10:\"font-color\";s:16:\"cmyk 0 0.6 0.5 0\";}","idchange_typePDF":1,"change_type":"1"}]}'
;
$json
=
'{"pdf":[{"name":"Sample PDF Document","folder":"Sample","pdfLocation":"http://hotelpodlipou.sk/uploads/files/sample.pdf"}],"changes":[{"label":"none","locationUp":"400","locationRight":90,"pages":"1","content":"
logo-sample-text_355-558
.jpg","z-index":null,"idstylesPDF":1,"order":"2","style":null,"idchange_typePDF":2,"change_type":"2","fileLocation":"https://image.freepik.com/free-vector/logo-sample-text_355-558.jpg"},{"label":"text style","locationUp":"60","locationRight":290,"pages":"1","content":"519.642.4404 London","z-index":null,"idstylesPDF":2,"order":"1","style":"a:3:{s:11:\"font-family\";s:11:\"TradeGothic\";s:9:\"font-size\";s:2:\"14\";s:10:\"font-color\";s:16:\"cmyk 0 0.6 0.5 0\";}","idchange_typePDF":1,"change_type":"1"}]}'
;
$apiCallId
=
new
pdfModel
();
$apiCallId
=
$apiCallId
->
addApiCall
(
'1'
,
$json
);
...
...
@@ -92,20 +92,29 @@ class ApiController extends Controller
public
function
getList
(
$json
)
{
$rows
=
new
pdfModel
();
$rows
=
$rows
->
getList
(
$json
)
->
get
();
$rows
=
json_encode
(
$rows
);
var_dump
(
$rows
);
$response
=
json_encode
(
$rows
);
$statusCode
=
200
;
return
Response
::
json
(
$response
,
$statusCode
);
}
public
function
getPdf
(
$json
)
public
function
getApi
(
$json
)
{
$statusCode
=
200
;
$response
=
URL
::
asset
(
'js/interface.js'
);
return
Response
::
json
(
$response
,
$statusCode
);
}
public
function
getPdf
(
$json
)
{
$rows
=
new
pdfModel
();
$rows
=
$rows
->
getpdf
(
$json
)
->
get
();
$rows
=
json_encode
(
$rows
);
var_dump
(
$rows
);
$response
=
json_encode
(
$rows
);
$statusCode
=
200
;
return
Response
::
json
(
$response
,
$statusCode
);
}
}
...
...
app/Http/Controllers/PdfController.php
View file @
7260c8a
...
...
@@ -118,7 +118,7 @@ try {
}
$num_optlist
=
"fillcolor={"
.
$fontColor
.
" }"
;
$p
->
setfont
(
$font
,
$fontSize
);
$p
->
fit_textline
(
$textline
,
$textLUp
,
$textLRight
,
$num_optlist
);
$p
->
fit_textline
(
$textline
,
$textLRight
,
$textLUp
,
$num_optlist
);
}
else
if
(
$row
->
change_type
==
'img'
)
{
...
...
@@ -135,7 +135,7 @@ try {
if
(
$image
==
0
)
{
die
(
"Error: "
.
$p
->
get_errmsg
());
}
$p
->
fit_image
(
$image
,
$imgLUp
,
$imgLRight
,
""
);
$p
->
fit_image
(
$image
,
$imgLRight
,
$imgLUp
,
""
);
}
...
...
app/Http/routes.php
View file @
7260c8a
...
...
@@ -17,7 +17,13 @@ Route::get('/', function () {
Route
::
get
(
'pdf/{id}'
,
'PdfController@pdf'
);
Route
::
get
(
'api/add/{json}'
,
'ApiController@insert'
);
Route
::
get
(
'api/get-list/{json}'
,
'ApiController@getList'
);
Route
::
get
(
'api/get-pdf/{json}'
,
'ApiController@getpdf'
);
Route
::
group
(
array
(
'prefix'
=>
'api/v1'
),
function
(
$json
)
{
Route
::
resource
(
'add'
,
'ApiController@insert'
);
Route
::
resource
(
'get-list'
,
'ApiController@getList'
);
Route
::
resource
(
'get-pdf'
,
'ApiController@getpdf'
);
Route
::
resource
(
'api'
,
'ApiController@getApi'
);
});
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment