Lines Matching refs:this

51         if ($this->currentTemplateId !== null) {
62 $size = $this->_getpagesize($size);
64 if ($orientation != $this->CurOrientation
65 || $size[0] != $this->CurPageSize[0]
66 || $size[1] != $this->CurPageSize[1]
70 $this->w = $size[0];
71 $this->h = $size[1];
73 $this->w = $size[1];
74 $this->h = $size[0];
76 $this->wPt = $this->w * $this->k;
77 $this->hPt = $this->h * $this->k;
78 $this->PageBreakTrigger = $this->h - $this->bMargin;
79 $this->CurOrientation = $orientation;
80 $this->CurPageSize = $size;
82 $this->PageInfo[$this->page]['size'] = array($this->wPt, $this->hPt);
104 if (!isset($this->templates[$tpl])) {
118 $template = $this->templates[$tpl];
120 $originalSize = $this->getTemplateSize($tpl);
121 $newSize = $this->getTemplateSize($tpl, $width, $height);
123 $this->setPageFormat($newSize, $newSize['orientation']);
126 $this->_out(
132 $x * $this->k,
133 ($this->h - $y - $newSize['height']) * $this->k,
154 if (!isset($this->templates[$tpl])) {
159 $width = $this->templates[$tpl]['width'];
160 $height = $this->templates[$tpl]['height'];
162 $width = $height * $this->templates[$tpl]['width'] / $this->templates[$tpl]['height'];
166 $height = $width * $this->templates[$tpl]['height'] / $this->templates[$tpl]['width'];
193 $width = $this->w;
197 $height = $this->h;
200 $templateId = $this->getNextTemplateId();
204 . \sprintf('%.2F w', $this->LineWidth * $this->k) . "\n";
206 if ($this->FontFamily) {
207 $buffer .= \sprintf("BT /F%d %.2F Tf ET\n", $this->CurrentFont['i'], $this->FontSizePt);
210 if ($this->DrawColor !== '0 G') {
211 $buffer .= $this->DrawColor . "\n";
213 if ($this->FillColor !== '0 g') {
214 $buffer .= $this->FillColor . "\n";
217 if ($groupXObject && \version_compare('1.4', $this->PDFVersion, '>')) {
218 $this->PDFVersion = '1.4';
221 $this->templates[$templateId] = [
229 'x' => $this->x,
230 'y' => $this->y,
231 'AutoPageBreak' => $this->AutoPageBreak,
232 'bMargin' => $this->bMargin,
233 'tMargin' => $this->tMargin,
234 'lMargin' => $this->lMargin,
235 'rMargin' => $this->rMargin,
236 'h' => $this->h,
237 'w' => $this->w,
238 'FontFamily' => $this->FontFamily,
239 'FontStyle' => $this->FontStyle,
240 'FontSizePt' => $this->FontSizePt,
241 'FontSize' => $this->FontSize,
242 'underline' => $this->underline,
243 'TextColor' => $this->TextColor,
244 'DrawColor' => $this->DrawColor,
245 'FillColor' => $this->FillColor,
246 'ColorFlag' => $this->ColorFlag
250 $this->SetAutoPageBreak(false);
251 $this->currentTemplateId = $templateId;
253 $this->h = $height;
254 $this->w = $width;
256 $this->SetXY($this->lMargin, $this->tMargin);
257 $this->SetRightMargin($this->w - $width + $this->rMargin);
269 if (null === $this->currentTemplateId) {
273 $templateId = $this->currentTemplateId;
274 $template = $this->templates[$templateId];
277 $this->SetXY($state['x'], $state['y']);
278 $this->tMargin = $state['tMargin'];
279 $this->lMargin = $state['lMargin'];
280 $this->rMargin = $state['rMargin'];
281 $this->h = $state['h'];
282 $this->w = $state['w'];
283 $this->SetAutoPageBreak($state['AutoPageBreak'], $state['bMargin']);
285 $this->FontFamily = $state['FontFamily'];
286 $this->FontStyle = $state['FontStyle'];
287 $this->FontSizePt = $state['FontSizePt'];
288 $this->FontSize = $state['FontSize'];
290 $this->TextColor = $state['TextColor'];
291 $this->DrawColor = $state['DrawColor'];
292 $this->FillColor = $state['FillColor'];
293 $this->ColorFlag = $state['ColorFlag'];
295 $this->underline = $state['underline'];
297 $fontKey = $this->FontFamily . $this->FontStyle;
299 $this->CurrentFont =& $this->fonts[$fontKey];
301 unset($this->CurrentFont);
304 $this->currentTemplateId = null;
316 return $this->templateId++;
326 if ($this->currentTemplateId !== null) {
337 if ($this->currentTemplateId !== null) {
348 if ($this->currentTemplateId !== null) {
360 if ($this->page === 0 && $this->currentTemplateId !== null) {
361 $this->_out($this->DrawColor);
371 if ($this->page === 0 && $this->currentTemplateId !== null) {
372 $this->_out($this->FillColor);
382 if ($this->page === 0 && $this->currentTemplateId !== null) {
383 $this->_out(\sprintf('%.2F w', $width * $this->k));
393 if ($this->page === 0 && $this->currentTemplateId !== null) {
394 $this->_out(\sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
404 if ($this->page === 0 && $this->currentTemplateId !== null) {
405 $this->_out(sprintf('BT /F%d %.2F Tf ET', $this->CurrentFont['i'], $this->FontSizePt));
416 foreach ($this->templates as $key => $template) {
417 $this->_newobj();
418 $this->templates[$key]['objectNumber'] = $this->n;
420 $this->_put('<</Type /XObject /Subtype /Form /FormType 1');
421 $this->_put(\sprintf('/BBox[0 0 %.2F %.2F]', $template['width'] * $this->k, $template['height'] * $this->k));
422 $this->_put('/Resources 2 0 R'); // default resources dictionary of FPDF
424 if ($this->compress) {
426 $this->_put('/Filter/FlateDecode');
431 $this->_put('/Length ' . \strlen($buffer));
434 $this->_put('/Group <</Type/Group/S/Transparency>>');
437 $this->_put('>>');
438 $this->_putstream($buffer);
439 $this->_put('endobj');
448 foreach ($this->templates as $key => $template) {
449 $this->_put('/' . $template['id'] . ' ' . $template['objectNumber'] . ' 0 R');
460 if ($this->currentTemplateId !== null) {
461 $this->templates[$this->currentTemplateId]['buffer'] .= $s . "\n";