由于某些原因,任何2或3个字符串都是将最后一个字符排成一行的单词。
我的代码输出:https://drive.google.com/open?id=1eJziCQ5QSNyXjxSKUgBum7ngEWGpAgy-
代码:
<?php
/**
* Template Name: Bo Testing Form
* Version: 0.0.1
* Description: Testing PDF Template for a form.
* Author: Bo Curtis
* Group: RSU#3
* License: GPLv2
* Required PDF Version: 4.0-beta
*/
/* Prevent direct access to the template (always good to include this) */
if ( ! class_exists( 'GFForms' ) ) {
return;
}
/**
* Load our template-specific settings
*/
$show_meta_data = ( ! empty( $settings['world_show_meta_data']) ) ? $settings['world_show_meta_data'] : 'No';
/**
* Include your PHP variables in this section
*/
$name = $form_data['field'][9];
$deadlinedate = $form_data['field'][12];
$event = $form_data['field'][13];
$dates = $form_data['field'][14];
$para1 = $form_data['field'][15];
$para2 = $form_data['field'][16];
$para3 = $form_data['field'][17];
$fee = $form_data['field'][18];
$meals = $form_data['field'][23];
$lodging = $form_data['field'][26];
$lodgingpernight = $form_data['field'][24];
$lodgingnights = $form_data['field'][25];
$lodgingoption = $form_data['field'][27];
$mileage = $form_data['field'][28];
$mileagecost = $form_data['field'][31];
$misccosts = $form_data['field'][32];
$totalmisc = $form_data['field'][33];
$totalcost = $form_data['feld'][34];
$adminsignature = $form_data['field'][3];
$admindate = $form_data['field'][4];
$fundaccts = $form_data['field'][6];
$fundsapproved = $form_data['field'][58];
$suptsignature = $form_data['field'][1];
$suptdate = $form_data['field'][2];
$actualmeals = $form_data['field'][47];
$actuallodging = $form_data['field'][48];
$actualmileage = $form_data['field'][49];
$actualmileagecost = $form_data['field'][50];
$actualother = $form_data['field'][51];
$actualtotal = $form_data['field'][52];
$employeesig = $form_data['field'][53];
$lodgingcostpernight = (string)$lodgingpernight;
?>
<!-- Any PDF CSS styles can be placed in the style tag below -->
<style>
h1 {
text-align: center;
text-transform: uppercase;
color: #055811;
border-bottom: 1px solid #999;
}
p {
font-family: Arial, Helvetica, sans-serif;
color: 000000;
white-space: nowrap;
}
</style>
<div style="position: fixed; top: 118; left: 100"><?php echo $name; ?></div>
<div style="position: fixed; top: 140; left: 125"><?php echo $event; ?></div>
<div style="position: fixed; top: 185; left: 20"><?php echo $para1; ?></div>
<div style="position: fixed; top: 210; left: 350"><?php echo $para2; ?></div>
<div style="position: fixed; top: 233; left: 320"><?php echo $para3; ?></div>
<div style="position: fixed; top: 120; left: 600"><?php echo $deadlinedate; ?></div>
<div style="position: fixed; top: 145; left: 600"><?php echo $dates; ?></div>
<div style="position: fixed; top: 270; left: 615"><?php echo $fee; ?></div>
<div style="position: fixed; top: 290; left: 615"><?php echo $meals; ?></div>
<div style="position: fixed; top: 325; left: 615"><?php echo $lodging; ?></div>
<div style="position: fixed; top: 325; left: 135"><?php echo $lodgingcostpernight; ?></div>
<div style="position: fixed; top: 325; left: 305"><?php echo $lodgingnights; ?></div>
<div style="position: fixed; top: 407; left: 230"><?php echo $mileage; ?></div>
<div style="position: fixed; top: 407; left: 615"><?php echo $mileagecost; ?></div>
<div style="position: fixed; top: 450; left: 110"><?php echo $misccosts; ?></div>
<div style="position: fixed; top: 450; left: 615"><?php echo $totalmisc; ?></div>
<div style="position: fixed; top: 465; left: 600"><?php echo $totalcost; ?></div>
<div style="position: fixed; top: 510; left: 350"><?php echo $adminsignature; ?></div>
<div style="position: fixed; top: 510; left: 615"><?php echo $admindate; ?></div>
<div style="position: fixed; top: 632; left: 125"><?php echo $fundaccts; ?></div>
<div style="position: fixed; top: 632; left: 630"><?php echo $fundsapproved; ?></div>
<div style="position: fixed; top: 655; left: 155"><?php echo $suptsignature; ?></div>
<div style="position: fixed; top: 655; left: 600"><?php echo $suptdate; ?></div>
<div style="position: fixed; top: 770; left: 340"><?php echo $actualmeals; ?></div>
<div style="position: fixed; top: 795; left: 340"><?php echo $actuallodging; ?></div>
<div style="position: fixed; top: 820; left: 250"><?php echo $actualmileage; ?></div>
<div style="position: fixed; top: 820; left: 340"><?php echo $actualmileagecost; ?></div>
<div style="position: fixed; top: 847; left: 340"><?php echo $actualother; ?></div>
<div style="position: fixed; top: 847; left: 615"><?php echo $actualtotal; ?></div>
<div style="position: fixed; top: 830; left: 520"><?php echo $employeesig; ?></div>
<?php if ( 'Yes' == $show_meta_data ): ?>
<p style="font-size: 0.8em;">
<strong>User IP:</strong> <?php echo $form_data['misc']['ip']; ?><br>
<strong>Submission Timestamp:</strong> <?php echo $form_data['misc']['date_time']; ?><br>
<strong>User Agent:</strong> <?php echo $form_data['misc']['user_agent']; ?><br>
<strong>Source URL:</strong> <?php echo $form_data['misc']['source_url']; ?>
</p>
<?php endif; ?>
我距离PHP专家还很远,所以它可能很简单,但是欢迎任何帮助!谢谢!
答案 0 :(得分:0)
我能够通过手动将div设置为大于其所需宽度的宽度来对其进行修复。我不记得在这里回答答案的那个家伙的用户名似乎已被删除,但是谢谢您的帮助。