Skip to content

Commit 2a5bfde

Browse files
author
Stephen
committed
edge cases
if no title and no logo, if full page image, if logo but no sizing/alignment
1 parent d03dfb1 commit 2a5bfde

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

include/general.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ public function MultiRow($left, $right) {
171171
$mylogoheight=0;
172172
}
173173
}
174+
if (!isset($mylogoleft)){
175+
$mylogoleft=.5;
176+
$mylogotop=.5;
177+
$mylogowidth=0;
178+
$mylogoheight=0;
179+
}
174180
$includearr=explode(",",$exportfieldslistvar);
175181

176182
$page=1;
@@ -265,22 +271,25 @@ public function MultiRow($left, $right) {
265271
if ($lines>0) {
266272
$titleheight = (($lines*0.20833333333334));
267273
$titlelineratio = ($titleheight/$lines);
274+
$ypos=$logofinalY+.5+$titleheight+.5;$pdf->SetY($ypos);
268275
} else {
269-
$titleheight = -.27;
276+
$titleheight = 0;
270277
$titlelineratio = .2;
278+
$ypos=$logofinalY+$titleheight+.5;$pdf->SetY($ypos);
271279
}
272-
$ypos=$logofinalY+.5+$titleheight+.5;$pdf->SetY($ypos);
273280
$pdf->Image($imgpath,.5,$ypos,$imagewidth,$imageheight,"jpg",$baseurl. '/?r=' . $ref);
274281
// set color for background
275282
$pdf->SetFillColor(255, 255, 255);
276283
$pdf->setCellPaddings(0.01, 0.06, 0.01, 0.1);
277284
$style= array('width' => 0.01, 'cap' => 'butt', 'join' => 'round' ,'dash' => '0', 'color' => array(192,192,192));
278285
$style1 = array('width' => 0.02, 'cap' => 'butt', 'join' => 'round', 'dash' => '0', 'color' => array(0, 0, 0));
279286
$style2 = array('width' => 0.02, 'cap' => 'butt', 'join' => 'round', 'dash' => '3', 'color' => array(255, 0, 0));
280-
287+
if ($lines>0) {
281288
$ypos=$imageheight+($titleheight)+($logofinalY)+.5;$pdf->SetY($ypos);
282-
283-
unset($notes);
289+
} else {
290+
$ypos=$imageheight+($titleheight)+($logofinalY);$pdf->SetY($ypos);
291+
}
292+
unset($whereabouts);
284293
if ($pdf_export_whereabouts_integration) {
285294
$checkwherabouts = sql_query("SHOW TABLES LIKE 'whereabouts'");
286295
if ($checkwherabouts) {
@@ -301,6 +310,7 @@ public function MultiRow($left, $right) {
301310
} else {
302311
$pdf->SetY($ypos+($titlelineratio)+.6);
303312
}
313+
if ($exportfieldslistvar) {
304314
foreach ($includearr as $include) {
305315
$fieldsf = get_field($include);
306316
// If the notes took us to a new page, return to the image page before marking annotation
@@ -326,7 +336,7 @@ public function MultiRow($left, $right) {
326336
$ypos=$ypos+.5;$m++;
327337

328338
}
329-
339+
}
330340
}
331341
// Check if there is another page?
332342
if (file_exists(get_resource_path($ref,true,"scr",false,"jpg",-1,$page+1,$use_watermark,""))) {unset($notepos);unset($lastnotepos);$totalpages++;}

0 commit comments

Comments
 (0)