forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tcpdf.php
executable file
·14027 lines (13498 loc) · 508 KB
/
tcpdf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
//============================================================+
// File name : tcpdf.php
// Begin : 2002-08-03
// Last Update : 2009-07-16
// Author : Nicola Asuni - info@tecnick.com - http://www.tcpdf.org
// Version : 4.6.020
// License : GNU LGPL (http://www.gnu.org/copyleft/lesser.html)
// ----------------------------------------------------------------------------
// Copyright (C) 2002-2009 Nicola Asuni - Tecnick.com S.r.l.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// See LICENSE.TXT file for more information.
// ----------------------------------------------------------------------------
//
// Description : This is a PHP class for generating PDF documents without
// requiring external extensions.
//
// NOTE:
// This class was originally derived in 2002 from the Public
// Domain FPDF class by Olivier Plathey (http://www.fpdf.org),
// but now is almost entirely rewritten.
//
// Main features:
// * no external libraries are required for the basic functions;
// * supports all ISO page formats;
// * supports custom page formats, margins and units of measure;
// * supports UTF-8 Unicode and Right-To-Left languages;
// * supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;
// * supports document encryption;
// * includes methods to publish some XHTML code;
// * includes graphic (geometric) and transformation methods;
// * includes Javascript and forms support;
// * includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS;
// * includes methods to set Bookmarks and print a Table of Content;
// * includes methods to move and delete pages;
// * includes methods for automatic page header and footer management;
// * supports automatic page break;
// * supports automatic page numbering and page groups;
// * supports automatic line break and text justification;
// * supports JPEG and PNG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)
// * supports stroke and clipping mode for text;
// * supports clipping masks;
// * supports Grayscale, RGB, CMYK, Spot Colors and Transparencies;
// * supports several annotations, including links, text and file attachments;
// * supports page compression (requires zlib extension);
// * supports text hyphenation.
// * supports transactions to UNDO commands.
//
// -----------------------------------------------------------
// THANKS TO:
//
// Olivier Plathey (http://www.fpdf.org) for original FPDF.
// Efthimios Mavrogeorgiadis (emavro@yahoo.com) for suggestions on RTL language support.
// Klemen Vodopivec (http://www.fpdf.de/downloads/addons/37/) for Encryption algorithm.
// Warren Sherliker (wsherliker@gmail.com) for better image handling.
// dullus for text Justification.
// Bob Vincent (pillarsdotnet@users.sourceforge.net) for <li> value attribute.
// Patrick Benny for text stretch suggestion on Cell().
// Johannes Güntert for JavaScript support.
// Denis Van Nuffelen for Dynamic Form.
// Jacek Czekaj for multibyte justification
// Anthony Ferrara for the reintroduction of legacy image methods.
// Sourceforge user 1707880 (hucste) for line-trough mode.
// Larry Stanbery for page groups.
// Martin Hall-May for transparency.
// Aaron C. Spike for Polycurve method.
// Mohamad Ali Golkar, Saleh AlMatrafe, Charles Abbott for Arabic and Persian support.
// Moritz Wagner and Andreas Wurmser for graphic functions.
// Andrew Whitehead for core fonts support.
// Esteban Joël Marín for OpenType font conversion.
// Teus Hagen for several suggestions and fixes.
// Yukihiro Nakadaira for CID-0 CJK fonts fixes.
// Kosmas Papachristos for some CSS improvements.
// Marcel Partap for some fixes.
// Won Kyu Park for several suggestions, fixes and patches.
// Anyone that has reported a bug or sent a suggestion.
//============================================================+
/**
* This is a PHP class for generating PDF documents without requiring external extensions.<br>
* TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* <h3>TCPDF main features are:</h3>
* <ul>
* <li>no external libraries are required for the basic functions;</li>
* <li>supports all ISO page formats;</li>
* <li>supports custom page formats, margins and units of measure;</li>
* <li>supports UTF-8 Unicode and Right-To-Left languages;</li>
* <li>supports TrueTypeUnicode, OpenTypeUnicode, TrueType, OpenType, Type1 and CID-0 fonts;</li>
* <li>supports document encryption;</li>
* <li>includes methods to publish some XHTML code;</li>
* <li>includes graphic (geometric) and transformation methods;</li>
* <li>includes Javascript and forms support;</li>
* <li>includes a method to print various barcode formats: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS;</li>
* <li>includes methods to set Bookmarks and print a Table of Content;</li>
* <li>includes methods to move and delete pages;</li>
* <li>includes methods for automatic page header and footer management;</li>
* <li>supports automatic page break;</li>
* <li>supports automatic page numbering and page groups;</li>
* <li>supports automatic line break and text justification;</li>
* <li>supports JPEG and PNG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/www/formats.html)</li>
* <li>supports stroke and clipping mode for text;</li>
* <li>supports clipping masks;</li>
* <li>supports Grayscale, RGB, CMYK, Spot Colors and Transparencies;</li>
* <li>supports several annotations, including links, text and file attachments;</li>
* <li>supports page compression (requires zlib extension);</li>
* <li>supports text hyphenation.</li>
* <li>supports transactions to UNDO commands.</li>
* </ul>
* Tools to encode your unicode fonts are on fonts/utils directory.</p>
* @package com.tecnick.tcpdf
* @abstract Class for generating PDF files on-the-fly without requiring external extensions.
* @author Nicola Asuni
* @copyright 2002-2009 Nicola Asuni - Tecnick.com S.r.l (www.tecnick.com) Via Della Pace, 11 - 09044 - Quartucciu (CA) - ITALY - www.tecnick.com - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
* @version 4.6.020
*/
/**
* main configuration file
*/
require_once(dirname(__FILE__).'/config/tcpdf_config.php');
// includes some support files
/**
* unicode data
*/
require_once(dirname(__FILE__).'/unicode_data.php');
/**
* html colors table
*/
require_once(dirname(__FILE__).'/htmlcolors.php');
if (!class_exists('TCPDF', false)) {
/**
* define default PDF document producer
*/
define('PDF_PRODUCER', 'TCPDF 4.6.020 (http://www.tcpdf.org)');
/**
* This is a PHP class for generating PDF documents without requiring external extensions.<br>
* TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.<br>
* @name TCPDF
* @package com.tecnick.tcpdf
* @version 4.6.020
* @author Nicola Asuni - info@tecnick.com
* @link http://www.tcpdf.org
* @license http://www.gnu.org/copyleft/lesser.html LGPL
*/
class TCPDF {
// protected or Protected properties
/**
* @var current page number
* @access protected
*/
protected $page;
/**
* @var current object number
* @access protected
*/
protected $n;
/**
* @var array of object offsets
* @access protected
*/
protected $offsets;
/**
* @var buffer holding in-memory PDF
* @access protected
*/
protected $buffer;
/**
* @var array containing pages
* @access protected
*/
protected $pages = array();
/**
* @var current document state
* @access protected
*/
protected $state;
/**
* @var compression flag
* @access protected
*/
protected $compress;
/**
* @var current page orientation (P = Portrait, L = Landscape)
* @access protected
*/
protected $CurOrientation;
/**
* @var array that stores page dimensions and graphic status.<ul><li>$this->pagedim[$this->page]['w'] => page_width_in_points</li><li>$this->pagedim[$this->page]['h'] => height in points</li><li>$this->pagedim[$this->page]['wk'] => page_width_in_points</li><li>$this->pagedim[$this->page]['hk'] => height</li><li>$this->pagedim[$this->page]['tm'] => top_margin</li><li>$this->pagedim[$this->page]['bm'] => bottom_margin</li><li>$this->pagedim[$this->page]['lm'] => left_margin</li><li>$this->pagedim[$this->page]['rm'] => right_margin</li><li>$this->pagedim[$this->page]['pb'] => auto_page_break</li><li>$this->pagedim[$this->page]['or'] => page_orientation</li><li>$this->pagedim[$this->page]['olm'] => original_left_margin</li><li>$this->pagedim[$this->page]['orm'] => original_right_margin</li></ul>
* @access protected
*/
protected $pagedim = array();
/**
* @var scale factor (number of points in user unit)
* @access protected
*/
protected $k;
/**
* @var width of page format in points
* @access protected
*/
protected $fwPt;
/**
* @var height of page format in points
* @access protected
*/
protected $fhPt;
/**
* @var current width of page in points
* @access protected
*/
protected $wPt;
/**
* @var current height of page in points
* @access protected
*/
protected $hPt;
/**
* @var current width of page in user unit
* @access protected
*/
protected $w;
/**
* @var current height of page in user unit
* @access protected
*/
protected $h;
/**
* @var left margin
* @access protected
*/
protected $lMargin;
/**
* @var top margin
* @access protected
*/
protected $tMargin;
/**
* @var right margin
* @access protected
*/
protected $rMargin;
/**
* @var page break margin
* @access protected
*/
protected $bMargin;
/**
* @var cell internal padding
* @access protected
*/
//protected
public $cMargin;
/**
* @var cell internal padding (previous value)
* @access protected
*/
protected $oldcMargin;
/**
* @var current horizontal position in user unit for cell positioning
* @access protected
*/
protected $x;
/**
* @var current vertical position in user unit for cell positioning
* @access protected
*/
protected $y;
/**
* @var height of last cell printed
* @access protected
*/
protected $lasth;
/**
* @var line width in user unit
* @access protected
*/
protected $LineWidth;
/**
* @var array of standard font names
* @access protected
*/
protected $CoreFonts;
/**
* @var array of used fonts
* @access protected
*/
protected $fonts = array();
/**
* @var array of font files
* @access protected
*/
protected $FontFiles = array();
/**
* @var array of encoding differences
* @access protected
*/
protected $diffs = array();
/**
* @var array of used images
* @access protected
*/
protected $images = array();
/**
* @var array of Annotations in pages
* @access protected
*/
protected $PageAnnots = array();
/**
* @var array of internal links
* @access protected
*/
protected $links = array();
/**
* @var current font family
* @access protected
*/
protected $FontFamily;
/**
* @var current font style
* @access protected
*/
protected $FontStyle;
/**
* @var current font ascent (distance between font top and baseline)
* @access protected
* @since 2.8.000 (2007-03-29)
*/
protected $FontAscent;
/**
* @var current font descent (distance between font bottom and baseline)
* @access protected
* @since 2.8.000 (2007-03-29)
*/
protected $FontDescent;
/**
* @var underlining flag
* @access protected
*/
protected $underline;
/**
* @var current font info
* @access protected
*/
protected $CurrentFont;
/**
* @var current font size in points
* @access protected
*/
protected $FontSizePt;
/**
* @var current font size in user unit
* @access protected
*/
protected $FontSize;
/**
* @var commands for drawing color
* @access protected
*/
protected $DrawColor;
/**
* @var commands for filling color
* @access protected
*/
protected $FillColor;
/**
* @var commands for text color
* @access protected
*/
protected $TextColor;
/**
* @var indicates whether fill and text colors are different
* @access protected
*/
protected $ColorFlag;
/**
* @var automatic page breaking
* @access protected
*/
protected $AutoPageBreak;
/**
* @var threshold used to trigger page breaks
* @access protected
*/
protected $PageBreakTrigger;
/**
* @var flag set when processing footer
* @access protected
*/
protected $InFooter = false;
/**
* @var zoom display mode
* @access protected
*/
protected $ZoomMode;
/**
* @var layout display mode
* @access protected
*/
protected $LayoutMode;
/**
* @var title
* @access protected
*/
protected $title = '';
/**
* @var subject
* @access protected
*/
protected $subject = '';
/**
* @var author
* @access protected
*/
protected $author = '';
/**
* @var keywords
* @access protected
*/
protected $keywords = '';
/**
* @var creator
* @access protected
*/
protected $creator = '';
/**
* @var alias for total number of pages
* @access protected
*/
protected $AliasNbPages = '{nb}';
/**
* @var alias for page number
* @access protected
*/
protected $AliasNumPage = '{pnb}';
/**
* @var right-bottom corner X coordinate of inserted image
* @since 2002-07-31
* @author Nicola Asuni
* @access protected
*/
protected $img_rb_x;
/**
* @var right-bottom corner Y coordinate of inserted image
* @since 2002-07-31
* @author Nicola Asuni
* @access protected
*/
protected $img_rb_y;
/**
* @var adjusting factor to convert pixels to user units.
* @since 2004-06-14
* @author Nicola Asuni
* @access protected
*/
protected $imgscale = 1;
/**
* @var boolean set to true when the input text is unicode (require unicode fonts)
* @since 2005-01-02
* @author Nicola Asuni
* @access protected
*/
protected $isunicode = false;
/**
* @var PDF version
* @since 1.5.3
* @access protected
*/
protected $PDFVersion = '1.7';
// ----------------------
/**
* @var Minimum distance between header and top page margin.
* @access protected
*/
protected $header_margin;
/**
* @var Minimum distance between footer and bottom page margin.
* @access protected
*/
protected $footer_margin;
/**
* @var original left margin value
* @access protected
* @since 1.53.0.TC013
*/
protected $original_lMargin;
/**
* @var original right margin value
* @access protected
* @since 1.53.0.TC013
*/
protected $original_rMargin;
/**
* @var Header font.
* @access protected
*/
protected $header_font;
/**
* @var Footer font.
* @access protected
*/
protected $footer_font;
/**
* @var Language templates.
* @access protected
*/
protected $l;
/**
* @var Barcode to print on page footer (only if set).
* @access protected
*/
protected $barcode = false;
/**
* @var If true prints header
* @access protected
*/
protected $print_header = true;
/**
* @var If true prints footer.
* @access protected
*/
protected $print_footer = true;
/**
* @var Header image logo.
* @access protected
*/
protected $header_logo = '';
/**
* @var Header image logo width in mm.
* @access protected
*/
protected $header_logo_width = 30;
/**
* @var String to print as title on document header.
* @access protected
*/
protected $header_title = '';
/**
* @var String to print on document header.
* @access protected
*/
protected $header_string = '';
/**
* @var Default number of columns for html table.
* @access protected
*/
protected $default_table_columns = 4;
// variables for html parser
/**
* @var HTML PARSER: array to store current link and rendering styles.
* @access protected
*/
protected $HREF = array();
/**
* @var store a list of available fonts on filesystem.
* @access protected
*/
protected $fontlist = array();
/**
* @var current foreground color
* @access protected
*/
protected $fgcolor;
/**
* @var HTML PARSER: array of boolean values, true in case of ordered list (OL), false otherwise.
* @access protected
*/
protected $listordered = array();
/**
* @var HTML PARSER: array count list items on nested lists.
* @access protected
*/
protected $listcount = array();
/**
* @var HTML PARSER: current list nesting level.
* @access protected
*/
protected $listnum = 0;
/**
* @var HTML PARSER: indent amount for lists.
* @access protected
*/
protected $listindent;
/**
* @var current background color
* @access protected
*/
protected $bgcolor;
/**
* @var Store temporary font size in points.
* @access protected
*/
protected $tempfontsize = 10;
/**
* @var spacer for LI tags.
* @access protected
*/
protected $lispacer = '';
/**
* @var default encoding
* @access protected
* @since 1.53.0.TC010
*/
protected $encoding = 'UTF-8';
/**
* @var PHP internal encoding
* @access protected
* @since 1.53.0.TC016
*/
protected $internal_encoding;
/**
* @var indicates if the document language is Right-To-Left
* @access protected
* @since 2.0.000
*/
protected $rtl = false;
/**
* @var used to force RTL or LTR string inversion
* @access protected
* @since 2.0.000
*/
protected $tmprtl = false;
// --- Variables used for document encryption:
/**
* Indicates whether document is protected
* @access protected
* @since 2.0.000 (2008-01-02)
*/
protected $encrypted;
/**
* U entry in pdf document
* @access protected
* @since 2.0.000 (2008-01-02)
*/
protected $Uvalue;
/**
* O entry in pdf document
* @access protected
* @since 2.0.000 (2008-01-02)
*/
protected $Ovalue;
/**
* P entry in pdf document
* @access protected
* @since 2.0.000 (2008-01-02)
*/
protected $Pvalue;
/**
* encryption object id
* @access protected
* @since 2.0.000 (2008-01-02)
*/
protected $enc_obj_id;
/**
* last RC4 key encrypted (cached for optimisation)
* @access protected
* @since 2.0.000 (2008-01-02)
*/
protected $last_rc4_key;
/**
* last RC4 computed key
* @access protected
* @since 2.0.000 (2008-01-02)
*/
protected $last_rc4_key_c;
/**
* RC4 padding
* @access protected
*/
protected $padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A";
/**
* RC4 encryption key
* @access protected
*/
protected $encryption_key;
// --- bookmark ---
/**
* Outlines for bookmark
* @access protected
* @since 2.1.002 (2008-02-12)
*/
protected $outlines = array();
/**
* Outline root for bookmark
* @access protected
* @since 2.1.002 (2008-02-12)
*/
protected $OutlineRoot;
// --- javascript and form ---
/**
* javascript code
* @access protected
* @since 2.1.002 (2008-02-12)
*/
protected $javascript = '';
/**
* javascript counter
* @access protected
* @since 2.1.002 (2008-02-12)
*/
protected $n_js;
/**
* line trough state
* @access protected
* @since 2.8.000 (2008-03-19)
*/
protected $linethrough;
// --- Variables used for User's Rights ---
// See PDF reference chapter 8.7 Digital Signatures
/**
* If true enables user's rights on PDF reader
* @access protected
* @since 2.9.000 (2008-03-26)
*/
protected $ur;
/**
* Names specifying additional document-wide usage rights for the document.
* @access protected
* @since 2.9.000 (2008-03-26)
*/
protected $ur_document;
/**
* Names specifying additional annotation-related usage rights for the document.
* @access protected
* @since 2.9.000 (2008-03-26)
*/
protected $ur_annots;
/**
* Names specifying additional form-field-related usage rights for the document.
* @access protected
* @since 2.9.000 (2008-03-26)
*/
protected $ur_form;
/**
* Names specifying additional signature-related usage rights for the document.
* @access protected
* @since 2.9.000 (2008-03-26)
*/
protected $ur_signature;
/**
* Dot Per Inch Document Resolution (do not change)
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $dpi = 72;
/**
* Array of page numbers were a new page group was started
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $newpagegroup = array();
/**
* Contains the number of pages of the groups
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $pagegroups;
/**
* Contains the alias of the current page group
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $currpagegroup;
/**
* Restrict the rendering of some elements to screen or printout.
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $visibility = 'all';
/**
* Print visibility.
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $n_ocg_print;
/**
* View visibility.
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $n_ocg_view;
/**
* Array of transparency objects and parameters.
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $extgstates;
/**
* Set the default JPEG compression quality (1-100)
* @access protected
* @since 3.0.000 (2008-03-27)
*/
protected $jpeg_quality;
/**
* Default cell height ratio.
* @access protected
* @since 3.0.014 (2008-05-23)
*/
protected $cell_height_ratio = K_CELL_HEIGHT_RATIO;
/**
* PDF viewer preferences.
* @access protected
* @since 3.1.000 (2008-06-09)
*/
protected $viewer_preferences;
/**
* A name object specifying how the document should be displayed when opened.
* @access protected
* @since 3.1.000 (2008-06-09)
*/
protected $PageMode;
/**
* Array for storing gradient information.
* @access protected
* @since 3.1.000 (2008-06-09)
*/
protected $gradients = array();
/**
* Array used to store positions inside the pages buffer.
* keys are the page numbers
* @access protected
* @since 3.2.000 (2008-06-26)
*/
protected $intmrk = array();
/**
* Array used to store footer positions of each page.
* @access protected
* @since 3.2.000 (2008-07-01)
*/
protected $footerpos = array();
/**
* Array used to store footer lenght of each page.
* @access protected
* @since 4.0.014 (2008-07-29)
*/
protected $footerlen = array();
/**
* True if a newline is created.
* @access protected
* @since 3.2.000 (2008-07-01)
*/
protected $newline = true;