2b8466b5 by Jeff Balicki

e

1 parent fe35443e
......@@ -32,8 +32,11 @@ 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-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"}]}';
// $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"}]}';
//$styles = serialize(array("font-family"=>"Barber","font-size"=>"20","font-color"=>"cmyk 0 0 0 0","alignment"=>"left"));
//print_r($styles);
//die();
$apiCallId = new pdfModel();
$apiCallId = $apiCallId->addApiCall('1',$json);
//$apiCallId = "3";
......
......@@ -99,9 +99,12 @@ try {
$textline = $row->content;
$textLUp = $row->locationUp;
$textwidth = $row->width;
$textheight = $row->height;
$textLRight = $row->locationRight;
$fontStyles = unserialize($row->style);
$fontAlignment = $fontStyles["alignment"];
$fontFamily = $fontStyles["font-family"];
$fontSize = $fontStyles["font-size"];
if(isset($fontStyles["font-color"])) {
......@@ -119,12 +122,14 @@ try {
die("Error: " . $p->get_errmsg());
}
$p->setfont($font, $fontSize);
$num_optlist = "fillcolor={".$fontColor." }";
$num_optlist = "fontname=".$fontFamily." fontsize=".$fontSize." encoding=unicode alignment=".$fontAlignment." fillcolor={".$fontColor." }";
$textline = $p->create_textflow($textline , $num_optlist);
$fit_optlist = "firstlinedist=capheight";
$result = $p->fit_textflow($textline, $textLRight, $textLUp, 190,120 ,$fit_optlist);
$result = $p->fit_textflow($textline, $textLRight, $textLUp, $textwidth ,$textheight ,$fit_optlist);
} else if ($row->change_type == 'img') {
......
......@@ -80,7 +80,7 @@ class pdfModel extends Model
);
$idchangesPDF = DB::table('changesPDF')->insertGetId(
array('PDF_idPDF' => $pdfId, 'change_typePDF_idchange_typePDF' => $change->change_type, 'stylesPDF_idstylesPDF' => $idstylesPDF, 'locationUp' => $change->locationUp, 'locationRight' => $change->locationRight, 'pages' => $change->pages, 'content' => $change->content, 'z-index' => '')
array('PDF_idPDF' => $pdfId, 'change_typePDF_idchange_typePDF' => $change->change_type, 'stylesPDF_idstylesPDF' => $idstylesPDF, 'locationUp' => $change->locationUp, 'locationRight' => $change->locationRight, 'width' => $change->width, 'height' => $change->height, 'pages' => $change->pages, 'content' => $change->content, 'z-index' => '')
);
}
......@@ -124,7 +124,7 @@ class pdfModel extends Model
);
$idchangesPDF = DB::table('changesPDF')->insertGetId(
array('PDF_idPDF' => $pdfId, 'change_typePDF_idchange_typePDF' => $change->idchange_typePDF, 'stylesPDF_idstylesPDF' => $idstylesPDF, 'locationUp' => $change->locationUp, 'locationRight' => $change->locationRight, 'pages' => $change->pages, 'content' => $content, 'z-index' => '')
array('PDF_idPDF' => $pdfId, 'change_typePDF_idchange_typePDF' => $change->idchange_typePDF, 'stylesPDF_idstylesPDF' => $idstylesPDF, 'locationUp' => $change->locationUp, 'locationRight' => $change->locationRight, 'width' => $change->width, 'height' => $change->height, 'pages' => $change->pages, 'content' => $content, 'z-index' => '')
);
}
......
No preview for this file type
No preview for this file type
No preview for this file type