design changes
Showing
2 changed files
with
37 additions
and
0 deletions
| ... | @@ -181,6 +181,43 @@ try { | ... | @@ -181,6 +181,43 @@ try { |
| 181 | $num_optlist = "fillcolor={".$fontColor." } position={".$fontAlignment."} boxsize={" . $textwidth." ".$textheight . "} fontsize=".$fontSize." ".$fitm. " "; | 181 | $num_optlist = "fillcolor={".$fontColor." } position={".$fontAlignment."} boxsize={" . $textwidth." ".$textheight . "} fontsize=".$fontSize." ".$fitm. " "; |
| 182 | 182 | ||
| 183 | $p->fit_textline($textline, $textLRight, $textLUp, $num_optlist); | 183 | $p->fit_textline($textline, $textLRight, $textLUp, $num_optlist); |
| 184 | } else if ($row->change_type == 'date') { | ||
| 185 | $yoff = 50; | ||
| 186 | //Get font var from row | ||
| 187 | |||
| 188 | $textline = $row->content; | ||
| 189 | $textLUp = $row->locationUp; | ||
| 190 | $textwidth = $row->width; | ||
| 191 | $textheight = $row->height; | ||
| 192 | $textLRight = $row->locationRight; | ||
| 193 | $fontStyles = unserialize($row->style); | ||
| 194 | $fitmethod = $fontStyles["fitmethod"]; | ||
| 195 | |||
| 196 | $fontAlignment = $fontStyles["alignment"]; | ||
| 197 | $fontFamily = $fontStyles["font-family"]; | ||
| 198 | $fontSize = $fontStyles["font-size"]; | ||
| 199 | if(isset($fontStyles["font-color"])) { | ||
| 200 | $fontColor = $fontStyles["font-color"]; | ||
| 201 | }else{ | ||
| 202 | $fontColor = 'cmyk 0.75 0.68 0.67 0.90'; | ||
| 203 | |||
| 204 | } | ||
| 205 | /// Load and insert text and font | ||
| 206 | |||
| 207 | $p->set_option("FontOutline={" . $fontFamily . "=" . $storagePath . $folder . "/" . $fontFamily . ".otf}"); | ||
| 208 | /* For PDFlib Lite: change "unicode" to "winansi" */ | ||
| 209 | $font = $p->load_font($fontFamily, "unicode", "embedding"); | ||
| 210 | if ($font == 0) { | ||
| 211 | die("Error: " . $p->get_errmsg()); | ||
| 212 | } | ||
| 213 | $p->setfont($font, $fontSize); | ||
| 214 | //$num_optlist = "fontname=".$fontFamily." fontsize=".$fontSize." encoding=unicode alignment=".$fontAlignment." fillcolor={".$fontColor." }"; | ||
| 215 | if($fitmethod == ''){$fitm =""; | ||
| 216 | }else{ $fitm = "fitmethod=".$fitmethod;} | ||
| 217 | |||
| 218 | $num_optlist = "fillcolor={".$fontColor." } position={".$fontAlignment."} boxsize={" . $textwidth." ".$textheight . "} fontsize=".$fontSize." ".$fitm. " "; | ||
| 219 | |||
| 220 | $p->fit_textline($textline, $textLRight, $textLUp, $num_optlist); | ||
| 184 | } | 221 | } |
| 185 | 222 | ||
| 186 | else if ($row->change_type == 'img') { | 223 | else if ($row->change_type == 'img') { | ... | ... |
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment