Booster for WooCommerce - Version 3.4.0

Version Description

  • 12/02/2018 =
  • Fix - PRICES & CURRENCIES - Wholesale Price - Discount info on cart page - Price taxes display fixed.
  • Fix - PRICES & CURRENCIES - Wholesale Price - Discount info on cart page - price_directly and fixed discount taxes display fixed.
  • Fix - PRICES & CURRENCIES - Wholesale Price - Discount info on cart page - price_directly case fixed.
  • Fix - BUTTON & PRICE LABELS - Add to Cart Button Labels - Per Product Type - Additional checks added for WC cart to exist.
  • Dev - BUTTON & PRICE LABELS - Add to Cart Button Labels - Per Product Type - do_shortcode added.
  • Dev - BUTTON & PRICE LABELS - Add to Cart Button Labels - Per Product Type - Code cleanup.
  • Dev - PRODUCTS - Add to Cart - get_checkout_url() replaced with wc_get_checkout_url().
  • Dev - PRODUCTS - Add to Cart Button Visibility - All Products - "Content" options added.
  • Fix - PRODUCTS - Bookings - WooCommerce v3.0.0 compatibility - woocommerce_add_order_item_meta hook replaced with woocommerce_checkout_create_order_line_item hook.
  • Fix - PRODUCTS - Product Addons - WooCommerce v3.0.0 compatibility - woocommerce_add_order_item_meta hook replaced with woocommerce_new_order_item hook.
  • Dev - PRODUCTS - Product Addons - "Frontend Templates" section added.
  • Dev - PRODUCTS - Product Addons - "HTML Class" options added.
  • Dev - PRODUCTS - Product Addons - Admin Settings (General and Per Product) - Restyling.
  • Dev - PRODUCTS - Product Availability by Date - "Direct Date" option added.
  • Dev - PRODUCTS - Product Info - Admin Settings - Descriptions updated and settings restyled.
  • Fix - PRODUCTS - Product Input Fields - WooCommerce v3.0.0 compatibility - woocommerce_add_order_item_meta hook replaced with woocommerce_new_order_item hook.
  • Dev - PRODUCTS - Product Input Fields - "HTML Class" options added.
  • Dev - PRODUCTS - Product Tabs - Now do_shortcode() is used in tabs output, instead of applying the_content filter.
  • Dev - PRODUCTS - SKU - Search by SKU - "Advanced: Search by SKU Hook" option added.
  • Dev - PRODUCTS - SKU - "Remove SKU from Admin Emails" option added.
  • Dev - PRODUCTS - Stock - "Custom In Stock" section added.
  • Dev - PRODUCTS - Stock - "Custom Stock HTML" section added.
  • Dev - PRODUCTS - Stock - "Remove Stock Display" option added.
  • Dev - PRODUCTS - Stock - Admin Settings - Minor restyling.
  • Fix - CART & CHECKOUT - Cart Custom Info - Cart Items Table Custom Info - wp_reset_postdata() added.
  • Dev - CART & CHECKOUT - Checkout Core Fields - "Include/exclude product categories" options added.
  • Dev - CART & CHECKOUT - Checkout Core Fields - General Options - "Force Fields Sort by Priority" option added.
  • Dev - CART & CHECKOUT - Checkout Custom Fields - wcj_checkout_custom_field_visible filter added.
  • Dev - CART & CHECKOUT - Checkout Customization - "Restrict Billing/Shipping Countries by Customer's IP" options added.
  • Dev - CART & CHECKOUT - Checkout Customization - Admin Settings - Descriptions updated and settings restyled.
  • Dev - CART & CHECKOUT - Checkout Files Upload - Admin order view - "Delete all files" button added.
  • Dev - CART & CHECKOUT - EU VAT Number - Shortcodes can now be used in all "Progress Messages" (e.g. it can now be translated with [wcj_wpml]).
  • Dev - PAYMENT GATEWAYS - Gateways by Country or State - "Include/Exclude Postcodes" options added.
  • Fix - SHIPPING & ORDERS - Admin Orders List - pre_get_posts hook priority fixed.
  • Dev - SHIPPING & ORDERS - Custom Shipping - "Apply Formula to Costs" option added.
  • Dev - SHIPPING & ORDERS - Custom Shipping - Code refactoring.
  • Fix - SHIPPING & ORDERS - Order Numbers - Sequential: Reset Counter - Bug fixed.
  • Dev - SHIPPING & ORDERS - Orders - "Admin Order Navigation" added.
  • Dev - SHIPPING & ORDERS - Shipping Descriptions - Initial module release (copied from "Shipping Options" module).
  • Dev - SHIPPING & ORDERS - Shipping Icons - Initial module release (copied from "Shipping Options" module).
  • Fix - PDF INVOICING & PACKING SLIPS - Display & Misc. - Allowed User Roles - Selected user roles are now checked when creating and/or deleting documents (was hard-coded Administrator and Shop Manager).
  • Fix - PDF INVOICING & PACKING SLIPS - Display & Misc. - pre_get_posts hook priority fixed.
  • Dev - PDF INVOICING & PACKING SLIPS - General - Number of Custom Documents - Limited to max 100.
  • Dev - PDF INVOICING & PACKING SLIPS - PDF Invoices Order Meta Box - "View" link is opened in new window now.
  • Dev - PDF INVOICING & PACKING SLIPS - TCPDF library version updated to v6.2.13.
  • Fix - EMAILS & MISC. - Admin Bar - Booster: Active - Title fixed.
  • Dev - EMAILS & MISC. - Admin Tools - System Info - WCJ_SESSION_TYPE constant info added.
  • Dev - EMAILS & MISC. - Custom CSS - Admin Settings - Minor restyling.
  • Dev - EMAILS & MISC. - Custom JS - Admin Settings - Minor restyling.
  • Dev - EMAILS & MISC. - My Account - "Custom Info Blocks" section added.
  • Dev - Shortcodes - General - [wcj_customer_order_count] shortcode added.
  • Dev - Shortcodes - General - [wcj_customer_total_spent] shortcode added.
  • Dev - Shortcodes - General - [wcj_wc_session_value], [wcj_session_value], [wcj_request_value] shortcodes added.
  • Dev - Shortcodes - Orders - [wcj_order_items_table] - Columns - product_weight_multiply_qty column added.
  • Dev - Shortcodes - Orders - [wcj_order_notes] shortcode added.
  • Dev - Shortcodes - Products - [wcj_product_price] - multiply_by_meta attribute added.
  • Dev - Shortcodes - Products - [wcj_product_stock_status] shortcode added.
  • Dev - Functions - Core - Function for checking for active plugin rewritten.
  • Dev - Functions - General - Code refactoring - wcj_tcpdf_method().
  • Dev - Functions - General - wcj_get_left_to_free_shipping() - Backward compatibility with WooCommerce below v3.2.0 added.
  • Fix - Functions - General - Additional checks in wcj_session_ functions.
  • Fix - Functions - Users - wcj_get_current_user_all_roles() - Additional checks added.
  • Dev - Speed Optimization - "WC Sessions" is now the default option for WCJ_SESSION_TYPE (can be changed in "General" module).
  • Dev - Speed Optimization - "WC Sessions" support added to EU VAT Number, Checkout Files Upload, Multicurrency (Currency Switcher) and Prices and Currencies by Country modules.
  • Dev - Admin Settings - Modules submenu now is sorted by title.
  • Dev - Settings Manager - "Reset meta" button added (separated from "Reset" options button).
  • Dev - Code refactoring - alg_ replaced with wcj_ in function and class names.
  • Dev - Link changed from http://booster.io to https://booster.io in all plugin files.
Download this release

Release Info

Developer algoritmika
Plugin Icon 128x128 Booster for WooCommerce
Version 3.4.0
Comparing to
See all releases

Code changes from version 3.3.0 to 3.4.0

Files changed (88) hide show
  1. includes/add-to-cart/class-wcj-add-to-cart-per-product-type.php +32 -33
  2. includes/admin/class-wc-settings-jetpack.php +25 -9
  3. includes/admin/class-wcj-settings-manager.php +25 -34
  4. includes/admin/wcj-modules-cats.php +4 -2
  5. includes/class-wcj-add-to-cart-button-visibility.php +28 -2
  6. includes/class-wcj-admin-bar.php +5 -2
  7. includes/class-wcj-admin-orders-list.php +3 -3
  8. includes/class-wcj-admin-tools.php +3 -2
  9. includes/class-wcj-cart.php +3 -2
  10. includes/class-wcj-checkout-core-fields.php +61 -2
  11. includes/class-wcj-checkout-custom-fields.php +3 -3
  12. includes/class-wcj-checkout-customization.php +23 -3
  13. includes/class-wcj-checkout-files-upload.php +52 -30
  14. includes/class-wcj-currency-exchange-rates.php +1 -1
  15. includes/class-wcj-eu-vat-number.php +28 -23
  16. includes/class-wcj-multicurrency.php +7 -9
  17. includes/class-wcj-my-account.php +34 -2
  18. includes/class-wcj-order-numbers.php +3 -3
  19. includes/class-wcj-orders.php +54 -3
  20. includes/class-wcj-payment-gateways-by-country.php +91 -9
  21. includes/class-wcj-pdf-invoicing.php +11 -12
  22. includes/class-wcj-price-by-user-role.php +1 -1
  23. includes/class-wcj-product-add-to-cart.php +4 -4
  24. includes/class-wcj-product-addons.php +62 -29
  25. includes/class-wcj-product-bookings.php +23 -4
  26. includes/class-wcj-product-by-date.php +53 -31
  27. includes/class-wcj-product-info.php +1 -18
  28. includes/class-wcj-product-open-pricing.php +1 -1
  29. includes/class-wcj-product-price-by-formula.php +2 -2
  30. includes/class-wcj-product-tabs.php +5 -7
  31. includes/class-wcj-shipping-calculator.php +1 -1
  32. includes/class-wcj-shipping-description.php +59 -0
  33. includes/class-wcj-shipping-icons.php +61 -0
  34. includes/class-wcj-shipping-options.php +4 -58
  35. includes/class-wcj-shipping.php +61 -4
  36. includes/class-wcj-sku.php +66 -5
  37. includes/class-wcj-stock.php +84 -3
  38. includes/class-wcj-wholesale-price.php +29 -7
  39. includes/classes/class-wcj-pdf-invoice.php +2 -3
  40. includes/classes/class-wcj-tcpdf.php +20 -2
  41. includes/core/class-wcj-admin.php +6 -14
  42. includes/core/class-wcj-scripts.php +4 -3
  43. includes/core/wcj-constants.php +3 -3
  44. includes/core/wcj-modules.php +3 -1
  45. includes/exchange-rates/class-wcj-exchange-rates-crons.php +1 -1
  46. includes/functions/wcj-functions-core.php +58 -6
  47. includes/functions/wcj-functions-exchange-rates.php +39 -40
  48. includes/functions/wcj-functions-general.php +49 -20
  49. includes/functions/wcj-functions-invoicing.php +6 -3
  50. includes/functions/wcj-functions-orders.php +31 -1
  51. includes/functions/wcj-functions-price-currency.php +3 -3
  52. includes/functions/wcj-functions-products.php +12 -4
  53. includes/functions/wcj-functions-users.php +5 -2
  54. includes/input-fields/class-wcj-product-input-fields-core.php +39 -14
  55. includes/input-fields/wcj-product-input-fields-options.php +7 -1
  56. includes/js/wcj-checkout.js +3 -0
  57. includes/js/wcj-shipping-calculator.js +2 -2
  58. includes/lib/PHPMathParser/Expressions.php +15 -15
  59. includes/lib/PHPMathParser/Math.php +9 -9
  60. includes/lib/PHPMathParser/Stack.php +1 -1
  61. includes/lib/PHPMathParser/TerminalExpression.php +10 -10
  62. includes/lib/{tcpdf_min → tcpdf}/CHANGELOG.TXT +2946 -2823
  63. includes/lib/{tcpdf_min → tcpdf}/LICENSE.TXT +858 -858
  64. includes/lib/tcpdf/README.md +84 -0
  65. includes/lib/{tcpdf_min → tcpdf}/composer.json +39 -40
  66. includes/lib/{tcpdf_min → tcpdf}/config/tcpdf_config.php +227 -245
  67. includes/lib/{tcpdf_min → tcpdf}/fonts/courier.php +12 -12
  68. includes/lib/{tcpdf_min → tcpdf}/fonts/courierb.php +12 -12
  69. includes/lib/{tcpdf_min → tcpdf}/fonts/courierbi.php +12 -12
  70. includes/lib/{tcpdf_min → tcpdf}/fonts/courieri.php +12 -12
  71. includes/lib/{tcpdf_min → tcpdf}/fonts/helvetica.php +13 -13
  72. includes/lib/{tcpdf_min → tcpdf}/fonts/helveticab.php +12 -12
  73. includes/lib/{tcpdf_min → tcpdf}/fonts/helveticabi.php +12 -12
  74. includes/lib/{tcpdf_min → tcpdf}/fonts/helveticai.php +12 -12
  75. includes/lib/{tcpdf_min → tcpdf}/fonts/stsongstdlight.php +39 -39
  76. includes/lib/{tcpdf_min → tcpdf}/fonts/symbol.php +12 -12
  77. includes/lib/{tcpdf_min → tcpdf}/fonts/times.php +12 -12
  78. includes/lib/{tcpdf_min → tcpdf}/fonts/timesb.php +12 -12
  79. includes/lib/{tcpdf_min → tcpdf}/fonts/timesbi.php +12 -12
  80. includes/lib/{tcpdf_min → tcpdf}/fonts/timesi.php +12 -12
  81. includes/lib/{tcpdf_min → tcpdf}/fonts/zapfdingbats.php +12 -12
  82. includes/lib/{tcpdf_min → tcpdf}/include/barcodes/datamatrix.php +1176 -1176
  83. includes/lib/{tcpdf_min → tcpdf}/include/barcodes/pdf417.php +1007 -1002
  84. includes/lib/{tcpdf_min → tcpdf}/include/barcodes/qrcode.php +2867 -2866
  85. includes/lib/{tcpdf_min → tcpdf}/include/sRGB.icc +0 -0
  86. includes/lib/{tcpdf_min → tcpdf}/include/tcpdf_colors.php +462 -462
  87. includes/lib/{tcpdf_min → tcpdf}/include/tcpdf_filters.php +481 -481
  88. includes/lib/{tcpdf_min → tcpdf}/include/tcpdf_font_data.php +0 -1482
includes/add-to-cart/class-wcj-add-to-cart-per-product-type.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Booster for WooCommerce Add to Cart per Product Type
4
  *
5
- * @version 2.7.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -14,61 +14,60 @@ class WCJ_Add_To_Cart_Per_Product_Type {
14
 
15
  /**
16
  * Constructor.
 
 
17
  */
18
  function __construct() {
19
- if ( 'yes' === get_option( 'wcj_add_to_cart_enabled' ) ) {
20
- if ( get_option( 'wcj_add_to_cart_text_enabled' ) == 'yes' ) {
21
- add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'custom_add_to_cart_button_text' ), 100 );
22
- add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'custom_add_to_cart_button_text' ), 100 );
23
- }
24
  }
25
  }
26
 
27
  /**
28
  * custom_add_to_cart_button_text.
29
  *
30
- * @version 2.7.0
 
31
  */
32
  function custom_add_to_cart_button_text( $add_to_cart_text ) {
33
 
34
  global $woocommerce, $product;
35
 
36
- if ( ! $product )
37
  return $add_to_cart_text;
 
38
 
39
  $product_type = ( WCJ_IS_WC_VERSION_BELOW_3 ? $product->product_type : $product->get_type() );
40
-
41
- if ( ! in_array( $product_type, array( 'external', 'grouped', 'simple', 'variable' ) ) )
42
  $product_type = 'other';
 
43
 
44
- $single_or_archive = '';
45
- if ( current_filter() == 'woocommerce_product_single_add_to_cart_text' ) $single_or_archive = 'single';
46
- elseif ( current_filter() == 'woocommerce_product_add_to_cart_text' ) $single_or_archive = 'archives';
47
-
48
- if ( '' != $single_or_archive ) {
49
 
50
- //if ( 'yes' === get_option( 'wcj_add_to_cart_text_enabled_on_' . $single_or_archive . '_in_cart_' . $product_type, 'no' ) ) {
51
- if ( '' != get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_in_cart_' . $product_type, '' ) ) {
52
- foreach( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
53
- $_product = $values['data'];
54
- if( get_the_ID() == wcj_get_product_id_or_variation_parent_id( $_product ) )
55
- return get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_in_cart_' . $product_type );
56
  }
57
  }
 
58
 
59
- $text_on_no_price = get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_no_price_' . $product_type, '' );
60
- if ( '' != $text_on_no_price && '' === $product->get_price() )
61
- return $text_on_no_price;
 
62
 
63
- $text_on_zero_price = get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_zero_price_' . $product_type, '' );
64
- if ( '' != $text_on_zero_price && 0 == $product->get_price() )
65
- return $text_on_zero_price;
 
66
 
67
- //if ( get_option( 'wcj_add_to_cart_text_enabled_on_' . $single_or_archive . '_' . $product_type ) == 'yes' )
68
- if ( '' != get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_' . $product_type ) )
69
- return get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_' . $product_type );
70
- else
71
- return $add_to_cart_text;
72
  }
73
 
74
  // Default
1
  <?php
2
  /**
3
+ * Booster for WooCommerce - Add to Cart Button Labels - Per Product Type
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
14
 
15
  /**
16
  * Constructor.
17
+ *
18
+ * @version 3.4.0
19
  */
20
  function __construct() {
21
+ if ( 'yes' === get_option( 'wcj_add_to_cart_text_enabled', 'no' ) ) {
22
+ add_filter( 'woocommerce_product_single_add_to_cart_text', array( $this, 'custom_add_to_cart_button_text' ), 100 );
23
+ add_filter( 'woocommerce_product_add_to_cart_text', array( $this, 'custom_add_to_cart_button_text' ), 100 );
 
 
24
  }
25
  }
26
 
27
  /**
28
  * custom_add_to_cart_button_text.
29
  *
30
+ * @version 3.4.0
31
+ * @todo (maybe) add checkbox options to enable/disable custom labels for each product type (or even for each label)
32
  */
33
  function custom_add_to_cart_button_text( $add_to_cart_text ) {
34
 
35
  global $woocommerce, $product;
36
 
37
+ if ( ! $product ) {
38
  return $add_to_cart_text;
39
+ }
40
 
41
  $product_type = ( WCJ_IS_WC_VERSION_BELOW_3 ? $product->product_type : $product->get_type() );
42
+ if ( ! in_array( $product_type, array( 'external', 'grouped', 'simple', 'variable' ) ) ) {
 
43
  $product_type = 'other';
44
+ }
45
 
46
+ $single_or_archive = ( 'woocommerce_product_single_add_to_cart_text' == current_filter() ? 'single' : 'archives' );
 
 
 
 
47
 
48
+ // Already in cart
49
+ if ( '' != ( $text_already_in_cart = get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_in_cart_' . $product_type, '' ) ) && isset( $woocommerce->cart ) ) {
50
+ foreach( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
51
+ $_product = $values['data'];
52
+ if( get_the_ID() == wcj_get_product_id_or_variation_parent_id( $_product ) ) {
53
+ return do_shortcode( $text_already_in_cart );
54
  }
55
  }
56
+ }
57
 
58
+ // Empty price
59
+ if ( '' != ( $text_on_no_price = get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_no_price_' . $product_type, '' ) ) && '' === $product->get_price() ) {
60
+ return do_shortcode( $text_on_no_price );
61
+ }
62
 
63
+ // Free (i.e. zero price)
64
+ if ( '' != ( $text_on_zero_price = get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_zero_price_' . $product_type, '' ) ) && 0 == $product->get_price() ) {
65
+ return do_shortcode( $text_on_zero_price );
66
+ }
67
 
68
+ // General
69
+ if ( '' != ( $text_general = get_option( 'wcj_add_to_cart_text_on_' . $single_or_archive . '_' . $product_type, '' ) ) ) {
70
+ return do_shortcode( $text_general );
 
 
71
  }
72
 
73
  // Default
includes/admin/class-wc-settings-jetpack.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings
4
  *
5
- * @version 3.3.0
6
  * @since 1.0.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -57,7 +57,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
57
  /**
58
  * Output sections (modules) sub menu
59
  *
60
- * @version 3.0.0
61
  */
62
  function output_sections_submenu() {
63
  global $current_section;
@@ -107,12 +107,19 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
107
  unset( $this->cats[ $current_cat ]['all_cat_ids'][ $key ] );
108
  }
109
  }
110
- echo '<ul class="subsubsub">';
111
  foreach ( $this->cats[ $current_cat ]['all_cat_ids'] as $id ) {
112
- $label = $sections[ $id ];
113
- echo '<li><a href="' . admin_url( 'admin.php?page=wc-settings&tab=' . $this->id . '&wcj-cat=' . $current_cat . '&section=' . sanitize_title( $id ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end( $this->cats[ $current_cat ]['all_cat_ids'] ) == $id ? '' : '|' ) . ' </li>';
114
  }
115
- echo '</ul>' . '<br class="clear" />';
 
 
 
 
 
 
 
 
116
  }
117
 
118
  /**
@@ -243,7 +250,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
243
  /**
244
  * output_dashboard.
245
  *
246
- * @version 3.3.0
247
  */
248
  function output_dashboard( $current_section ) {
249
 
@@ -292,15 +299,24 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
292
  '<em>' . __( 'Import all Booster\'s options from a file.', 'woocommerce-jetpack' ) . '</em>',
293
  ),
294
  array(
295
- '<button style="width:100px;" class="button-primary" type="submit" name="booster_reset_settings" onclick="return confirm(\'' . __( 'This will reset settings to defaults for all Booster modules. Are you sure?', 'woocommerce-jetpack' ) . '\')">' . __( 'Reset', 'woocommerce-jetpack' ) . '</button>',
 
 
296
  '<em>' . __( 'Reset all Booster\'s options.', 'woocommerce-jetpack' ) . '</em>',
297
  ),
 
 
 
 
 
 
298
  );
299
  $manager_settings = $this->get_manager_settings();
300
  foreach ( $manager_settings as $manager_settings_field ) {
301
  $table_data[] = array(
302
  '<label for="' . $manager_settings_field['id'] . '">' .
303
- '<input name="' . $manager_settings_field['id'] . '" id="' . $manager_settings_field['id'] . '" type="' . $manager_settings_field['type'] . '" class="" value="1" ' . checked( get_option( $manager_settings_field['id'], $manager_settings_field['default'] ), 'yes', false ) . '>' .
 
304
  ' ' . '<strong>' . $manager_settings_field['title'] . '</strong>' .
305
  '</label>',
306
  '<em>' . $manager_settings_field['desc'] . '</em>',
2
  /**
3
  * Booster for WooCommerce - Settings
4
  *
5
+ * @version 3.4.0
6
  * @since 1.0.0
7
  * @author Algoritmika Ltd.
8
  */
57
  /**
58
  * Output sections (modules) sub menu
59
  *
60
+ * @version 3.4.0
61
  */
62
  function output_sections_submenu() {
63
  global $current_section;
107
  unset( $this->cats[ $current_cat ]['all_cat_ids'][ $key ] );
108
  }
109
  }
110
+ $menu = array();
111
  foreach ( $this->cats[ $current_cat ]['all_cat_ids'] as $id ) {
112
+ $menu[ $id ] = $sections[ $id ];
 
113
  }
114
+ if ( 'dashboard' !== $current_cat && 'pdf_invoicing' !== $current_cat ) {
115
+ asort( $menu );
116
+ }
117
+ $menu_links = array();
118
+ foreach ( $menu as $id => $label ) {
119
+ $url = admin_url( 'admin.php?page=wc-settings&tab=' . $this->id . '&wcj-cat=' . $current_cat . '&section=' . sanitize_title( $id ) );
120
+ $menu_links[] = '<a href="' . $url . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a>';
121
+ }
122
+ echo '<ul class="subsubsub">' . '<li>' . implode( '</li> | <li>', $menu_links ) . '</li>' . '</ul>' . '<br class="clear" />';
123
  }
124
 
125
  /**
250
  /**
251
  * output_dashboard.
252
  *
253
+ * @version 3.4.0
254
  */
255
  function output_dashboard( $current_section ) {
256
 
299
  '<em>' . __( 'Import all Booster\'s options from a file.', 'woocommerce-jetpack' ) . '</em>',
300
  ),
301
  array(
302
+ '<button style="width:100px;" class="button-primary" type="submit" name="booster_reset_settings"' .
303
+ wcj_get_js_confirmation( __( 'This will reset settings to defaults for all Booster modules. Are you sure?', 'woocommerce-jetpack' ) ) . '>' .
304
+ __( 'Reset', 'woocommerce-jetpack' ) . '</button>',
305
  '<em>' . __( 'Reset all Booster\'s options.', 'woocommerce-jetpack' ) . '</em>',
306
  ),
307
+ array(
308
+ '<button style="width:100px;" class="button-primary" type="submit" name="booster_reset_settings_meta"' .
309
+ wcj_get_js_confirmation( __( 'This will delete all Booster meta. Are you sure?', 'woocommerce-jetpack' ) ) . '>' .
310
+ __( 'Reset meta', 'woocommerce-jetpack' ) . '</button>',
311
+ '<em>' . __( 'Reset all Booster\'s meta.', 'woocommerce-jetpack' ) . '</em>',
312
+ ),
313
  );
314
  $manager_settings = $this->get_manager_settings();
315
  foreach ( $manager_settings as $manager_settings_field ) {
316
  $table_data[] = array(
317
  '<label for="' . $manager_settings_field['id'] . '">' .
318
+ '<input name="' . $manager_settings_field['id'] . '" id="' . $manager_settings_field['id'] . '" type="' . $manager_settings_field['type'] . '"' .
319
+ ' class="" value="1" ' . checked( get_option( $manager_settings_field['id'], $manager_settings_field['default'] ), 'yes', false ) . '>' .
320
  ' ' . '<strong>' . $manager_settings_field['title'] . '</strong>' .
321
  '</label>',
322
  '<em>' . $manager_settings_field['desc'] . '</em>',
includes/admin/class-wcj-settings-manager.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  /**
3
- * Booster for WooCommerce - Settings Manager
4
  *
5
- * @version 3.3.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -21,14 +21,13 @@ class WCJ_Settings_Manager {
21
  * @todo add options to import/export selected modules only
22
  */
23
  function __construct() {
24
- // Import / Export / Reset Booster's settings
25
  add_action( 'wp_loaded', array( $this, 'manage_options' ), PHP_INT_MAX );
26
  }
27
 
28
  /**
29
  * manage_options.
30
  *
31
- * @version 3.2.3
32
  * @since 2.5.2
33
  */
34
  function manage_options() {
@@ -45,6 +44,9 @@ class WCJ_Settings_Manager {
45
  if ( isset( $_POST['booster_reset_settings'] ) ) {
46
  $this->manage_options_reset();
47
  }
 
 
 
48
  }
49
  }
50
 
@@ -121,41 +123,32 @@ class WCJ_Settings_Manager {
121
  }
122
 
123
  /**
124
- * manage_options_reset.
125
  *
126
- * @version 3.2.4
127
- * @since 2.5.2
128
- * @todo clean up
 
129
  */
130
- function manage_options_reset() {
131
- global $wcj_notice;
132
- /*
133
- $delete_counter = 0;
134
- foreach ( WCJ()->modules as $module ) {
135
- $values = $module->get_settings();
136
- foreach ( $values as $value ) {
137
- if ( isset( $value['id'] ) ) {
138
- if ( isset ( $_POST['booster_reset_settings'] ) ) {
139
- require_once( ABSPATH . 'wp-includes/pluggable.php' );
140
- if ( wcj_is_user_role( 'administrator' ) ) {
141
- delete_option( $value['id'] );
142
- $delete_counter++;
143
- }
144
- }
145
- }
146
- }
147
- }
148
- if ( $delete_counter > 0 ) {
149
- $wcj_notice .= sprintf( __( '%d options successfully deleted.', 'woocommerce-jetpack' ), $delete_counter );
150
- }
151
- */
152
- global $wpdb;
153
  $delete_counter_meta = 0;
154
  $plugin_meta = $wpdb->get_results( "SELECT * FROM $wpdb->postmeta WHERE meta_key LIKE '_wcj_%'" );
155
  foreach( $plugin_meta as $meta ) {
156
  delete_post_meta( $meta->post_id, $meta->meta_key );
157
  $delete_counter_meta++;
158
  }
 
 
 
 
 
 
 
 
 
 
 
159
  $delete_counter_options = 0;
160
  $plugin_options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'wcj_%'" );
161
  foreach( $plugin_options as $option ) {
@@ -163,9 +156,7 @@ class WCJ_Settings_Manager {
163
  delete_site_option( $option->option_name );
164
  $delete_counter_options++;
165
  }
166
- if ( $delete_counter_meta > 0 || $delete_counter_options > 0) {
167
- $wcj_notice .= sprintf( __( '%d options and %d meta successfully deleted.', 'woocommerce-jetpack' ), $delete_counter_options, $delete_counter_meta );
168
- }
169
  }
170
 
171
  }
1
  <?php
2
  /**
3
+ * Booster for WooCommerce - Settings Manager - Import / Export / Reset Booster's settings
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
21
  * @todo add options to import/export selected modules only
22
  */
23
  function __construct() {
 
24
  add_action( 'wp_loaded', array( $this, 'manage_options' ), PHP_INT_MAX );
25
  }
26
 
27
  /**
28
  * manage_options.
29
  *
30
+ * @version 3.4.0
31
  * @since 2.5.2
32
  */
33
  function manage_options() {
44
  if ( isset( $_POST['booster_reset_settings'] ) ) {
45
  $this->manage_options_reset();
46
  }
47
+ if ( isset( $_POST['booster_reset_settings_meta'] ) ) {
48
+ $this->manage_options_reset_meta();
49
+ }
50
  }
51
  }
52
 
123
  }
124
 
125
  /**
126
+ * manage_options_reset_meta.
127
  *
128
+ * @version 3.4.0
129
+ * @since 3.4.0
130
+ * @todo order items meta
131
+ * @todo `... LIKE 'wcj_%'`
132
  */
133
+ function manage_options_reset_meta() {
134
+ global $wpdb, $wcj_notice;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  $delete_counter_meta = 0;
136
  $plugin_meta = $wpdb->get_results( "SELECT * FROM $wpdb->postmeta WHERE meta_key LIKE '_wcj_%'" );
137
  foreach( $plugin_meta as $meta ) {
138
  delete_post_meta( $meta->post_id, $meta->meta_key );
139
  $delete_counter_meta++;
140
  }
141
+ $wcj_notice .= sprintf( __( '%d meta successfully deleted.', 'woocommerce-jetpack' ), $delete_counter_meta );
142
+ }
143
+
144
+ /**
145
+ * manage_options_reset.
146
+ *
147
+ * @version 3.4.0
148
+ * @since 2.5.2
149
+ */
150
+ function manage_options_reset() {
151
+ global $wpdb, $wcj_notice;
152
  $delete_counter_options = 0;
153
  $plugin_options = $wpdb->get_results( "SELECT option_name FROM $wpdb->options WHERE option_name LIKE 'wcj_%'" );
154
  foreach( $plugin_options as $option ) {
156
  delete_site_option( $option->option_name );
157
  $delete_counter_options++;
158
  }
159
+ $wcj_notice .= sprintf( __( '%d options successfully deleted.', 'woocommerce-jetpack' ), $delete_counter_options );
 
 
160
  }
161
 
162
  }
includes/admin/wcj-modules-cats.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Modules Array
4
  *
5
- * @version 3.3.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  * @todo (maybe) split "Shipping & Orders", "Cart & Checkout", "Products", "Prices & Currencies" etc.
@@ -12,7 +12,7 @@ return apply_filters( 'wcj_modules', array(
12
 
13
  'dashboard' => array(
14
  'label' => __( 'Dashboard', 'woocommerce-jetpack' ),
15
- 'desc' => __( 'This dashboard lets you enable/disable any Booster\'s module. Each checkbox comes with short module\'s description. Please visit <a href="http://booster.io" target="_blank">http://booster.io</a> for detailed info on each feature.', 'woocommerce-jetpack' ),
16
  'all_cat_ids' => array(
17
  'alphabetically',
18
  'by_category',
@@ -131,6 +131,8 @@ return apply_filters( 'wcj_modules', array(
131
  'all_cat_ids' => array(
132
  'shipping',
133
  'shipping_options',
 
 
134
  'left_to_free_shipping',
135
  'shipping_calculator',
136
  'shipping_by_user_role',
2
  /**
3
  * Booster for WooCommerce - Modules Array
4
  *
5
+ * @version 3.4.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  * @todo (maybe) split "Shipping & Orders", "Cart & Checkout", "Products", "Prices & Currencies" etc.
12
 
13
  'dashboard' => array(
14
  'label' => __( 'Dashboard', 'woocommerce-jetpack' ),
15
+ 'desc' => __( 'This dashboard lets you enable/disable any Booster\'s module. Each checkbox comes with short module\'s description. Please visit <a href="https://booster.io" target="_blank">https://booster.io</a> for detailed info on each feature.', 'woocommerce-jetpack' ),
16
  'all_cat_ids' => array(
17
  'alphabetically',
18
  'by_category',
131
  'all_cat_ids' => array(
132
  'shipping',
133
  'shipping_options',
134
+ 'shipping_icons',
135
+ 'shipping_description',
136
  'left_to_free_shipping',
137
  'shipping_calculator',
138
  'shipping_by_user_role',
includes/class-wcj-add-to-cart-button-visibility.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Add to Cart Button Visibility
4
  *
5
- * @version 3.3.0
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ class WCJ_Add_To_Cart_Button_Visibility extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 3.3.0
20
  * @since 3.3.0
21
  */
22
  function __construct() {
@@ -38,10 +38,12 @@ class WCJ_Add_To_Cart_Button_Visibility extends WCJ_Module {
38
  // Archives
39
  if ( 'yes' === get_option( 'wcj_add_to_cart_button_disable_archives', 'no' ) ) {
40
  add_action( 'init', array( $this, 'add_to_cart_button_disable_archives' ), PHP_INT_MAX );
 
41
  }
42
  // Single Product
43
  if ( 'yes' === get_option( 'wcj_add_to_cart_button_disable_single', 'no' ) ) {
44
  add_action( 'init', array( $this, 'add_to_cart_button_disable_single' ), PHP_INT_MAX );
 
45
  }
46
  }
47
  // Per category
@@ -67,6 +69,30 @@ class WCJ_Add_To_Cart_Button_Visibility extends WCJ_Module {
67
 
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  /**
71
  * add_to_cart_button_disable_end_per_category.
72
  *
2
  /**
3
  * Booster for WooCommerce - Module - Add to Cart Button Visibility
4
  *
5
+ * @version 3.4.0
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 3.3.0
21
  */
22
  function __construct() {
38
  // Archives
39
  if ( 'yes' === get_option( 'wcj_add_to_cart_button_disable_archives', 'no' ) ) {
40
  add_action( 'init', array( $this, 'add_to_cart_button_disable_archives' ), PHP_INT_MAX );
41
+ add_action( 'woocommerce_after_shop_loop_item', array( $this, 'add_to_cart_button_archives_content' ), 10 );
42
  }
43
  // Single Product
44
  if ( 'yes' === get_option( 'wcj_add_to_cart_button_disable_single', 'no' ) ) {
45
  add_action( 'init', array( $this, 'add_to_cart_button_disable_single' ), PHP_INT_MAX );
46
+ add_action( 'woocommerce_single_product_summary', array( $this, 'add_to_cart_button_single_content' ), 30 );
47
  }
48
  }
49
  // Per category
69
 
70
  }
71
 
72
+ /**
73
+ * add_to_cart_button_archives_content.
74
+ *
75
+ * @version 3.4.0
76
+ * @since 3.4.0
77
+ */
78
+ function add_to_cart_button_archives_content() {
79
+ if ( '' != ( $content = get_option( 'wcj_add_to_cart_button_archives_content', '' ) ) ) {
80
+ echo do_shortcode( $content );
81
+ }
82
+ }
83
+
84
+ /**
85
+ * add_to_cart_button_single_content.
86
+ *
87
+ * @version 3.4.0
88
+ * @since 3.4.0
89
+ */
90
+ function add_to_cart_button_single_content() {
91
+ if ( '' != ( $content = get_option( 'wcj_add_to_cart_button_single_content', '' ) ) ) {
92
+ echo do_shortcode( $content );
93
+ }
94
+ }
95
+
96
  /**
97
  * add_to_cart_button_disable_end_per_category.
98
  *
includes/class-wcj-admin-bar.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Admin Bar
4
  *
5
- * @version 3.1.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -228,7 +228,7 @@ class WCJ_Admin_Bar extends WCJ_Module {
228
  /**
229
  * add_booster_active_admin_bar.
230
  *
231
- * @version 3.1.0
232
  * @since 3.1.0
233
  */
234
  function add_booster_active_admin_bar( $wp_admin_bar ) {
@@ -244,6 +244,9 @@ class WCJ_Admin_Bar extends WCJ_Module {
244
  'booster-active' => array(
245
  'title' => '<span class="ab-icon"></span>' . __( 'Booster: Active', 'woocommerce-jetpack' ),
246
  'href' => admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=dashboard&section=active' ),
 
 
 
247
  'nodes' => array_merge( $this->active_modules, $tools ),
248
  ),
249
  );
2
  /**
3
  * Booster for WooCommerce - Module - Admin Bar
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
228
  /**
229
  * add_booster_active_admin_bar.
230
  *
231
+ * @version 3.4.0
232
  * @since 3.1.0
233
  */
234
  function add_booster_active_admin_bar( $wp_admin_bar ) {
244
  'booster-active' => array(
245
  'title' => '<span class="ab-icon"></span>' . __( 'Booster: Active', 'woocommerce-jetpack' ),
246
  'href' => admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=dashboard&section=active' ),
247
+ 'meta' => array(
248
+ 'title' => __( 'Booster - Active', 'woocommerce-jetpack' ),
249
+ ),
250
  'nodes' => array_merge( $this->active_modules, $tools ),
251
  ),
252
  );
includes/class-wcj-admin-orders-list.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Admin Orders List
4
  *
5
- * @version 3.2.4
6
  * @since 3.2.4
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ class WCJ_Admin_Orders_List extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 3.2.4
20
  * @since 3.2.4
21
  */
22
  function __construct() {
@@ -40,7 +40,7 @@ class WCJ_Admin_Orders_List extends WCJ_Module {
40
  }
41
  // Maybe make sortable custom columns
42
  add_filter( 'manage_edit-shop_order_sortable_columns', array( $this, 'shop_order_sortable_columns' ) );
43
- add_action( 'pre_get_posts', array( $this, 'shop_order_pre_get_posts_order_by_column' ), 1 );
44
  }
45
 
46
  // Multiple status
2
  /**
3
  * Booster for WooCommerce - Module - Admin Orders List
4
  *
5
+ * @version 3.4.0
6
  * @since 3.2.4
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 3.2.4
21
  */
22
  function __construct() {
40
  }
41
  // Maybe make sortable custom columns
42
  add_filter( 'manage_edit-shop_order_sortable_columns', array( $this, 'shop_order_sortable_columns' ) );
43
+ add_action( 'pre_get_posts', array( $this, 'shop_order_pre_get_posts_order_by_column' ) );
44
  }
45
 
46
  // Multiple status
includes/class-wcj-admin-tools.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Admin Tools
4
  *
5
- * @version 3.3.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -199,7 +199,7 @@ class WCJ_Admin_Tools extends WCJ_Module {
199
  /**
200
  * get_system_info_table_array.
201
  *
202
- * @version 2.7.0
203
  * @since 2.5.7
204
  * @todo (maybe) 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST', 'DB_CHARSET', 'DB_COLLATE'
205
  */
@@ -213,6 +213,7 @@ class WCJ_Admin_Tools extends WCJ_Module {
213
  'DISABLE_WP_CRON',
214
  'WP_CRON_LOCK_TIMEOUT',
215
  'WCJ_WC_VERSION',
 
216
  );
217
  foreach ( $constants_array as $the_constant ) {
218
  $system_info[] = array( $the_constant, ( defined( $the_constant ) ? constant( $the_constant ) : __( 'NOT DEFINED', 'woocommerce-jetpack' ) ) );
2
  /**
3
  * Booster for WooCommerce - Module - Admin Tools
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
199
  /**
200
  * get_system_info_table_array.
201
  *
202
+ * @version 3.4.0
203
  * @since 2.5.7
204
  * @todo (maybe) 'DB_NAME', 'DB_USER', 'DB_PASSWORD', 'DB_HOST', 'DB_CHARSET', 'DB_COLLATE'
205
  */
213
  'DISABLE_WP_CRON',
214
  'WP_CRON_LOCK_TIMEOUT',
215
  'WCJ_WC_VERSION',
216
+ 'WCJ_SESSION_TYPE',
217
  );
218
  foreach ( $constants_array as $the_constant ) {
219
  $system_info[] = array( $the_constant, ( defined( $the_constant ) ? constant( $the_constant ) : __( 'NOT DEFINED', 'woocommerce-jetpack' ) ) );
includes/class-wcj-cart.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Cart Custom Info
4
  *
5
- * @version 2.8.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -43,7 +43,7 @@ class WCJ_Cart extends WCJ_Module {
43
  /**
44
  * add_custom_info_to_cart_item_name.
45
  *
46
- * @version 2.3.9
47
  * @since 2.3.9
48
  * @todo (maybe) `wc_setup_product_data( $post );`
49
  */
@@ -54,6 +54,7 @@ class WCJ_Cart extends WCJ_Module {
54
  $post = get_post( $cart_item['product_id'] );
55
  setup_postdata( $post );
56
  $product_title .= do_shortcode( $custom_content );
 
57
  }
58
  return $product_title;
59
  }
2
  /**
3
  * Booster for WooCommerce - Module - Cart Custom Info
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
43
  /**
44
  * add_custom_info_to_cart_item_name.
45
  *
46
+ * @version 3.4.0
47
  * @since 2.3.9
48
  * @todo (maybe) `wc_setup_product_data( $post );`
49
  */
54
  $post = get_post( $cart_item['product_id'] );
55
  setup_postdata( $post );
56
  $product_title .= do_shortcode( $custom_content );
57
+ wp_reset_postdata();
58
  }
59
  return $product_title;
60
  }
includes/class-wcj-checkout-core-fields.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Core Fields
4
  *
5
- * @version 3.3.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -134,7 +134,8 @@ class WCJ_Checkout_Core_Fields extends WCJ_Module {
134
  /**
135
  * custom_override_checkout_fields.
136
  *
137
- * @version 2.8.0
 
138
  * @todo (maybe) fix - priority seems to not affect tab order (same in Checkout Custom Fields module)
139
  * @todo (maybe) enable if was not enabled by default, i.e. `! isset( $checkout_fields[ $section ][ $field ] )`
140
  */
@@ -149,6 +150,19 @@ class WCJ_Checkout_Core_Fields extends WCJ_Module {
149
  continue;
150
  }
151
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  if ( isset( $checkout_fields[ $section ][ $field ] ) ) {
153
  // required
154
  if ( 'default' != ( $is_required = get_option( 'wcj_checkout_fields_' . $field . '_' . 'is_required', 'default' ) ) ) {
@@ -172,9 +186,54 @@ class WCJ_Checkout_Core_Fields extends WCJ_Module {
172
  }
173
  }
174
  }
 
 
 
 
 
 
 
 
175
  return $checkout_fields;
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
 
180
  endif;
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Core Fields
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
134
  /**
135
  * custom_override_checkout_fields.
136
  *
137
+ * @version 3.4.0
138
+ * @todo add "per products", "per products tags"
139
  * @todo (maybe) fix - priority seems to not affect tab order (same in Checkout Custom Fields module)
140
  * @todo (maybe) enable if was not enabled by default, i.e. `! isset( $checkout_fields[ $section ][ $field ] )`
141
  */
150
  continue;
151
  }
152
  }
153
+ // enabled - per products categories
154
+ if ( ! $this->is_visible( array(
155
+ 'include_products' => '',
156
+ 'exclude_products' => '',
157
+ 'include_categories' => apply_filters( 'booster_option', '', get_option( 'wcj_checkout_fields_' . $field . '_' . 'cats_incl', '' ) ),
158
+ 'exclude_categories' => apply_filters( 'booster_option', '', get_option( 'wcj_checkout_fields_' . $field . '_' . 'cats_excl', '' ) ),
159
+ 'include_tags' => '',
160
+ 'exclude_tags' => '',
161
+ ) )
162
+ ) {
163
+ unset( $checkout_fields[ $section ][ $field ] );
164
+ continue;
165
+ }
166
  if ( isset( $checkout_fields[ $section ][ $field ] ) ) {
167
  // required
168
  if ( 'default' != ( $is_required = get_option( 'wcj_checkout_fields_' . $field . '_' . 'is_required', 'default' ) ) ) {
186
  }
187
  }
188
  }
189
+ if ( 'yes' === get_option( 'wcj_checkout_core_fields_force_sort_by_priority', 'no' ) ) {
190
+ $field_sets = array( 'billing', 'shipping', 'account', 'order' );
191
+ foreach ( $field_sets as $field_set ) {
192
+ if ( isset( $checkout_fields[ $field_set ] ) ) {
193
+ uasort( $checkout_fields[ $field_set ], array( $this, 'sort_by_priority' ) );
194
+ }
195
+ }
196
+ }
197
  return $checkout_fields;
198
  }
199
 
200
+ /**
201
+ * is_visible.
202
+ *
203
+ * @version 3.4.0
204
+ * @since 3.4.0
205
+ * @todo (maybe) save `$this->cart_product_ids` array (instead of calling `WC()->cart->get_cart()` for each field)
206
+ */
207
+ function is_visible( $args ) {
208
+ foreach ( $args as $arg ) {
209
+ if ( ! empty( $arg ) ) {
210
+ // At least one arg is filled - checking products in cart
211
+ foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
212
+ if ( ! wcj_is_enabled_for_product( $values['product_id'], $args ) ) {
213
+ return false;
214
+ }
215
+ }
216
+ break;
217
+ }
218
+ }
219
+ return true;
220
+ }
221
+
222
+ /**
223
+ * sort_by_priority.
224
+ *
225
+ * @version 3.4.0
226
+ * @since 3.4.0
227
+ */
228
+ function sort_by_priority( $a, $b ) {
229
+ $a = ( isset( $a['priority'] ) ? $a['priority'] : 0 );
230
+ $b = ( isset( $b['priority'] ) ? $b['priority'] : 0 );
231
+ if ( $a == $b ) {
232
+ return 0;
233
+ }
234
+ return ( $a < $b ) ? -1 : 1;
235
+ }
236
+
237
  }
238
 
239
  endif;
includes/class-wcj-checkout-custom-fields.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Custom Fields
4
  *
5
- * @version 3.2.4
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -466,7 +466,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
466
  /**
467
  * is_visible.
468
  *
469
- * @version 3.2.4
470
  * @since 2.6.0
471
  * @todo add "user roles to include/exclude"
472
  */
@@ -547,7 +547,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
547
  }
548
 
549
  // All passed
550
- return true;
551
  }
552
 
553
  /**
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Custom Fields
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
466
  /**
467
  * is_visible.
468
  *
469
+ * @version 3.4.0
470
  * @since 2.6.0
471
  * @todo add "user roles to include/exclude"
472
  */
547
  }
548
 
549
  // All passed
550
+ return apply_filters( 'wcj_checkout_custom_field_visible', true, $i );
551
  }
552
 
553
  /**
includes/class-wcj-checkout-customization.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Customization
4
  *
5
- * @version 3.3.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ class WCJ_Checkout_Customization extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 3.3.0
20
  * @since 2.7.0
21
  * @todo "Disable Fields on Checkout for Logged Users" - billing and shipping country ('select' type)
22
  * @todo "Disable Fields on Checkout for Logged Users" - other core fields (e.g. account fields)
@@ -27,7 +27,7 @@ class WCJ_Checkout_Customization extends WCJ_Module {
27
 
28
  $this->id = 'checkout_customization';
29
  $this->short_desc = __( 'Checkout Customization', 'woocommerce-jetpack' );
30
- $this->desc = __( 'Customize WooCommerce checkout - hide "Order Again" button; disable selected fields on checkout for logged users and more.', 'woocommerce-jetpack' );
31
  $this->link_slug = 'woocommerce-checkout-customization';
32
  parent::__construct();
33
 
@@ -70,9 +70,29 @@ class WCJ_Checkout_Customization extends WCJ_Module {
70
  if ( 'yes' === get_option( 'wcj_checkout_customization_checkout_login_message_enabled', 'no' ) ) {
71
  add_filter( 'woocommerce_checkout_login_message', array( $this, 'checkout_login_message' ), PHP_INT_MAX );
72
  }
 
 
 
 
 
 
 
73
  }
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * checkout_login_message.
78
  *
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Customization
4
  *
5
+ * @version 3.4.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 2.7.0
21
  * @todo "Disable Fields on Checkout for Logged Users" - billing and shipping country ('select' type)
22
  * @todo "Disable Fields on Checkout for Logged Users" - other core fields (e.g. account fields)
27
 
28
  $this->id = 'checkout_customization';
29
  $this->short_desc = __( 'Checkout Customization', 'woocommerce-jetpack' );
30
+ $this->desc = __( 'Customize WooCommerce checkout - restrict countries by customer\'s IP; hide "Order Again" button; disable selected fields on checkout for logged users and more.', 'woocommerce-jetpack' );
31
  $this->link_slug = 'woocommerce-checkout-customization';
32
  parent::__construct();
33
 
70
  if ( 'yes' === get_option( 'wcj_checkout_customization_checkout_login_message_enabled', 'no' ) ) {
71
  add_filter( 'woocommerce_checkout_login_message', array( $this, 'checkout_login_message' ), PHP_INT_MAX );
72
  }
73
+ // Restrict countries by customer's IP
74
+ if ( 'yes' === get_option( 'wcj_checkout_restrict_countries_by_customer_ip_billing', 'no' ) ) {
75
+ add_filter( 'woocommerce_countries_allowed_countries', array( $this, 'restrict_countries_by_customer_ip' ), PHP_INT_MAX );
76
+ }
77
+ if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_checkout_restrict_countries_by_customer_ip_shipping', 'no' ) ) ) {
78
+ add_filter( 'woocommerce_countries_shipping_countries', array( $this, 'restrict_countries_by_customer_ip' ), PHP_INT_MAX );
79
+ }
80
  }
81
  }
82
 
83
+ /**
84
+ * restrict_countries_by_customer_ip.
85
+ *
86
+ * @version 3.4.0
87
+ * @since 3.4.0
88
+ * @todo (maybe) handle case when `wcj_get_country_by_ip()` returns empty string
89
+ * @todo (maybe) for shipping countries - filter `woocommerce_ship_to_countries` option
90
+ */
91
+ function restrict_countries_by_customer_ip( $countries ) {
92
+ $user_country = wcj_get_country_by_ip();
93
+ return array( $user_country => wcj_get_country_name_by_code( $user_country ) );
94
+ }
95
+
96
  /**
97
  * checkout_login_message.
98
  *
includes/class-wcj-checkout-files-upload.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Files Upload
4
  *
5
- * @version 3.2.3
6
  * @since 2.4.5
7
  * @author Algoritmika Ltd.
8
- * @todo styling options;
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -92,7 +92,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
92
  /**
93
  * validate_on_checkout.
94
  *
95
- * @version 3.2.3
96
  * @since 2.4.5
97
  */
98
  function validate_on_checkout( $posted ) {
@@ -103,14 +103,15 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
103
  $this->is_visible( $i ) &&
104
  'disable' != get_option( 'wcj_checkout_files_upload_hook_' . $i, 'woocommerce_before_checkout_form' )
105
  ) {
106
- if ( 'yes' === get_option( 'wcj_checkout_files_upload_required_' . $i, 'no' ) && ! isset( $_SESSION[ 'wcj_checkout_files_upload_' . $i ] ) ) {
107
  // Is required
108
  wc_add_notice( get_option( 'wcj_checkout_files_upload_notice_required_' . $i, __( 'File is required!', 'woocommerce-jetpack' ) ), 'error' );
109
  }
110
- if ( ! isset( $_SESSION[ 'wcj_checkout_files_upload_' . $i ] ) ) {
111
  continue;
112
  }
113
- $file_name = $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['name'];
 
114
  $file_type = '.' . pathinfo( $file_name, PATHINFO_EXTENSION );
115
  if ( '' != ( $file_accept = get_option( 'wcj_checkout_files_upload_file_accept_' . $i, '' ) ) ) {
116
  // Validate file type
@@ -153,7 +154,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
153
  /**
154
  * create_file_admin_order_meta_box.
155
  *
156
- * @version 2.5.6
157
  * @since 2.4.5
158
  */
159
  function create_file_admin_order_meta_box() {
@@ -175,6 +176,9 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
175
  }
176
  if ( ! $files_exists ) {
177
  $html .= '<p><em>' . __( 'No files uploaded.', 'woocommerce-jetpack' ) . '</em></p>';
 
 
 
178
  }
179
  echo $html;
180
  }
@@ -203,7 +207,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
203
  /**
204
  * add_files_to_order.
205
  *
206
- * @version 3.2.3
207
  * @since 2.4.5
208
  */
209
  function add_files_to_order( $order_id, $posted ) {
@@ -213,18 +217,19 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
213
  }
214
  $total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
215
  for ( $i = 1; $i <= $total_number; $i++ ) {
216
- if ( isset( $_SESSION[ 'wcj_checkout_files_upload_' . $i ] ) ) {
217
- $file_name = $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['name'];
 
218
  $ext = pathinfo( $file_name, PATHINFO_EXTENSION );
219
  $download_file_name = $order_id . '_' . $i . '.' . $ext;
220
  $file_path = $upload_dir . '/' . $download_file_name;
221
- $tmp_file_name = $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['tmp_name'];
222
  $file_data = file_get_contents( $tmp_file_name );
223
  if ( ! $this->is_extension_blocked( $ext ) ) { // should already be validated earlier, but just in case...
224
  file_put_contents( $file_path, $file_data );
225
  }
226
  unlink( $tmp_file_name );
227
- unset( $_SESSION[ 'wcj_checkout_files_upload_' . $i ] );
228
  update_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_' . $i, $download_file_name );
229
  update_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_real_name_' . $i, $file_name );
230
  }
@@ -235,13 +240,12 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
235
  /**
236
  * process_checkout_files_upload.
237
  *
238
- * @version 3.2.3
239
  * @since 2.4.5
 
240
  */
241
  function process_checkout_files_upload() {
242
- if ( ! session_id() ) {
243
- session_start();
244
- }
245
  // Remove file
246
  $total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
247
  for ( $i = 1; $i <= $total_number; $i++ ) {
@@ -259,11 +263,11 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
259
  delete_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_real_name_' . $i );
260
  }
261
  } else {
262
- $file_name = 'wcj_checkout_files_upload_' . $i;
263
- unlink( $_SESSION[ $file_name ]['tmp_name'] );
264
  wc_add_notice( sprintf( get_option( 'wcj_checkout_files_upload_notice_success_remove_' . $i,
265
- __( 'File "%s" was successfully removed.', 'woocommerce-jetpack' ) ), $_SESSION[ $file_name ]['name'] ) );
266
- unset( $_SESSION[ $file_name ] );
267
  }
268
  }
269
  }
@@ -294,12 +298,13 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
294
  }
295
  if ( $is_valid ) {
296
  // To session
297
- $_SESSION[ $file_name ] = $_FILES[ $file_name ];
298
  $tmp_dest_file = tempnam( sys_get_temp_dir(), 'wcj' );
299
- move_uploaded_file( $_SESSION[ $file_name ]['tmp_name'], $tmp_dest_file );
300
- $_SESSION[ $file_name ]['tmp_name'] = $tmp_dest_file;
 
 
301
  wc_add_notice( sprintf( get_option( 'wcj_checkout_files_upload_notice_success_upload_' . $i,
302
- __( 'File "%s" was successfully uploaded.', 'woocommerce-jetpack' ) ), $_SESSION[ $file_name ]['name'] ) );
303
  // To order
304
  if ( isset( $_POST[ 'wcj_checkout_files_upload_order_id_' . $i ] ) ) {
305
  $this->add_files_to_order( $_POST[ 'wcj_checkout_files_upload_order_id_' . $i ], null );
@@ -326,6 +331,21 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
326
  exit();
327
  }
328
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  // User file download
330
  if ( isset( $_GET['wcj_download_checkout_file'] ) && isset( $_GET['_wpnonce'] ) && ( false !== wp_verify_nonce( $_GET['_wpnonce'], 'wcj_download_checkout_file' ) ) ) {
331
  $i = $_GET['wcj_download_checkout_file'];
@@ -336,11 +356,12 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
336
  return;
337
  }
338
  $order_file_name = get_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_' . $i, true );
339
- $tmp_file_name = wcj_get_wcj_uploads_dir( 'checkout_files_upload' ) . '/' . $order_file_name;
340
- $file_name = get_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_real_name_' . $i, true );
341
  } else {
342
- $tmp_file_name = $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['tmp_name'];
343
- $file_name = $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['name'];
 
344
  }
345
  header( "Expires: 0" );
346
  header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
@@ -585,7 +606,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
585
  /**
586
  * add_files_upload_form_to_checkout_frontend_all.
587
  *
588
- * @version 2.5.2
589
  * @since 2.5.2
590
  */
591
  function add_files_upload_form_to_checkout_frontend_all( $is_direct_call = false ) {
@@ -601,7 +622,8 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
601
  $current_filter_priority == get_option( 'wcj_checkout_files_upload_hook_priority_' . $i, 10 )
602
  );
603
  if ( 'yes' === get_option( 'wcj_checkout_files_upload_enabled_' . $i, 'yes' ) && $is_filter_ok && $this->is_visible( $i ) ) {
604
- $file_name = ( isset( $_SESSION[ 'wcj_checkout_files_upload_' . $i ] ) ) ? $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['name'] : '';
 
605
  $html .= $this->get_the_form( $i, $file_name );
606
  }
607
  }
2
  /**
3
  * Booster for WooCommerce - Module - Checkout Files Upload
4
  *
5
+ * @version 3.4.0
6
  * @since 2.4.5
7
  * @author Algoritmika Ltd.
8
+ * @todo styling options
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit;
92
  /**
93
  * validate_on_checkout.
94
  *
95
+ * @version 3.4.0
96
  * @since 2.4.5
97
  */
98
  function validate_on_checkout( $posted ) {
103
  $this->is_visible( $i ) &&
104
  'disable' != get_option( 'wcj_checkout_files_upload_hook_' . $i, 'woocommerce_before_checkout_form' )
105
  ) {
106
+ if ( 'yes' === get_option( 'wcj_checkout_files_upload_required_' . $i, 'no' ) && null === wcj_session_get( 'wcj_checkout_files_upload_' . $i ) ) {
107
  // Is required
108
  wc_add_notice( get_option( 'wcj_checkout_files_upload_notice_required_' . $i, __( 'File is required!', 'woocommerce-jetpack' ) ), 'error' );
109
  }
110
+ if ( null === wcj_session_get( 'wcj_checkout_files_upload_' . $i ) ) {
111
  continue;
112
  }
113
+ $file_name = wcj_session_get( 'wcj_checkout_files_upload_' . $i );
114
+ $file_name = $file_name['name'];
115
  $file_type = '.' . pathinfo( $file_name, PATHINFO_EXTENSION );
116
  if ( '' != ( $file_accept = get_option( 'wcj_checkout_files_upload_file_accept_' . $i, '' ) ) ) {
117
  // Validate file type
154
  /**
155
  * create_file_admin_order_meta_box.
156
  *
157
+ * @version 3.4.0
158
  * @since 2.4.5
159
  */
160
  function create_file_admin_order_meta_box() {
176
  }
177
  if ( ! $files_exists ) {
178
  $html .= '<p><em>' . __( 'No files uploaded.', 'woocommerce-jetpack' ) . '</em></p>';
179
+ } else {
180
+ $html .= '<p><a style="color:#a00;" href="' . add_query_arg( 'wcj_download_checkout_file_admin_delete_all', $order_id ) . '"' . wcj_get_js_confirmation() . '>' .
181
+ __( 'Delete all files', 'woocommerce-jetpack' ) . '</a></p>';
182
  }
183
  echo $html;
184
  }
207
  /**
208
  * add_files_to_order.
209
  *
210
+ * @version 3.4.0
211
  * @since 2.4.5
212
  */
213
  function add_files_to_order( $order_id, $posted ) {
217
  }
218
  $total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
219
  for ( $i = 1; $i <= $total_number; $i++ ) {
220
+ if ( null !== wcj_session_get( 'wcj_checkout_files_upload_' . $i ) ) {
221
+ $session_data = wcj_session_get( 'wcj_checkout_files_upload_' . $i );
222
+ $file_name = $session_data['name'];
223
  $ext = pathinfo( $file_name, PATHINFO_EXTENSION );
224
  $download_file_name = $order_id . '_' . $i . '.' . $ext;
225
  $file_path = $upload_dir . '/' . $download_file_name;
226
+ $tmp_file_name = $session_data['tmp_name'];
227
  $file_data = file_get_contents( $tmp_file_name );
228
  if ( ! $this->is_extension_blocked( $ext ) ) { // should already be validated earlier, but just in case...
229
  file_put_contents( $file_path, $file_data );
230
  }
231
  unlink( $tmp_file_name );
232
+ wcj_session_set( 'wcj_checkout_files_upload_' . $i, null );
233
  update_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_' . $i, $download_file_name );
234
  update_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_real_name_' . $i, $file_name );
235
  }
240
  /**
241
  * process_checkout_files_upload.
242
  *
243
+ * @version 3.4.0
244
  * @since 2.4.5
245
+ * @todo add option for admin to delete files one by one (i.e. not all at once)
246
  */
247
  function process_checkout_files_upload() {
248
+ wcj_session_maybe_start();
 
 
249
  // Remove file
250
  $total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
251
  for ( $i = 1; $i <= $total_number; $i++ ) {
263
  delete_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_real_name_' . $i );
264
  }
265
  } else {
266
+ $session_data = wcj_session_get( 'wcj_checkout_files_upload_' . $i );
267
+ unlink( $session_data['tmp_name'] );
268
  wc_add_notice( sprintf( get_option( 'wcj_checkout_files_upload_notice_success_remove_' . $i,
269
+ __( 'File "%s" was successfully removed.', 'woocommerce-jetpack' ) ), $session_data['name'] ) );
270
+ wcj_session_set( 'wcj_checkout_files_upload_' . $i, null );
271
  }
272
  }
273
  }
298
  }
299
  if ( $is_valid ) {
300
  // To session
 
301
  $tmp_dest_file = tempnam( sys_get_temp_dir(), 'wcj' );
302
+ move_uploaded_file( $_FILES[ $file_name ]['tmp_name'], $tmp_dest_file );
303
+ $session_data = $_FILES[ $file_name ];
304
+ $session_data['tmp_name'] = $tmp_dest_file;
305
+ wcj_session_set( $file_name, $session_data );
306
  wc_add_notice( sprintf( get_option( 'wcj_checkout_files_upload_notice_success_upload_' . $i,
307
+ __( 'File "%s" was successfully uploaded.', 'woocommerce-jetpack' ) ), $_FILES[ $file_name ]['name'] ) );
308
  // To order
309
  if ( isset( $_POST[ 'wcj_checkout_files_upload_order_id_' . $i ] ) ) {
310
  $this->add_files_to_order( $_POST[ 'wcj_checkout_files_upload_order_id_' . $i ], null );
331
  exit();
332
  }
333
  }
334
+ // Admin all files delete
335
+ if ( isset( $_GET['wcj_download_checkout_file_admin_delete_all'] ) && ( wcj_is_user_role( 'administrator' ) || is_shop_manager() ) ) {
336
+ $order_id = $_GET['wcj_download_checkout_file_admin_delete_all'];
337
+ $total_files = get_post_meta( $order_id, '_' . 'wcj_checkout_files_total_files', true );
338
+ for ( $i = 1; $i <= $total_files; $i++ ) {
339
+ if ( '' != ( $order_file_name = get_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_' . $i, true ) ) ) {
340
+ unlink( wcj_get_wcj_uploads_dir( 'checkout_files_upload' ) . '/' . $order_file_name );
341
+ }
342
+ delete_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_' . $i );
343
+ delete_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_real_name_' . $i );
344
+ }
345
+ delete_post_meta( $order_id, '_' . 'wcj_checkout_files_total_files' );
346
+ wp_safe_redirect( remove_query_arg( 'wcj_download_checkout_file_admin_delete_all' ) );
347
+ exit;
348
+ }
349
  // User file download
350
  if ( isset( $_GET['wcj_download_checkout_file'] ) && isset( $_GET['_wpnonce'] ) && ( false !== wp_verify_nonce( $_GET['_wpnonce'], 'wcj_download_checkout_file' ) ) ) {
351
  $i = $_GET['wcj_download_checkout_file'];
356
  return;
357
  }
358
  $order_file_name = get_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_' . $i, true );
359
+ $tmp_file_name = wcj_get_wcj_uploads_dir( 'checkout_files_upload' ) . '/' . $order_file_name;
360
+ $file_name = get_post_meta( $order_id, '_' . 'wcj_checkout_files_upload_real_name_' . $i, true );
361
  } else {
362
+ $session_data = wcj_session_get( 'wcj_checkout_files_upload_' . $i );
363
+ $tmp_file_name = $session_data['tmp_name'];
364
+ $file_name = $session_data['name'];
365
  }
366
  header( "Expires: 0" );
367
  header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
606
  /**
607
  * add_files_upload_form_to_checkout_frontend_all.
608
  *
609
+ * @version 3.4.0
610
  * @since 2.5.2
611
  */
612
  function add_files_upload_form_to_checkout_frontend_all( $is_direct_call = false ) {
622
  $current_filter_priority == get_option( 'wcj_checkout_files_upload_hook_priority_' . $i, 10 )
623
  );
624
  if ( 'yes' === get_option( 'wcj_checkout_files_upload_enabled_' . $i, 'yes' ) && $is_filter_ok && $this->is_visible( $i ) ) {
625
+ $session_data = wcj_session_get( 'wcj_checkout_files_upload_' . $i );
626
+ $file_name = ( null !== $session_data ? $session_data['name'] : '' );
627
  $html .= $this->get_the_form( $i, $file_name );
628
  }
629
  }
includes/class-wcj-currency-exchange-rates.php CHANGED
@@ -43,7 +43,7 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
43
  * @todo (maybe) move this to `class-wcj-exchange-rates.php`
44
  */
45
  function wcj_ajax_get_exchange_rates() {
46
- echo alg_get_exchange_rate( $_POST['wcj_currency_from'], $_POST['wcj_currency_to'] );
47
  die();
48
  }
49
 
43
  * @todo (maybe) move this to `class-wcj-exchange-rates.php`
44
  */
45
  function wcj_ajax_get_exchange_rates() {
46
+ echo wcj_get_exchange_rate( $_POST['wcj_currency_from'], $_POST['wcj_currency_to'] );
47
  die();
48
  }
49
 
includes/class-wcj-eu-vat-number.php CHANGED
@@ -2,9 +2,10 @@
2
  /**
3
  * Booster for WooCommerce - Module - EU VAT Number
4
  *
5
- * @version 3.3.0
6
  * @since 2.3.9
7
  * @author Algoritmika Ltd.
 
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -286,10 +287,12 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
286
 
287
  /**
288
  * add_default_checkout_billing_eu_vat_number.
 
 
289
  */
290
  function add_default_checkout_billing_eu_vat_number( $default_value, $field_key ) {
291
- if ( isset( $_SESSION['wcj_eu_vat_number_to_check'] ) ) {
292
- return $_SESSION['wcj_eu_vat_number_to_check'];
293
  } elseif ( is_user_logged_in() ) {
294
  $current_user = wp_get_current_user();
295
  if ( $meta = get_user_meta( $current_user->ID, 'billing_eu_vat_number', true ) ) {
@@ -312,17 +315,17 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
312
 
313
  /**
314
  * start_session.
 
 
315
  */
316
  function start_session() {
317
- if ( ! session_id() ) {
318
- session_start();
319
- }
320
  $args = array();
321
  if ( isset( $_POST['post_data'] ) ) {
322
  parse_str( $_POST['post_data'], $args );
323
- if ( isset( $args['billing_eu_vat_number'] ) && isset( $_SESSION['wcj_eu_vat_number_to_check'] ) && $_SESSION['wcj_eu_vat_number_to_check'] != $args['billing_eu_vat_number'] ) {
324
- unset( $_SESSION['wcj_is_eu_vat_number_valid'] );
325
- unset( $_SESSION['wcj_eu_vat_number_to_check'] );
326
  }
327
  }
328
  }
@@ -330,7 +333,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
330
  /**
331
  * enqueue_scripts.
332
  *
333
- * @version 2.9.0
334
  */
335
  function enqueue_scripts() {
336
  if ( 'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) ) {
@@ -338,10 +341,10 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
338
  wp_localize_script( 'wcj-eu-vat-number', 'ajax_object', array(
339
  'ajax_url' => admin_url( 'admin-ajax.php' ),
340
  'add_progress_text' => get_option( 'wcj_eu_vat_number_add_progress_text', 'no' ),
341
- 'progress_text_validating' => get_option( 'wcj_eu_vat_number_progress_text_validating', __( 'Validating VAT. Please wait...', 'woocommerce-jetpack' ) ),
342
- 'progress_text_valid' => get_option( 'wcj_eu_vat_number_progress_text_valid', __( 'VAT is valid.', 'woocommerce-jetpack' ) ),
343
- 'progress_text_not_valid' => get_option( 'wcj_eu_vat_number_progress_text_not_valid', __( 'VAT is not valid.', 'woocommerce-jetpack' ) ),
344
- 'progress_text_validation_failed' => get_option( 'wcj_eu_vat_number_progress_text_validation_failed', __( 'Validation failed. Please try again.', 'woocommerce-jetpack' ) ),
345
  ) );
346
  }
347
  }
@@ -349,7 +352,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
349
  /**
350
  * wcj_validate_eu_vat_number.
351
  *
352
- * @version 2.9.0
353
  */
354
  function wcj_validate_eu_vat_number( $param ) {
355
  // if ( ! isset( $_GET['wcj_validate_eu_vat_number'] ) ) return;
@@ -370,8 +373,8 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
370
  } else {
371
  $is_valid = null;
372
  }
373
- $_SESSION['wcj_is_eu_vat_number_valid'] = $is_valid;
374
- $_SESSION['wcj_eu_vat_number_to_check'] = $_POST['wcj_eu_vat_number_to_check'];
375
  if ( false === $is_valid ) {
376
  echo '0';
377
  } elseif ( true === $is_valid ) {
@@ -387,7 +390,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
387
  /**
388
  * maybe_exclude_vat.
389
  *
390
- * @version 3.2.4
391
  */
392
  // function maybe_exclude_vat( $matched_tax_rates, $args ) {
393
  function maybe_exclude_vat() {
@@ -396,7 +399,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
396
  ! empty( WC()->customer ) &&
397
  'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) &&
398
  'yes' === get_option( 'wcj_eu_vat_number_disable_for_valid', 'yes' ) &&
399
- isset( $_SESSION['wcj_is_eu_vat_number_valid'] ) && true === $_SESSION['wcj_is_eu_vat_number_valid'] && isset( $_SESSION['wcj_eu_vat_number_to_check'] )
400
  ) {
401
  $preserve_base_country_check_passed = true;
402
  if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_eu_vat_number_preserve_in_base_country', 'no' ) ) ) {
@@ -404,7 +407,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
404
  if ( empty( $location['country'] ) ) {
405
  $location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
406
  }
407
- $selected_country = substr( $_SESSION['wcj_eu_vat_number_to_check'], 0, 2 );
408
  if ( 'EL' === $selected_country ) {
409
  $selected_country = 'GR';
410
  }
@@ -431,6 +434,8 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
431
 
432
  /**
433
  * checkout_validate_vat.
 
 
434
  */
435
  function checkout_validate_vat( $_posted ) {
436
  if ( 'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) ) {
@@ -439,8 +444,8 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
439
  (
440
  ( '' != $_posted['billing_eu_vat_number'] ) &&
441
  (
442
- ! isset( $_SESSION['wcj_is_eu_vat_number_valid'] ) || false == $_SESSION['wcj_is_eu_vat_number_valid'] ||
443
- ! isset( $_SESSION['wcj_eu_vat_number_to_check'] ) || $_posted['billing_eu_vat_number'] != $_SESSION['wcj_eu_vat_number_to_check']
444
  )
445
  )
446
  ) {
@@ -481,7 +486,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
481
  function add_eu_vat_number_checkout_field_to_frontend( $fields ) {
482
  $fields['billing'][ 'billing_' . $this->id ] = array(
483
  'type' => 'text',
484
- // 'default' => isset( $_SESSION['wcj_eu_vat_number_to_check'] ) ? $_SESSION['wcj_eu_vat_number_to_check'] : '',
485
  'label' => get_option( 'wcj_eu_vat_number_field_label' ),
486
  'description' => get_option( 'wcj_eu_vat_number_field_description' ),
487
  'placeholder' => get_option( 'wcj_eu_vat_number_field_placeholder' ),
2
  /**
3
  * Booster for WooCommerce - Module - EU VAT Number
4
  *
5
+ * @version 3.4.0
6
  * @since 2.3.9
7
  * @author Algoritmika Ltd.
8
+ * @todo clean up
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit;
287
 
288
  /**
289
  * add_default_checkout_billing_eu_vat_number.
290
+ *
291
+ * @version 3.4.0
292
  */
293
  function add_default_checkout_billing_eu_vat_number( $default_value, $field_key ) {
294
+ if ( null !== ( $eu_vat_number_to_check = wcj_session_get( 'wcj_eu_vat_number_to_check' ) ) ) {
295
+ return $eu_vat_number_to_check;
296
  } elseif ( is_user_logged_in() ) {
297
  $current_user = wp_get_current_user();
298
  if ( $meta = get_user_meta( $current_user->ID, 'billing_eu_vat_number', true ) ) {
315
 
316
  /**
317
  * start_session.
318
+ *
319
+ * @version 3.4.0
320
  */
321
  function start_session() {
322
+ wcj_session_maybe_start();
 
 
323
  $args = array();
324
  if ( isset( $_POST['post_data'] ) ) {
325
  parse_str( $_POST['post_data'], $args );
326
+ if ( isset( $args['billing_eu_vat_number'] ) && wcj_session_get( 'wcj_eu_vat_number_to_check' ) != $args['billing_eu_vat_number'] ) {
327
+ wcj_session_set( 'wcj_is_eu_vat_number_valid', null );
328
+ wcj_session_set( 'wcj_eu_vat_number_to_check', null );
329
  }
330
  }
331
  }
333
  /**
334
  * enqueue_scripts.
335
  *
336
+ * @version 3.4.0
337
  */
338
  function enqueue_scripts() {
339
  if ( 'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) ) {
341
  wp_localize_script( 'wcj-eu-vat-number', 'ajax_object', array(
342
  'ajax_url' => admin_url( 'admin-ajax.php' ),
343
  'add_progress_text' => get_option( 'wcj_eu_vat_number_add_progress_text', 'no' ),
344
+ 'progress_text_validating' => do_shortcode( get_option( 'wcj_eu_vat_number_progress_text_validating', __( 'Validating VAT. Please wait...', 'woocommerce-jetpack' ) ) ),
345
+ 'progress_text_valid' => do_shortcode( get_option( 'wcj_eu_vat_number_progress_text_valid', __( 'VAT is valid.', 'woocommerce-jetpack' ) ) ),
346
+ 'progress_text_not_valid' => do_shortcode( get_option( 'wcj_eu_vat_number_progress_text_not_valid', __( 'VAT is not valid.', 'woocommerce-jetpack' ) ) ),
347
+ 'progress_text_validation_failed' => do_shortcode( get_option( 'wcj_eu_vat_number_progress_text_validation_failed', __( 'Validation failed. Please try again.', 'woocommerce-jetpack' ) ) ),
348
  ) );
349
  }
350
  }
352
  /**
353
  * wcj_validate_eu_vat_number.
354
  *
355
+ * @version 3.4.0
356
  */
357
  function wcj_validate_eu_vat_number( $param ) {
358
  // if ( ! isset( $_GET['wcj_validate_eu_vat_number'] ) ) return;
373
  } else {
374
  $is_valid = null;
375
  }
376
+ wcj_session_set( 'wcj_is_eu_vat_number_valid', $is_valid );
377
+ wcj_session_set( 'wcj_eu_vat_number_to_check', $_POST['wcj_eu_vat_number_to_check'] );
378
  if ( false === $is_valid ) {
379
  echo '0';
380
  } elseif ( true === $is_valid ) {
390
  /**
391
  * maybe_exclude_vat.
392
  *
393
+ * @version 3.4.0
394
  */
395
  // function maybe_exclude_vat( $matched_tax_rates, $args ) {
396
  function maybe_exclude_vat() {
399
  ! empty( WC()->customer ) &&
400
  'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) &&
401
  'yes' === get_option( 'wcj_eu_vat_number_disable_for_valid', 'yes' ) &&
402
+ true === wcj_session_get( 'wcj_is_eu_vat_number_valid' ) && null !== wcj_session_get( 'wcj_eu_vat_number_to_check' )
403
  ) {
404
  $preserve_base_country_check_passed = true;
405
  if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_eu_vat_number_preserve_in_base_country', 'no' ) ) ) {
407
  if ( empty( $location['country'] ) ) {
408
  $location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
409
  }
410
+ $selected_country = substr( wcj_session_get( 'wcj_eu_vat_number_to_check' ), 0, 2 );
411
  if ( 'EL' === $selected_country ) {
412
  $selected_country = 'GR';
413
  }
434
 
435
  /**
436
  * checkout_validate_vat.
437
+ *
438
+ * @version 3.4.0
439
  */
440
  function checkout_validate_vat( $_posted ) {
441
  if ( 'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) ) {
444
  (
445
  ( '' != $_posted['billing_eu_vat_number'] ) &&
446
  (
447
+ null === wcj_session_get( 'wcj_is_eu_vat_number_valid' ) || false == wcj_session_get( 'wcj_is_eu_vat_number_valid' ) ||
448
+ null === wcj_session_get( 'wcj_eu_vat_number_to_check' ) || $_posted['billing_eu_vat_number'] != wcj_session_get( 'wcj_eu_vat_number_to_check' )
449
  )
450
  )
451
  ) {
486
  function add_eu_vat_number_checkout_field_to_frontend( $fields ) {
487
  $fields['billing'][ 'billing_' . $this->id ] = array(
488
  'type' => 'text',
489
+ // 'default' => ( null !== ( $eu_vat_number_to_check = wcj_session_get( 'wcj_eu_vat_number_to_check' ) ) ? $eu_vat_number_to_check : '' ),
490
  'label' => get_option( 'wcj_eu_vat_number_field_label' ),
491
  'description' => get_option( 'wcj_eu_vat_number_field_description' ),
492
  'placeholder' => get_option( 'wcj_eu_vat_number_field_placeholder' ),
includes/class-wcj-multicurrency.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Multicurrency (Currency Switcher)
4
  *
5
- * @version 3.2.2
6
  * @since 2.4.3
7
  * @author Algoritmika Ltd.
8
  */
@@ -51,16 +51,14 @@ class WCJ_Multicurrency extends WCJ_Module {
51
  /**
52
  * add_hooks.
53
  *
54
- * @version 3.2.2
55
  * @todo (maybe) replace all `PHP_INT_MAX - 1` with `$this->price_hooks_priority` (especially for `woocommerce_currency_symbol` and `woocommerce_currency`)
56
  */
57
  function add_hooks() {
58
  // Session
59
- if ( ! session_id() ) {
60
- session_start();
61
- }
62
  if ( isset( $_REQUEST['wcj-currency'] ) ) {
63
- $_SESSION['wcj-currency'] = $_REQUEST['wcj-currency'];
64
  }
65
  if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
66
  // Prices - Compatibility - "WooCommerce TM Extra Product Options" plugin
@@ -272,11 +270,11 @@ class WCJ_Multicurrency extends WCJ_Module {
272
  /**
273
  * get_current_currency_code.
274
  *
275
- * @version 2.5.5
276
  */
277
  function get_current_currency_code( $default_currency = '' ) {
278
- if ( isset( $_SESSION['wcj-currency'] ) ) {
279
- return $_SESSION['wcj-currency'];
280
  } else {
281
  $module_roles = get_option( 'wcj_multicurrency_role_defaults_roles', '' );
282
  if ( ! empty( $module_roles ) ) {
2
  /**
3
  * Booster for WooCommerce - Module - Multicurrency (Currency Switcher)
4
  *
5
+ * @version 3.4.0
6
  * @since 2.4.3
7
  * @author Algoritmika Ltd.
8
  */
51
  /**
52
  * add_hooks.
53
  *
54
+ * @version 3.4.0
55
  * @todo (maybe) replace all `PHP_INT_MAX - 1` with `$this->price_hooks_priority` (especially for `woocommerce_currency_symbol` and `woocommerce_currency`)
56
  */
57
  function add_hooks() {
58
  // Session
59
+ wcj_session_maybe_start();
 
 
60
  if ( isset( $_REQUEST['wcj-currency'] ) ) {
61
+ wcj_session_set( 'wcj-currency', $_REQUEST['wcj-currency'] );
62
  }
63
  if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
64
  // Prices - Compatibility - "WooCommerce TM Extra Product Options" plugin
270
  /**
271
  * get_current_currency_code.
272
  *
273
+ * @version 3.4.0
274
  */
275
  function get_current_currency_code( $default_currency = '' ) {
276
+ if ( null !== ( $session_value = wcj_session_get( 'wcj-currency' ) ) ) {
277
+ return $session_value;
278
  } else {
279
  $module_roles = get_option( 'wcj_multicurrency_role_defaults_roles', '' );
280
  if ( ! empty( $module_roles ) ) {
includes/class-wcj-my-account.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - My Account
4
  *
5
- * @version 2.9.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ class WCJ_My_Account extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 2.9.0
20
  * @since 2.9.0
21
  */
22
  function __construct() {
@@ -31,6 +31,38 @@ class WCJ_My_Account extends WCJ_Module {
31
  add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'maybe_add_my_account_order_actions' ), 10, 2 );
32
  add_action( 'wp_footer', array( $this, 'maybe_add_js_conformation' ) );
33
  add_action( 'init', array( $this, 'process_woocommerce_mark_order_status' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
  }
36
 
2
  /**
3
  * Booster for WooCommerce - Module - My Account
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 2.9.0
21
  */
22
  function __construct() {
31
  add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'maybe_add_my_account_order_actions' ), 10, 2 );
32
  add_action( 'wp_footer', array( $this, 'maybe_add_js_conformation' ) );
33
  add_action( 'init', array( $this, 'process_woocommerce_mark_order_status' ) );
34
+ // Custom info
35
+ if ( 'yes' === get_option( 'wcj_my_account_custom_info_enabled', 'no' ) ) {
36
+ $total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_my_account_custom_info_total_number', 1 ) );
37
+ for ( $i = 1; $i <= $total_number; $i++ ) {
38
+ add_action(
39
+ get_option( 'wcj_my_account_custom_info_hook_' . $i, 'woocommerce_account_dashboard' ),
40
+ array( $this, 'add_my_account_custom_info' ),
41
+ get_option( 'wcj_my_account_custom_info_priority_' . $i, 10 )
42
+ );
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ /**
49
+ * add_my_account_custom_info.
50
+ *
51
+ * @version 3.4.0
52
+ * @since 3.4.0
53
+ */
54
+ function add_my_account_custom_info() {
55
+ $current_filter = current_filter();
56
+ $current_filter_priority = wcj_current_filter_priority();
57
+ $total_number = apply_filters( 'booster_option', 1, get_option( 'wcj_my_account_custom_info_total_number', 1 ) );
58
+ for ( $i = 1; $i <= $total_number; $i++ ) {
59
+ if (
60
+ '' != get_option( 'wcj_my_account_custom_info_content_' . $i ) &&
61
+ $current_filter === get_option( 'wcj_my_account_custom_info_hook_' . $i, 'woocommerce_account_dashboard' ) &&
62
+ $current_filter_priority == get_option( 'wcj_my_account_custom_info_priority_' . $i, 10 )
63
+ ) {
64
+ echo do_shortcode( get_option( 'wcj_my_account_custom_info_content_' . $i ) );
65
+ }
66
  }
67
  }
68
 
includes/class-wcj-order-numbers.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Order Numbers
4
  *
5
- * @version 3.3.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -253,7 +253,7 @@ class WCJ_Order_Numbers extends WCJ_Module {
253
  /**
254
  * Add/update order_number meta to order.
255
  *
256
- * @version 3.3.0
257
  */
258
  function add_order_number_meta( $order_id, $do_overwrite ) {
259
  if ( 'shop_order' !== get_post_type( $order_id ) || 'auto-draft' === get_post_status( $order_id ) ) {
@@ -268,7 +268,7 @@ class WCJ_Order_Numbers extends WCJ_Module {
268
  if ( NULL != $result_select ) {
269
  $current_order_number = $this->maybe_reset_sequential_counter( $result_select->option_value, $order_id );
270
  $result_update = $wpdb->update( $wp_options_table, array( 'option_value' => ( $current_order_number + 1 ) ), array( 'option_name' => 'wcj_order_number_counter' ) );
271
- if ( NULL != $result_update ) {
272
  $wpdb->query( 'COMMIT' ); // all ok
273
  update_post_meta( $order_id, '_wcj_order_number', $current_order_number );
274
  } else {
2
  /**
3
  * Booster for WooCommerce - Module - Order Numbers
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
253
  /**
254
  * Add/update order_number meta to order.
255
  *
256
+ * @version 3.4.0
257
  */
258
  function add_order_number_meta( $order_id, $do_overwrite ) {
259
  if ( 'shop_order' !== get_post_type( $order_id ) || 'auto-draft' === get_post_status( $order_id ) ) {
268
  if ( NULL != $result_select ) {
269
  $current_order_number = $this->maybe_reset_sequential_counter( $result_select->option_value, $order_id );
270
  $result_update = $wpdb->update( $wp_options_table, array( 'option_value' => ( $current_order_number + 1 ) ), array( 'option_name' => 'wcj_order_number_counter' ) );
271
+ if ( NULL != $result_update || $result_select->option_value == ( $current_order_number + 1 ) ) {
272
  $wpdb->query( 'COMMIT' ); // all ok
273
  update_post_meta( $order_id, '_wcj_order_number', $current_order_number );
274
  } else {
includes/class-wcj-orders.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Orders
4
  *
5
- * @version 3.3.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -15,7 +15,7 @@ class WCJ_Orders extends WCJ_Module {
15
  /**
16
  * Constructor.
17
  *
18
- * @version 3.3.0
19
  * @todo Bulk Regenerate Download Permissions - copy "cron" to plugin
20
  * @todo Bulk Regenerate Download Permissions - maybe move "bulk actions" to free
21
  * @todo Bulk Regenerate Download Permissions - maybe as new module
@@ -24,7 +24,7 @@ class WCJ_Orders extends WCJ_Module {
24
 
25
  $this->id = 'orders';
26
  $this->short_desc = __( 'Orders', 'woocommerce-jetpack' );
27
- $this->desc = __( 'WooCommerce orders auto-complete; admin order currency; bulk regenerate download permissions for orders.', 'woocommerce-jetpack' );
28
  $this->link_slug = 'woocommerce-orders';
29
  parent::__construct();
30
 
@@ -72,9 +72,60 @@ class WCJ_Orders extends WCJ_Module {
72
  add_action( 'add_meta_boxes', array( $this, 'add_country_by_ip_meta_box' ) );
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  }
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  * add_country_by_ip_meta_box.
80
  *
2
  /**
3
  * Booster for WooCommerce - Module - Orders
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
15
  /**
16
  * Constructor.
17
  *
18
+ * @version 3.4.0
19
  * @todo Bulk Regenerate Download Permissions - copy "cron" to plugin
20
  * @todo Bulk Regenerate Download Permissions - maybe move "bulk actions" to free
21
  * @todo Bulk Regenerate Download Permissions - maybe as new module
24
 
25
  $this->id = 'orders';
26
  $this->short_desc = __( 'Orders', 'woocommerce-jetpack' );
27
+ $this->desc = __( 'WooCommerce orders auto-complete; admin order currency; admin order navigation; bulk regenerate download permissions for orders.', 'woocommerce-jetpack' );
28
  $this->link_slug = 'woocommerce-orders';
29
  parent::__construct();
30
 
72
  add_action( 'add_meta_boxes', array( $this, 'add_country_by_ip_meta_box' ) );
73
  }
74
 
75
+ // Orders navigation
76
+ if ( 'yes' === get_option( 'wcj_orders_navigation_enabled', 'no' ) ) {
77
+ add_action( 'add_meta_boxes', array( $this, 'add_orders_navigation_meta_box' ) );
78
+ add_action( 'admin_init', array( $this, 'handle_orders_navigation' ) );
79
+ }
80
+
81
+ }
82
+ }
83
+
84
+ /**
85
+ * handle_orders_navigation.
86
+ *
87
+ * @version 3.4.0
88
+ * @since 3.4.0
89
+ */
90
+ function handle_orders_navigation() {
91
+ if ( isset( $_GET['wcj_orders_navigation'] ) ) {
92
+ $url = ( ! isset( $_GET['post'] ) || false === ( $adjacent_order_id = wcj_get_adjacent_order_id( $_GET['post'], $_GET['wcj_orders_navigation'] ) ) ?
93
+ remove_query_arg( 'wcj_orders_navigation' ) :
94
+ admin_url( 'post.php?post=' . $adjacent_order_id . '&action=edit' ) );
95
+ wp_safe_redirect( $url );
96
+ exit;
97
  }
98
  }
99
 
100
+ /**
101
+ * add_orders_navigation_meta_box.
102
+ *
103
+ * @version 3.4.0
104
+ * @since 3.4.0
105
+ */
106
+ function add_orders_navigation_meta_box() {
107
+ add_meta_box(
108
+ 'wc-jetpack-' . $this->id . '-navigation',
109
+ __( 'Booster', 'woocommerce-jetpack' ) . ': ' . __( 'Order Navigation', 'woocommerce-jetpack' ),
110
+ array( $this, 'create_orders_navigation_meta_box' ),
111
+ 'shop_order',
112
+ 'side',
113
+ 'high'
114
+ );
115
+ }
116
+
117
+ /**
118
+ * create_orders_navigation_meta_box.
119
+ *
120
+ * @version 3.4.0
121
+ * @since 3.4.0
122
+ * @todo this will output the link, even if there no prev/next orders available
123
+ */
124
+ function create_orders_navigation_meta_box() {
125
+ echo '<a href="' . add_query_arg( 'wcj_orders_navigation', 'prev' ) . '">' . '&lt;&lt; ' . __( 'Previous order', 'woocommerce-jetpack' ) . '</a>' .
126
+ '<a href="' . add_query_arg( 'wcj_orders_navigation', 'next' ) . '" style="float:right;">' . __( 'Next order', 'woocommerce-jetpack' ) . ' &gt;&gt;' . '</a>';
127
+ }
128
+
129
  /**
130
  * add_country_by_ip_meta_box.
131
  *
includes/class-wcj-payment-gateways-by-country.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Payment Gateways by Country
4
  *
5
- * @version 3.3.0
6
  * @since 2.4.1
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,13 +16,13 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 2.8.0
20
  */
21
  function __construct() {
22
 
23
  $this->id = 'payment_gateways_by_country';
24
- $this->short_desc = __( 'Gateways by Country or State', 'woocommerce-jetpack' );
25
- $this->desc = __( 'Set countries or states to include/exclude for WooCommerce payment gateways to show up.', 'woocommerce-jetpack' );
26
  $this->link_slug = 'woocommerce-payment-gateways-by-country-or-state';
27
  parent::__construct();
28
 
@@ -31,17 +31,79 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
31
  }
32
  }
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  /**
35
  * available_payment_gateways.
36
  *
37
- * @version 3.3.0
 
 
 
 
 
38
  * @todo (maybe) add option to detect customer's country by IP (instead of `wcj_customer_get_country()`); probably won't work with states though...
39
  */
40
  function available_payment_gateways( $_available_gateways ) {
41
- if ( isset( WC()->customer ) ) {
42
- $customer_country = wcj_customer_get_country();
43
- $customer_state = ( WCJ_IS_WC_VERSION_BELOW_3 ) ? WC()->customer->get_state() : WC()->customer->get_billing_state();
44
- foreach ( $_available_gateways as $key => $gateway ) {
 
45
  $include_countries = get_option( 'wcj_gateways_countries_include_' . $key, '' );
46
  if ( ! empty( $include_countries ) && ! in_array( $customer_country, $include_countries ) ) {
47
  unset( $_available_gateways[ $key ] );
@@ -52,6 +114,8 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
52
  unset( $_available_gateways[ $key ] );
53
  continue;
54
  }
 
 
55
  $include_states = get_option( 'wcj_gateways_states_include_' . $key, '' );
56
  if ( ! empty( $include_states ) && ! in_array( $customer_state, $include_states ) ) {
57
  unset( $_available_gateways[ $key ] );
@@ -63,6 +127,24 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
63
  continue;
64
  }
65
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
  return $_available_gateways;
68
  }
2
  /**
3
  * Booster for WooCommerce - Module - Payment Gateways by Country
4
  *
5
+ * @version 3.4.0
6
  * @since 2.4.1
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  */
21
  function __construct() {
22
 
23
  $this->id = 'payment_gateways_by_country';
24
+ $this->short_desc = __( 'Gateways by Country, State or Postcode', 'woocommerce-jetpack' );
25
+ $this->desc = __( 'Set countries, states or postcodes to include/exclude for WooCommerce payment gateways to show up.', 'woocommerce-jetpack' );
26
  $this->link_slug = 'woocommerce-payment-gateways-by-country-or-state';
27
  parent::__construct();
28
 
31
  }
32
  }
33
 
34
+ /**
35
+ * get_location.
36
+ *
37
+ * @version 3.4.0
38
+ * @since 3.4.0
39
+ */
40
+ function get_location( $type ) {
41
+ switch ( $type ) {
42
+ case 'country':
43
+ return ( isset( WC()->customer ) ? wcj_customer_get_country() : '' );
44
+ case 'state':
45
+ return ( isset( WC()->customer ) ? ( WCJ_IS_WC_VERSION_BELOW_3 ? WC()->customer->get_state() : WC()->customer->get_billing_state() ) : '' );
46
+ case 'postcode':
47
+ $postcode = '';
48
+ if ( isset( $_REQUEST['postcode'] ) && 'billing' === get_option( 'wcj_gateways_by_location_postcodes_type', 'billing' ) ) {
49
+ $postcode = $_REQUEST['postcode'];
50
+ } elseif ( isset( $_REQUEST['s_postcode'] ) && 'shipping' === get_option( 'wcj_gateways_by_location_postcodes_type', 'billing' ) ) {
51
+ $postcode = $_REQUEST['s_postcode'];
52
+ }
53
+ if ( '' == $postcode ) {
54
+ $postcode = WC()->countries->get_base_postcode();
55
+ }
56
+ return strtoupper( $postcode );
57
+ }
58
+ }
59
+
60
+ /**
61
+ * range_match.
62
+ *
63
+ * @version 3.4.0
64
+ * @since 3.4.0
65
+ */
66
+ function range_match( $postcode_range, $postcode_to_check ) {
67
+ $postcode_range = explode( '...', $postcode_range );
68
+ return ( 2 === count( $postcode_range ) && $postcode_to_check >= $postcode_range[0] && $postcode_to_check <= $postcode_range[1] );
69
+ }
70
+
71
+ /**
72
+ * check_postcode.
73
+ *
74
+ * @version 3.4.0
75
+ * @since 3.4.0
76
+ */
77
+ function check_postcode( $postcode_to_check, $postcodes ) {
78
+ foreach ( $postcodes as $postcode ) {
79
+ if (
80
+ ( false !== strpos( $postcode, '*' ) && fnmatch( $postcode, $postcode_to_check ) ) ||
81
+ ( false !== strpos( $postcode, '...' ) && $this->range_match( $postcode, $postcode_to_check ) ) ||
82
+ ( $postcode === $postcode_to_check )
83
+ ) {
84
+ return true;
85
+ }
86
+ }
87
+ return false;
88
+ }
89
+
90
  /**
91
  * available_payment_gateways.
92
  *
93
+ * @version 3.4.0
94
+ * @todo (maybe) rename module to "Payment Gateways by (Customer's) Location"
95
+ * @todo (maybe) check naming, should be `wcj_gateways_by_location_` (however it's too long...)
96
+ * @todo (maybe) code refactoring
97
+ * @todo (maybe) add more locations options (e.g. "... by city")
98
+ * @todo (maybe) add option to detect customer's country and state by current `$_REQUEST` (as it is now done with postcodes)
99
  * @todo (maybe) add option to detect customer's country by IP (instead of `wcj_customer_get_country()`); probably won't work with states though...
100
  */
101
  function available_payment_gateways( $_available_gateways ) {
102
+ $customer_country = $this->get_location( 'country' );
103
+ $customer_state = $this->get_location( 'state' );
104
+ $postcode = $this->get_location( 'postcode' );
105
+ foreach ( $_available_gateways as $key => $gateway ) {
106
+ if ( '' != $customer_country ) {
107
  $include_countries = get_option( 'wcj_gateways_countries_include_' . $key, '' );
108
  if ( ! empty( $include_countries ) && ! in_array( $customer_country, $include_countries ) ) {
109
  unset( $_available_gateways[ $key ] );
114
  unset( $_available_gateways[ $key ] );
115
  continue;
116
  }
117
+ }
118
+ if ( '' != $customer_state ) {
119
  $include_states = get_option( 'wcj_gateways_states_include_' . $key, '' );
120
  if ( ! empty( $include_states ) && ! in_array( $customer_state, $include_states ) ) {
121
  unset( $_available_gateways[ $key ] );
127
  continue;
128
  }
129
  }
130
+ if ( '' != $postcode ) {
131
+ $include_postcodes = get_option( 'wcj_gateways_postcodes_include_' . $key, '' );
132
+ if ( ! empty( $include_postcodes ) ) {
133
+ $include_postcodes = array_filter( array_map( 'strtoupper', array_map( 'wc_clean', explode( "\n", $include_postcodes ) ) ) );
134
+ if ( ! $this->check_postcode( $postcode, $include_postcodes ) ) {
135
+ unset( $_available_gateways[ $key ] );
136
+ continue;
137
+ }
138
+ }
139
+ $exclude_postcodes = get_option( 'wcj_gateways_postcodes_exclude_' . $key, '' );
140
+ if ( ! empty( $exclude_postcodes ) ) {
141
+ $exclude_postcodes = array_filter( array_map( 'strtoupper', array_map( 'wc_clean', explode( "\n", $exclude_postcodes ) ) ) );
142
+ if ( $this->check_postcode( $postcode, $exclude_postcodes ) ) {
143
+ unset( $_available_gateways[ $key ] );
144
+ continue;
145
+ }
146
+ }
147
+ }
148
  }
149
  return $_available_gateways;
150
  }
includes/class-wcj-pdf-invoicing.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - PDF Invoicing
4
  *
5
- * @version 3.3.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -327,18 +327,18 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
327
  /**
328
  * catch_args.
329
  *
330
- * @version 2.5.0
331
  */
332
  function catch_args() {
333
- $this->order_id = ( isset( $_GET['order_id'] ) ) ? $_GET['order_id'] : 0;
334
- $this->invoice_type_id = ( isset( $_GET['invoice_type_id'] ) ) ? $_GET['invoice_type_id'] : '';
335
- $this->save_as_pdf = ( isset( $_GET['save_pdf_invoice'] ) && '1' == $_GET['save_pdf_invoice'] ) ? true : false;
336
- $this->get_invoice = ( isset( $_GET['get_invoice'] ) && '1' == $_GET['get_invoice'] ) ? true : false;
337
 
338
- if ( isset( $_GET['create_invoice_for_order_id'] ) && ( wcj_is_user_role( 'administrator' ) || is_shop_manager() ) ) {
339
  $this->create_document( $_GET['create_invoice_for_order_id'], $this->invoice_type_id );
340
  }
341
- if ( isset( $_GET['delete_invoice_for_order_id'] ) && ( wcj_is_user_role( 'administrator' ) || is_shop_manager() ) ) {
342
  $this->delete_document( $_GET['delete_invoice_for_order_id'], $this->invoice_type_id );
343
  }
344
  }
@@ -346,13 +346,12 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
346
  /**
347
  * check_user_roles.
348
  *
349
- * @version 2.9.0
350
  * @since 2.9.0
351
- * @todo apply user role checking to other actions - create etc.
352
  * @todo check if `current_user_can( 'administrator' )` is the same as checking role directly
353
  */
354
- function check_user_roles() {
355
- if ( get_current_user_id() == intval( get_post_meta( $this->order_id, '_customer_user', true ) ) ) {
356
  return true;
357
  }
358
  $allowed_user_roles = get_option( 'wcj_invoicing_' . $this->invoice_type_id . '_roles', array( 'administrator', 'shop_manager' ) );
2
  /**
3
  * Booster for WooCommerce - Module - PDF Invoicing
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
327
  /**
328
  * catch_args.
329
  *
330
+ * @version 3.4.0
331
  */
332
  function catch_args() {
333
+ $this->order_id = ( isset( $_GET['order_id'] ) ) ? $_GET['order_id'] : 0;
334
+ $this->invoice_type_id = ( isset( $_GET['invoice_type_id'] ) ) ? $_GET['invoice_type_id'] : '';
335
+ $this->save_as_pdf = ( isset( $_GET['save_pdf_invoice'] ) && '1' == $_GET['save_pdf_invoice'] );
336
+ $this->get_invoice = ( isset( $_GET['get_invoice'] ) && '1' == $_GET['get_invoice'] );
337
 
338
+ if ( isset( $_GET['create_invoice_for_order_id'] ) && $this->check_user_roles( false ) ) {
339
  $this->create_document( $_GET['create_invoice_for_order_id'], $this->invoice_type_id );
340
  }
341
+ if ( isset( $_GET['delete_invoice_for_order_id'] ) && $this->check_user_roles( false ) ) {
342
  $this->delete_document( $_GET['delete_invoice_for_order_id'], $this->invoice_type_id );
343
  }
344
  }
346
  /**
347
  * check_user_roles.
348
  *
349
+ * @version 3.4.0
350
  * @since 2.9.0
 
351
  * @todo check if `current_user_can( 'administrator' )` is the same as checking role directly
352
  */
353
+ function check_user_roles( $allow_order_owner = true ) {
354
+ if ( $allow_order_owner && get_current_user_id() == intval( get_post_meta( $this->order_id, '_customer_user', true ) ) ) {
355
  return true;
356
  }
357
  $allowed_user_roles = get_option( 'wcj_invoicing_' . $this->invoice_type_id . '_roles', array( 'administrator', 'shop_manager' ) );
includes/class-wcj-price-by-user-role.php CHANGED
@@ -112,7 +112,7 @@ class WCJ_Price_By_User_Role extends WCJ_Module {
112
  }
113
  ?><div class="error"><p><?php
114
  echo '<div class="message">'
115
- . __( 'Booster: Free plugin\'s version is limited to only one price by user role per products settings product enabled at a time. You will need to get <a href="http://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of price by user role per product settings products.', 'woocommerce-jetpack' )
116
  . '</div>';
117
  ?></p></div><?php
118
  }
112
  }
113
  ?><div class="error"><p><?php
114
  echo '<div class="message">'
115
+ . __( 'Booster: Free plugin\'s version is limited to only one price by user role per products settings product enabled at a time. You will need to get <a href="https://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of price by user role per product settings products.', 'woocommerce-jetpack' )
116
  . '</div>';
117
  ?></p></div><?php
118
  }
includes/class-wcj-product-add-to-cart.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Product Add To Cart
4
  *
5
- * @version 3.3.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -330,7 +330,7 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
330
  /*
331
  * maybe_redirect_to_url.
332
  *
333
- * @version 2.9.0
334
  */
335
  function maybe_redirect_to_url( $url, $product_id = false ) {
336
  if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_add_to_cart_redirect_per_product_enabled', 'no' ) ) && ( $product_id || isset( $_REQUEST['add-to-cart'] ) ) ) {
@@ -340,7 +340,7 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
340
  if ( 'yes' === get_post_meta( $product_id, '_' . 'wcj_add_to_cart_redirect_enabled', true ) ) {
341
  $redirect_url = get_post_meta( $product_id, '_' . 'wcj_add_to_cart_redirect_url', true );
342
  if ( '' === $redirect_url ) {
343
- $redirect_url = WC()->cart->get_checkout_url();
344
  }
345
  return $redirect_url;
346
  }
@@ -348,7 +348,7 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
348
  if ( 'yes' === get_option( 'wcj_add_to_cart_redirect_enabled', 'no' ) ) {
349
  $redirect_url = get_option( 'wcj_add_to_cart_redirect_url', '' );
350
  if ( '' === $redirect_url ) {
351
- $redirect_url = WC()->cart->get_checkout_url();
352
  }
353
  return $redirect_url;
354
  }
2
  /**
3
  * Booster for WooCommerce - Module - Product Add To Cart
4
  *
5
+ * @version 3.4.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  */
330
  /*
331
  * maybe_redirect_to_url.
332
  *
333
+ * @version 3.4.0
334
  */
335
  function maybe_redirect_to_url( $url, $product_id = false ) {
336
  if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_add_to_cart_redirect_per_product_enabled', 'no' ) ) && ( $product_id || isset( $_REQUEST['add-to-cart'] ) ) ) {
340
  if ( 'yes' === get_post_meta( $product_id, '_' . 'wcj_add_to_cart_redirect_enabled', true ) ) {
341
  $redirect_url = get_post_meta( $product_id, '_' . 'wcj_add_to_cart_redirect_url', true );
342
  if ( '' === $redirect_url ) {
343
+ $redirect_url = wc_get_checkout_url();
344
  }
345
  return $redirect_url;
346
  }
348
  if ( 'yes' === get_option( 'wcj_add_to_cart_redirect_enabled', 'no' ) ) {
349
  $redirect_url = get_option( 'wcj_add_to_cart_redirect_url', '' );
350
  if ( '' === $redirect_url ) {
351
+ $redirect_url = wc_get_checkout_url();
352
  }
353
  return $redirect_url;
354
  }
includes/class-wcj-product-addons.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Product Addons
4
  *
5
- * @version 3.3.0
6
  * @since 2.5.3
7
  * @author Algoritmika Ltd.
8
  * @todo admin order view (names);
@@ -17,7 +17,7 @@ class WCJ_Product_Addons extends WCJ_Module {
17
  /**
18
  * Constructor.
19
  *
20
- * @version 3.3.0
21
  * @since 2.5.3
22
  * @todo (maybe) add "in progress" ajax message
23
  * @todo (maybe) for variable products - show addons only if variation is selected (e.g. move to addons from `woocommerce_before_add_to_cart_button` to variation description)
@@ -59,7 +59,11 @@ class WCJ_Product_Addons extends WCJ_Module {
59
  // Show details at cart, order details, emails
60
  add_filter( 'woocommerce_cart_item_name', array( $this, 'add_info_to_cart_item_name' ), PHP_INT_MAX, 3 );
61
  add_filter( 'woocommerce_order_item_name', array( $this, 'add_info_to_order_item_name' ), PHP_INT_MAX, 2 );
62
- add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_info_to_order_item_meta' ), PHP_INT_MAX, 3 );
 
 
 
 
63
  }
64
  if ( is_admin() ) {
65
  if ( 'yes' === get_option( 'wcj_product_addons_hide_on_admin_order_page', 'no' ) ) {
@@ -175,7 +179,7 @@ class WCJ_Product_Addons extends WCJ_Module {
175
  * @since 2.5.3
176
  */
177
  function get_the_notice() {
178
- return __( 'Booster: Free plugin\'s version is limited to only three products with per product addons enabled at a time. You will need to get <a href="http://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of products with per product addons.', 'woocommerce-jetpack' );
179
  }
180
 
181
  /**
@@ -276,7 +280,7 @@ class WCJ_Product_Addons extends WCJ_Module {
276
  /**
277
  * get_product_addons.
278
  *
279
- * @version 3.3.0
280
  * @since 2.5.3
281
  * @todo (maybe) `checkbox_key` is mislabelled, should be `key` (or maybe `value_key`)
282
  */
@@ -303,6 +307,7 @@ class WCJ_Product_Addons extends WCJ_Module {
303
  'label_value' => get_option( 'wcj_product_addons_all_products_label_' . $i ),
304
  'title' => get_option( 'wcj_product_addons_all_products_title_' . $i, '' ),
305
  'placeholder' => get_option( 'wcj_product_addons_all_products_placeholder_' . $i, '' ),
 
306
  'tooltip' => get_option( 'wcj_product_addons_all_products_tooltip_' . $i, '' ),
307
  'type' => get_option( 'wcj_product_addons_all_products_type_' . $i, 'checkbox' ),
308
  'default' => get_option( 'wcj_product_addons_all_products_default_' . $i, '' ),
@@ -331,6 +336,7 @@ class WCJ_Product_Addons extends WCJ_Module {
331
  'label_value' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_label_' . $i, true ),
332
  'title' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_title_' . $i, true ),
333
  'placeholder' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_placeholder_' . $i, true ),
 
334
  'tooltip' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_tooltip_' . $i, true ),
335
  'type' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_type_' . $i, true ),
336
  'default' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_default_' . $i, true ),
@@ -344,6 +350,19 @@ class WCJ_Product_Addons extends WCJ_Module {
344
  return $addons;
345
  }
346
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  /**
348
  * add_info_to_order_item_meta.
349
  *
@@ -488,16 +507,19 @@ class WCJ_Product_Addons extends WCJ_Module {
488
  /**
489
  * add_addons_to_frontend.
490
  *
491
- * @version 3.2.2
492
  * @since 2.5.3
493
  */
494
  function add_addons_to_frontend() {
495
- $html = '';
496
- $addons = $this->get_product_addons( get_the_ID() );
497
  $_product = wc_get_product( get_the_ID() );
498
  foreach ( $addons as $addon ) {
499
  if ( '' != $addon['title'] ) {
500
- $html .= '<p>' .'<label for="' . $addon['checkbox_key'] . '">' . $addon['title'] . '</label>' . '</p>';
 
 
 
501
  }
502
  $is_required = ( 'yes' === $addon['is_required'] ) ? ' required' : '';
503
  if ( 'checkbox' === $addon['type'] || '' == $addon['type'] ) {
@@ -510,21 +532,27 @@ class WCJ_Product_Addons extends WCJ_Module {
510
  $maybe_tooltip = ( '' != $addon['tooltip'] ) ?
511
  ' <img style="display:inline;" class="wcj-question-icon" src="' . wcj_plugin_url() . '/assets/images/question-icon.png' . '" title="' . $addon['tooltip'] . '">' :
512
  '';
513
- $html .= '<p>' .
514
- '<input type="checkbox" id="' . $addon['checkbox_key'] . '" name="' . $addon['checkbox_key'] . '"' . $is_checked . $is_required . '>' . ' ' .
515
- '<label for="' . $addon['checkbox_key'] . '">' . $addon['label_value'] . ' ('. wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $addon['price_value'] ) ) ) . ')' . '</label>' .
516
- $maybe_tooltip .
517
- '</p>';
 
 
 
518
  } elseif ( 'text' == $addon['type'] ) {
519
  $default_value = ( isset( $_POST[ $addon['checkbox_key'] ] ) ? $_POST[ $addon['checkbox_key'] ] : $addon['default'] );
520
  $maybe_tooltip = ( '' != $addon['tooltip'] ) ?
521
  ' <img style="display:inline;" class="wcj-question-icon" src="' . wcj_plugin_url() . '/assets/images/question-icon.png' . '" title="' . $addon['tooltip'] . '">' :
522
  '';
523
- $html .= '<p>' .
524
- '<label for="' . $addon['checkbox_key'] . '">' . $addon['label_value'] . ' ('. wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $addon['price_value'] ) ) ) . ')' . '</label>' . ' ' .
525
- '<input type="text" id="' . $addon['checkbox_key'] . '" name="' . $addon['checkbox_key'] . '" placeholder="' . $addon['placeholder'] . '" value="' . $default_value . '"' . $is_required . '>' .
526
- $maybe_tooltip .
527
- '</p>';
 
 
 
528
  } elseif ( 'radio' === $addon['type'] || 'select' === $addon['type'] ) {
529
  $prices = explode( PHP_EOL, $addon['price_value'] );
530
  $labels = explode( PHP_EOL, $addon['label_value'] );
@@ -548,11 +576,14 @@ class WCJ_Product_Addons extends WCJ_Module {
548
  $maybe_tooltip = ( isset( $tooltips[ $i ] ) && '' != $tooltips[ $i ] ) ?
549
  ' <img style="display:inline;" class="wcj-question-icon" src="' . wcj_plugin_url() . '/assets/images/question-icon.png' . '" title="' . $tooltips[ $i ] . '">' :
550
  '';
551
- $html .= '<p>' .
552
- '<input type="radio" id="' . $addon['checkbox_key'] . '-' . $label . '" name="' . $addon['checkbox_key'] . '" value="' . $label . '"' . $is_checked . $is_required . '>' . ' ' .
553
- '<label for="' . $addon['checkbox_key'] . '-' . $label . '">' . $labels[ $i ] . ' ('. wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $prices[ $i ] ) ) ) . ')' . '</label>' .
554
- $maybe_tooltip .
555
- '</p>';
 
 
 
556
  } else {
557
  $select_options .= '<option value="' . $label . '"' . $is_checked . '>' . $labels[ $i ] . ' ('. wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $prices[ $i ] ) ) ) . ')' . '</option>';
558
  }
@@ -564,17 +595,19 @@ class WCJ_Product_Addons extends WCJ_Module {
564
  if ( '' != $addon['placeholder'] ) {
565
  $select_options = '<option value="">' . $addon['placeholder'] . '</option>' . $select_options;
566
  }
567
- $html .= '<p>' .
568
- '<select' . $is_required . ' id="' . $addon['checkbox_key'] . '" name="' . $addon['checkbox_key'] . '">' . $select_options . '</select>' .
569
- $maybe_tooltip .
570
- '</p>';
571
  }
572
  }
573
  }
574
  }
575
  // Output
576
  if ( ! empty( $html ) ) {
577
- echo '<div id="wcj_product_addons">' . $html . '</div>';
 
 
578
  }
579
  }
580
 
2
  /**
3
  * Booster for WooCommerce - Module - Product Addons
4
  *
5
+ * @version 3.4.0
6
  * @since 2.5.3
7
  * @author Algoritmika Ltd.
8
  * @todo admin order view (names);
17
  /**
18
  * Constructor.
19
  *
20
+ * @version 3.4.0
21
  * @since 2.5.3
22
  * @todo (maybe) add "in progress" ajax message
23
  * @todo (maybe) for variable products - show addons only if variation is selected (e.g. move to addons from `woocommerce_before_add_to_cart_button` to variation description)
59
  // Show details at cart, order details, emails
60
  add_filter( 'woocommerce_cart_item_name', array( $this, 'add_info_to_cart_item_name' ), PHP_INT_MAX, 3 );
61
  add_filter( 'woocommerce_order_item_name', array( $this, 'add_info_to_order_item_name' ), PHP_INT_MAX, 2 );
62
+ if ( WCJ_IS_WC_VERSION_BELOW_3 ) {
63
+ add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_info_to_order_item_meta' ), PHP_INT_MAX, 3 );
64
+ } else {
65
+ add_action( 'woocommerce_new_order_item', array( $this, 'add_info_to_order_item_meta_wc3' ), PHP_INT_MAX, 3 );
66
+ }
67
  }
68
  if ( is_admin() ) {
69
  if ( 'yes' === get_option( 'wcj_product_addons_hide_on_admin_order_page', 'no' ) ) {
179
  * @since 2.5.3
180
  */
181
  function get_the_notice() {
182
+ return __( 'Booster: Free plugin\'s version is limited to only three products with per product addons enabled at a time. You will need to get <a href="https://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of products with per product addons.', 'woocommerce-jetpack' );
183
  }
184
 
185
  /**
280
  /**
281
  * get_product_addons.
282
  *
283
+ * @version 3.4.0
284
  * @since 2.5.3
285
  * @todo (maybe) `checkbox_key` is mislabelled, should be `key` (or maybe `value_key`)
286
  */
307
  'label_value' => get_option( 'wcj_product_addons_all_products_label_' . $i ),
308
  'title' => get_option( 'wcj_product_addons_all_products_title_' . $i, '' ),
309
  'placeholder' => get_option( 'wcj_product_addons_all_products_placeholder_' . $i, '' ),
310
+ 'class' => get_option( 'wcj_product_addons_all_products_class_' . $i, '' ),
311
  'tooltip' => get_option( 'wcj_product_addons_all_products_tooltip_' . $i, '' ),
312
  'type' => get_option( 'wcj_product_addons_all_products_type_' . $i, 'checkbox' ),
313
  'default' => get_option( 'wcj_product_addons_all_products_default_' . $i, '' ),
336
  'label_value' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_label_' . $i, true ),
337
  'title' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_title_' . $i, true ),
338
  'placeholder' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_placeholder_' . $i, true ),
339
+ 'class' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_class_' . $i, true ),
340
  'tooltip' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_tooltip_' . $i, true ),
341
  'type' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_type_' . $i, true ),
342
  'default' => get_post_meta( $product_id, '_' . 'wcj_product_addons_per_product_default_' . $i, true ),
350
  return $addons;
351
  }
352
 
353
+ /**
354
+ * add_info_to_order_item_meta_wc3.
355
+ *
356
+ * @version 3.4.0
357
+ * @since 3.4.0
358
+ * @todo this is only a temporary solution: must replace `$item->legacy_values` (check "Bookings" module)
359
+ */
360
+ function add_info_to_order_item_meta_wc3( $item_id, $item, $order_id ) {
361
+ if ( is_a( $item, 'WC_Order_Item_Product' ) ) {
362
+ $this->add_info_to_order_item_meta( $item_id, $item->legacy_values, null );
363
+ }
364
+ }
365
+
366
  /**
367
  * add_info_to_order_item_meta.
368
  *
507
  /**
508
  * add_addons_to_frontend.
509
  *
510
+ * @version 3.4.0
511
  * @since 2.5.3
512
  */
513
  function add_addons_to_frontend() {
514
+ $html = '';
515
+ $addons = $this->get_product_addons( get_the_ID() );
516
  $_product = wc_get_product( get_the_ID() );
517
  foreach ( $addons as $addon ) {
518
  if ( '' != $addon['title'] ) {
519
+ $html .= wcj_handle_replacements( array(
520
+ '%addon_id%' => $addon['checkbox_key'],
521
+ '%addon_title%' => $addon['title'],
522
+ ), get_option( 'wcj_product_addons_template_title', '<p><label for="%addon_id%">%addon_title%</label></p>' ) );
523
  }
524
  $is_required = ( 'yes' === $addon['is_required'] ) ? ' required' : '';
525
  if ( 'checkbox' === $addon['type'] || '' == $addon['type'] ) {
532
  $maybe_tooltip = ( '' != $addon['tooltip'] ) ?
533
  ' <img style="display:inline;" class="wcj-question-icon" src="' . wcj_plugin_url() . '/assets/images/question-icon.png' . '" title="' . $addon['tooltip'] . '">' :
534
  '';
535
+ $html .= wcj_handle_replacements( array(
536
+ '%addon_input%' => '<input type="checkbox" id="' . $addon['checkbox_key'] . '" class="' . $addon['class'] . '" name="' . $addon['checkbox_key'] . '"' . $is_checked . $is_required . '>',
537
+ '%addon_id%' => $addon['checkbox_key'],
538
+ '%addon_label%' => $addon['label_value'],
539
+ '%addon_price%' => wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $addon['price_value'] ) ) ),
540
+ '%addon_tooltip%' => $maybe_tooltip,
541
+ ), get_option( 'wcj_product_addons_template_type_checkbox',
542
+ '<p>%addon_input% <label for="%addon_id%">%addon_label% (%addon_price%)</label>%addon_tooltip%</p>' ) );
543
  } elseif ( 'text' == $addon['type'] ) {
544
  $default_value = ( isset( $_POST[ $addon['checkbox_key'] ] ) ? $_POST[ $addon['checkbox_key'] ] : $addon['default'] );
545
  $maybe_tooltip = ( '' != $addon['tooltip'] ) ?
546
  ' <img style="display:inline;" class="wcj-question-icon" src="' . wcj_plugin_url() . '/assets/images/question-icon.png' . '" title="' . $addon['tooltip'] . '">' :
547
  '';
548
+ $html .= wcj_handle_replacements( array(
549
+ '%addon_input%' => '<input type="text" id="' . $addon['checkbox_key'] . '" class="' . $addon['class'] . '" name="' . $addon['checkbox_key'] . '" placeholder="' . $addon['placeholder'] . '" value="' . $default_value . '"' . $is_required . '>',
550
+ '%addon_id%' => $addon['checkbox_key'],
551
+ '%addon_label%' => $addon['label_value'],
552
+ '%addon_price%' => wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $addon['price_value'] ) ) ),
553
+ '%addon_tooltip%' => $maybe_tooltip,
554
+ ), get_option( 'wcj_product_addons_template_type_text',
555
+ '<p><label for="%addon_id%">%addon_label% (%addon_price%)</label> %addon_input%%addon_tooltip%</p>' ) );
556
  } elseif ( 'radio' === $addon['type'] || 'select' === $addon['type'] ) {
557
  $prices = explode( PHP_EOL, $addon['price_value'] );
558
  $labels = explode( PHP_EOL, $addon['label_value'] );
576
  $maybe_tooltip = ( isset( $tooltips[ $i ] ) && '' != $tooltips[ $i ] ) ?
577
  ' <img style="display:inline;" class="wcj-question-icon" src="' . wcj_plugin_url() . '/assets/images/question-icon.png' . '" title="' . $tooltips[ $i ] . '">' :
578
  '';
579
+ $html .= wcj_handle_replacements( array(
580
+ '%addon_input%' => '<input type="radio" id="' . $addon['checkbox_key'] . '-' . $label . '" class="' . $addon['class'] . '" name="' . $addon['checkbox_key'] . '" value="' . $label . '"' . $is_checked . $is_required . '>',
581
+ '%addon_id%' => $addon['checkbox_key'] . '-' . $label,
582
+ '%addon_label%' => $labels[ $i ],
583
+ '%addon_price%' => wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $prices[ $i ] ) ) ),
584
+ '%addon_tooltip%' => $maybe_tooltip,
585
+ ), get_option( 'wcj_product_addons_template_type_radio',
586
+ '<p>%addon_input% <label for="%addon_id%">%addon_label% (%addon_price%)</label>%addon_tooltip%</p>' ) );
587
  } else {
588
  $select_options .= '<option value="' . $label . '"' . $is_checked . '>' . $labels[ $i ] . ' ('. wc_price( wcj_get_product_display_price( $_product, $this->maybe_convert_currency( $prices[ $i ] ) ) ) . ')' . '</option>';
589
  }
595
  if ( '' != $addon['placeholder'] ) {
596
  $select_options = '<option value="">' . $addon['placeholder'] . '</option>' . $select_options;
597
  }
598
+ $html .= wcj_handle_replacements( array(
599
+ '%addon_input%' => '<select' . $is_required . ' id="' . $addon['checkbox_key'] . '" class="' . $addon['class'] . '" name="' . $addon['checkbox_key'] . '">' . $select_options . '</select>',
600
+ '%addon_tooltip%' => $maybe_tooltip,
601
+ ), get_option( 'wcj_product_addons_template_type_select', '<p>%addon_input%%addon_tooltip%</p>' ) );
602
  }
603
  }
604
  }
605
  }
606
  // Output
607
  if ( ! empty( $html ) ) {
608
+ echo wcj_handle_replacements( array(
609
+ '%addons_html%' => $html,
610
+ ), get_option( 'wcj_product_addons_template_final', '<div id="wcj_product_addons">%addons_html%</div>' ) );
611
  }
612
  }
613
 
includes/class-wcj-product-bookings.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Bookings
4
  *
5
- * @version 3.2.4
6
  * @since 2.5.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ class WCJ_Product_Bookings extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 2.8.0
20
  * @since 2.5.0
21
  */
22
  function __construct() {
@@ -56,7 +56,11 @@ class WCJ_Product_Bookings extends WCJ_Module {
56
  // Show details at cart, order details, emails
57
  add_filter( 'woocommerce_cart_item_name', array( $this, 'add_info_to_cart_item_name' ), PHP_INT_MAX, 3 );
58
  add_filter( 'woocommerce_order_item_name', array( $this, 'add_info_to_order_item_name' ), PHP_INT_MAX, 2 );
59
- add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_info_to_order_item_meta' ), PHP_INT_MAX, 3 );
 
 
 
 
60
  // Hide quantity
61
  if ( 'yes' === get_option( 'wcj_product_bookings_hide_quantity', 'yes' ) ) {
62
  add_filter( 'woocommerce_is_sold_individually', array( $this, 'sold_individually' ), PHP_INT_MAX, 2 );
@@ -154,6 +158,21 @@ class WCJ_Product_Bookings extends WCJ_Module {
154
  return ( $this->is_bookings_product( $_product ) ) ? get_permalink( wcj_get_product_id_or_variation_parent_id( $_product ) ) : $url;
155
  }
156
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  /**
158
  * add_info_to_order_item_meta.
159
  *
@@ -391,7 +410,7 @@ class WCJ_Product_Bookings extends WCJ_Module {
391
  }
392
  ?><div class="error"><p><?php
393
  echo '<div class="message">'
394
- . __( 'Booster: Free plugin\'s version is limited to only one bookings product enabled at a time. You will need to get <a href="http://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of bookings products.', 'woocommerce-jetpack' )
395
  . '</div>';
396
  ?></p></div><?php
397
  }
2
  /**
3
  * Booster for WooCommerce - Module - Bookings
4
  *
5
+ * @version 3.4.0
6
  * @since 2.5.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 2.5.0
21
  */
22
  function __construct() {
56
  // Show details at cart, order details, emails
57
  add_filter( 'woocommerce_cart_item_name', array( $this, 'add_info_to_cart_item_name' ), PHP_INT_MAX, 3 );
58
  add_filter( 'woocommerce_order_item_name', array( $this, 'add_info_to_order_item_name' ), PHP_INT_MAX, 2 );
59
+ if ( WCJ_IS_WC_VERSION_BELOW_3 ) {
60
+ add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_info_to_order_item_meta' ), PHP_INT_MAX, 3 );
61
+ } else {
62
+ add_action( 'woocommerce_checkout_create_order_line_item', array( $this, 'add_info_to_order_item_meta_wc3' ), PHP_INT_MAX, 4 );
63
+ }
64
  // Hide quantity
65
  if ( 'yes' === get_option( 'wcj_product_bookings_hide_quantity', 'yes' ) ) {
66
  add_filter( 'woocommerce_is_sold_individually', array( $this, 'sold_individually' ), PHP_INT_MAX, 2 );
158
  return ( $this->is_bookings_product( $_product ) ) ? get_permalink( wcj_get_product_id_or_variation_parent_id( $_product ) ) : $url;
159
  }
160
 
161
+ /**
162
+ * add_info_to_order_item_meta_wc3.
163
+ *
164
+ * @version 3.4.0
165
+ * @since 3.4.0
166
+ */
167
+ function add_info_to_order_item_meta_wc3( $item, $cart_item_key, $values, $order ) {
168
+ $meta_keys = array( 'wcj_bookings_price', 'wcj_bookings_date_from', 'wcj_bookings_date_to' );
169
+ foreach ( $meta_keys as $meta_key ) {
170
+ if ( isset( $values[ $meta_key ] ) ) {
171
+ $item[ '_' . $meta_key ] = $values[ $meta_key ];
172
+ }
173
+ }
174
+ }
175
+
176
  /**
177
  * add_info_to_order_item_meta.
178
  *
410
  }
411
  ?><div class="error"><p><?php
412
  echo '<div class="message">'
413
+ . __( 'Booster: Free plugin\'s version is limited to only one bookings product enabled at a time. You will need to get <a href="https://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of bookings products.', 'woocommerce-jetpack' )
414
  . '</div>';
415
  ?></p></div><?php
416
  }
includes/class-wcj-product-by-date.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Product Availability by Date
4
  *
5
- * @version 2.9.1
6
  * @since 2.9.1
7
  * @author Algoritmika Ltd.
8
  */
@@ -57,7 +57,7 @@ class WCJ_Product_By_Date extends WCJ_Module {
57
  * get_default_date.
58
  *
59
  * @version 2.9.1
60
- * @version 2.9.1
61
  */
62
  function get_default_date( $i ) {
63
  $date_defaults = array(
@@ -77,33 +77,51 @@ class WCJ_Product_By_Date extends WCJ_Module {
77
  return $date_defaults[ $i - 1 ];
78
  }
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  /**
81
  * maybe_add_unavailable_by_date_message.
82
  *
83
- * @version 2.9.1
84
- * @version 2.9.1
85
  */
86
  function maybe_add_unavailable_by_date_message() {
87
  $_product = wc_get_product();
88
  if ( ! $this->check_is_purchasable_by_date( true, $_product ) ) {
89
- $_date = $this->get_product_availability_this_month( $_product );
90
- $replaceable_values = array(
91
- '%date_this_month%' => $_date,
92
- '%product_title%' => $_product->get_title(),
93
- );
94
- $message = ( ( '-' === $_date ) ?
95
- apply_filters( 'booster_option', __( '<p style="color:red;">%product_title% is not available this month.</p>', 'woocommerce-jetpack' ),
96
- get_option( 'wcj_product_by_date_unavailable_message_month_off',
97
- __( '<p style="color:red;">%product_title% is not available this month.</p>', 'woocommerce-jetpack' ) ) ) :
98
- apply_filters( 'booster_option', __( '<p style="color:red;">%product_title% is available only on %date_this_month% this month.</p>', 'woocommerce-jetpack' ),
99
- get_option( 'wcj_product_by_date_unavailable_message',
100
- __( '<p style="color:red;">%product_title% is available only on %date_this_month% this month.</p>', 'woocommerce-jetpack' ) ) )
101
- );
102
- echo str_replace(
103
- array_keys( $replaceable_values ),
104
- array_values( $replaceable_values ),
105
- do_shortcode( $message )
106
- );
 
 
 
 
107
  }
108
  }
109
 
@@ -111,7 +129,7 @@ class WCJ_Product_By_Date extends WCJ_Module {
111
  * get_product_availability_this_month.
112
  *
113
  * @version 2.9.1
114
- * @version 2.9.1
115
  */
116
  function get_product_availability_this_month( $_product ) {
117
  $product_id = wcj_get_product_id_or_variation_parent_id( $_product );
@@ -127,19 +145,23 @@ class WCJ_Product_By_Date extends WCJ_Module {
127
  /**
128
  * check_is_purchasable_by_date.
129
  *
130
- * @version 2.9.1
131
- * @version 2.9.1
132
  * @todo validate `wcj_product_by_date_` option before checking (or even better earlier, when option is saved by admin)
133
  */
134
  function check_is_purchasable_by_date( $purchasable, $_product ) {
135
  if ( $purchasable ) {
136
- $_date = $this->get_product_availability_this_month( $_product );
137
- if ( '-' === $_date ) {
138
- return false;
139
- } elseif ( '' == $_date ) {
140
- return true;
141
  } else {
142
- return wcj_check_date( $_date, array( 'day_now' => $this->day_now ) );
 
 
 
 
 
 
 
143
  }
144
  }
145
  return $purchasable;
2
  /**
3
  * Booster for WooCommerce - Module - Product Availability by Date
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.1
7
  * @author Algoritmika Ltd.
8
  */
57
  * get_default_date.
58
  *
59
  * @version 2.9.1
60
+ * @since 2.9.1
61
  */
62
  function get_default_date( $i ) {
63
  $date_defaults = array(
77
  return $date_defaults[ $i - 1 ];
78
  }
79
 
80
+ /**
81
+ * maybe_get_direct_date.
82
+ *
83
+ * @version 3.4.0
84
+ * @since 3.4.0
85
+ */
86
+ function maybe_get_direct_date( $product_id ) {
87
+ return (
88
+ 'yes' === get_option( 'wcj_product_by_date_per_product_enabled', 'no' ) &&
89
+ 'yes' === get_post_meta( $product_id, '_' . 'wcj_product_by_date_enabled', true ) &&
90
+ '' != ( $direct_date = get_post_meta( $product_id, '_' . 'wcj_product_by_date_direct_date', true ) )
91
+ ) ? $direct_date : false;
92
+ }
93
+
94
  /**
95
  * maybe_add_unavailable_by_date_message.
96
  *
97
+ * @version 3.4.0
98
+ * @since 2.9.1
99
  */
100
  function maybe_add_unavailable_by_date_message() {
101
  $_product = wc_get_product();
102
  if ( ! $this->check_is_purchasable_by_date( true, $_product ) ) {
103
+ if ( false !== ( $direct_date = $this->maybe_get_direct_date( wcj_get_product_id_or_variation_parent_id( $_product ) ) ) ) {
104
+ $replaceable_values = array(
105
+ '%direct_date%' => $direct_date,
106
+ );
107
+ $message = get_option( 'wcj_product_by_date_unavailable_message_direct_date',
108
+ '<p style="color:red;">' . __( '%product_title% is not available until %direct_date%.', 'woocommerce-jetpack' ) . '</p>' );
109
+ } else {
110
+ $_date = $this->get_product_availability_this_month( $_product );
111
+ $replaceable_values = array(
112
+ '%date_this_month%' => $_date,
113
+ );
114
+ $message = ( ( '-' === $_date ) ?
115
+ apply_filters( 'booster_option', __( '<p style="color:red;">%product_title% is not available this month.</p>', 'woocommerce-jetpack' ),
116
+ get_option( 'wcj_product_by_date_unavailable_message_month_off',
117
+ __( '<p style="color:red;">%product_title% is not available this month.</p>', 'woocommerce-jetpack' ) ) ) :
118
+ apply_filters( 'booster_option', __( '<p style="color:red;">%product_title% is available only on %date_this_month% this month.</p>', 'woocommerce-jetpack' ),
119
+ get_option( 'wcj_product_by_date_unavailable_message',
120
+ __( '<p style="color:red;">%product_title% is available only on %date_this_month% this month.</p>', 'woocommerce-jetpack' ) ) )
121
+ );
122
+ }
123
+ $replaceable_values['%product_title%'] = $_product->get_title();
124
+ echo str_replace( array_keys( $replaceable_values ), $replaceable_values, do_shortcode( $message ) );
125
  }
126
  }
127
 
129
  * get_product_availability_this_month.
130
  *
131
  * @version 2.9.1
132
+ * @since 2.9.1
133
  */
134
  function get_product_availability_this_month( $_product ) {
135
  $product_id = wcj_get_product_id_or_variation_parent_id( $_product );
145
  /**
146
  * check_is_purchasable_by_date.
147
  *
148
+ * @version 3.4.0
149
+ * @since 2.9.1
150
  * @todo validate `wcj_product_by_date_` option before checking (or even better earlier, when option is saved by admin)
151
  */
152
  function check_is_purchasable_by_date( $purchasable, $_product ) {
153
  if ( $purchasable ) {
154
+ if ( false !== ( $direct_date = $this->maybe_get_direct_date( wcj_get_product_id_or_variation_parent_id( $_product ) ) ) ) {
155
+ return ( $this->time_now >= strtotime( $direct_date ) );
 
 
 
156
  } else {
157
+ $_date = $this->get_product_availability_this_month( $_product );
158
+ if ( '-' === $_date ) {
159
+ return false;
160
+ } elseif ( '' == $_date ) {
161
+ return true;
162
+ } else {
163
+ return wcj_check_date( $_date, array( 'day_now' => $this->day_now ) );
164
+ }
165
  }
166
  }
167
  return $purchasable;
includes/class-wcj-product-info.php CHANGED
@@ -4,6 +4,7 @@
4
  *
5
  * @version 2.8.0
6
  * @author Algoritmika Ltd.
 
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -223,24 +224,6 @@ class WCJ_Product_Info extends WCJ_Module {
223
  return;
224
  }
225
 
226
- /* foreach ( $this->product_info_shortcodes_array as $product_info_short_code ) {
227
- if ( false !== strpos( $the_product_info, $product_info_short_code ) ) {
228
- // We found short code in the text
229
- $replace_with_phrase = $this->get_product_info_short_code( $product_info_short_code );
230
- if ( false === $replace_with_phrase && true === $remove_on_empty ) {
231
- // No phrase to replace exists, then empty the text and continue with next field
232
- $the_product_info = '';
233
- return;
234
- }
235
- else {
236
- if ( false === $replace_with_phrase ) $replace_with_phrase = '';
237
- // Replacing the short code
238
- $the_product_info = str_replace( $product_info_short_code, $replace_with_phrase, $the_product_info );
239
- }
240
- }
241
- } */
242
-
243
- //echo apply_filters( 'the_content', $the_product_info );
244
  echo do_shortcode( $the_product_info );
245
  }
246
 
4
  *
5
  * @version 2.8.0
6
  * @author Algoritmika Ltd.
7
+ * @deprecated
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
224
  return;
225
  }
226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  echo do_shortcode( $the_product_info );
228
  }
229
 
includes/class-wcj-product-open-pricing.php CHANGED
@@ -182,7 +182,7 @@ class WCJ_Product_Open_Pricing extends WCJ_Module {
182
  }
183
  ?><div class="error"><p><?php
184
  echo '<div class="message">'
185
- . __( 'Booster: Free plugin\'s version is limited to only one open pricing product enabled at a time. You will need to get <a href="http://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of open pricing products.', 'woocommerce-jetpack' )
186
  . '</div>';
187
  ?></p></div><?php
188
  }
182
  }
183
  ?><div class="error"><p><?php
184
  echo '<div class="message">'
185
+ . __( 'Booster: Free plugin\'s version is limited to only one open pricing product enabled at a time. You will need to get <a href="https://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of open pricing products.', 'woocommerce-jetpack' )
186
  . '</div>';
187
  ?></p></div><?php
188
  }
includes/class-wcj-product-price-by-formula.php CHANGED
@@ -85,7 +85,7 @@ class WCJ_Product_Price_by_Formula extends WCJ_Module {
85
  if ( 'woocommerce_get_price_including_tax' == $the_current_filter || 'woocommerce_get_price_excluding_tax' == $the_current_filter ) {
86
  return wcj_get_product_display_price( $_product );
87
  }
88
- $math = new /* PHPMathParser\ */Alg_Math();
89
  $math->registerVariable( 'x', $price );
90
  for ( $i = 1; $i <= $total_params; $i++ ) {
91
  $the_param = ( $is_per_product )
@@ -189,7 +189,7 @@ class WCJ_Product_Price_by_Formula extends WCJ_Module {
189
  }
190
  ?><div class="error"><p><?php
191
  echo '<div class="message">'
192
- . __( 'Booster: Free plugin\'s version is limited to only one price by formula product enabled at a time. You will need to get <a href="http://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of price by formula products.', 'woocommerce-jetpack' )
193
  . '</div>';
194
  ?></p></div><?php
195
  }
85
  if ( 'woocommerce_get_price_including_tax' == $the_current_filter || 'woocommerce_get_price_excluding_tax' == $the_current_filter ) {
86
  return wcj_get_product_display_price( $_product );
87
  }
88
+ $math = new WCJ_Math();
89
  $math->registerVariable( 'x', $price );
90
  for ( $i = 1; $i <= $total_params; $i++ ) {
91
  $the_param = ( $is_per_product )
189
  }
190
  ?><div class="error"><p><?php
191
  echo '<div class="message">'
192
+ . __( 'Booster: Free plugin\'s version is limited to only one price by formula product enabled at a time. You will need to get <a href="https://booster.io/plus/" target="_blank">Booster Plus</a> to add unlimited number of price by formula products.', 'woocommerce-jetpack' )
193
  . '</div>';
194
  ?></p></div><?php
195
  }
includes/class-wcj-product-tabs.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Product Tabs
4
  *
5
- * @version 3.2.4
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -467,21 +467,19 @@ class WCJ_Product_Tabs extends WCJ_Module {
467
  /**
468
  * create_new_custom_product_tab_local.
469
  *
470
- * @version 3.1.0
471
- * @todo (maybe) replace `the_content` with `do_shortcode`
472
  */
473
  function create_new_custom_product_tab_local( $key, $tab ) {
474
- echo apply_filters( 'the_content', get_post_meta( get_the_ID(), '_' . 'wcj_custom_product_tabs_content_' . $this->tab_option_keys['local'][ $key ], true ) );
475
  }
476
 
477
  /**
478
  * create_new_custom_product_tab_global.
479
  *
480
- * @version 3.1.0
481
- * @todo (maybe) replace `the_content` with `do_shortcode`
482
  */
483
  function create_new_custom_product_tab_global( $key, $tab ) {
484
- echo apply_filters( 'the_content', get_option( 'wcj_custom_product_tabs_content_' . $this->tab_option_keys['global'][ $key ] ) );
485
  }
486
 
487
  /**
2
  /**
3
  * Booster for WooCommerce - Module - Product Tabs
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
467
  /**
468
  * create_new_custom_product_tab_local.
469
  *
470
+ * @version 3.4.0
 
471
  */
472
  function create_new_custom_product_tab_local( $key, $tab ) {
473
+ echo do_shortcode( get_post_meta( get_the_ID(), '_' . 'wcj_custom_product_tabs_content_' . $this->tab_option_keys['local'][ $key ], true ) );
474
  }
475
 
476
  /**
477
  * create_new_custom_product_tab_global.
478
  *
479
+ * @version 3.4.0
 
480
  */
481
  function create_new_custom_product_tab_global( $key, $tab ) {
482
+ echo do_shortcode( get_option( 'wcj_custom_product_tabs_content_' . $this->tab_option_keys['global'][ $key ] ) );
483
  }
484
 
485
  /**
includes/class-wcj-shipping-calculator.php CHANGED
@@ -45,7 +45,7 @@ class WCJ_Shipping_Calculator extends WCJ_Module {
45
  if ( function_exists( 'is_cart' ) && is_cart() ) {
46
  wp_enqueue_style( 'wcj-shipping-calculator', wcj_plugin_url() . '/includes/css/wcj-shipping-calculator.css', array(), WCJ()->version );
47
  wp_enqueue_script( 'wcj-shipping-calculator-js', wcj_plugin_url() . '/includes/js/wcj-shipping-calculator.js', array( 'jquery' ), WCJ()->version, true );
48
- wp_localize_script( 'wcj-shipping-calculator-js', 'alg_object', array(
49
  'calculate_shipping_label' => get_option( 'wcj_shipping_calculator_label_calculate_shipping', '' ),
50
  'update_totals_label' => get_option( 'wcj_shipping_calculator_label_update_totals', '' ),
51
  ) );
45
  if ( function_exists( 'is_cart' ) && is_cart() ) {
46
  wp_enqueue_style( 'wcj-shipping-calculator', wcj_plugin_url() . '/includes/css/wcj-shipping-calculator.css', array(), WCJ()->version );
47
  wp_enqueue_script( 'wcj-shipping-calculator-js', wcj_plugin_url() . '/includes/js/wcj-shipping-calculator.js', array( 'jquery' ), WCJ()->version, true );
48
+ wp_localize_script( 'wcj-shipping-calculator-js', 'wcj_object', array(
49
  'calculate_shipping_label' => get_option( 'wcj_shipping_calculator_label_calculate_shipping', '' ),
50
  'update_totals_label' => get_option( 'wcj_shipping_calculator_label_update_totals', '' ),
51
  ) );
includes/class-wcj-shipping-description.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Booster for WooCommerce - Module - Shipping Descriptions
4
+ *
5
+ * @version 3.4.0
6
+ * @since 3.4.0
7
+ * @author Algoritmika Ltd.
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
+
12
+ if ( ! class_exists( 'WCJ_Shipping_Descriptions' ) ) :
13
+
14
+ class WCJ_Shipping_Descriptions extends WCJ_Module {
15
+
16
+ /**
17
+ * Constructor.
18
+ *
19
+ * @version 3.4.0
20
+ * @since 3.4.0
21
+ */
22
+ function __construct() {
23
+
24
+ $this->id = 'shipping_description';
25
+ $this->short_desc = __( 'Shipping Descriptions', 'woocommerce-jetpack' );
26
+ $this->desc = __( 'Add descriptions to shipping methods on frontend.', 'woocommerce-jetpack' );
27
+ $this->link_slug = 'woocommerce-shipping-descriptions';
28
+ parent::__construct();
29
+
30
+ if ( $this->is_enabled() ) {
31
+ add_filter( 'woocommerce_cart_shipping_method_full_label', array( $this, 'shipping_description' ), PHP_INT_MAX, 2 );
32
+ }
33
+ }
34
+
35
+ /**
36
+ * shipping_description.
37
+ *
38
+ * @version 2.6.0
39
+ * @since 2.5.6
40
+ */
41
+ function shipping_description( $label, $method ) {
42
+ $shipping_descriptions_visibility = apply_filters( 'booster_option', 'both', get_option( 'wcj_shipping_descriptions_visibility', 'both' ) );
43
+ if ( 'checkout_only' === $shipping_descriptions_visibility && is_cart() ) {
44
+ return $label;
45
+ }
46
+ if ( 'cart_only' === $shipping_descriptions_visibility && is_checkout() ) {
47
+ return $label;
48
+ }
49
+ if ( '' != ( $desc = get_option( 'wcj_shipping_description_' . $method->method_id, '' ) ) ) {
50
+ $label .= $desc;
51
+ }
52
+ return $label;
53
+ }
54
+
55
+ }
56
+
57
+ endif;
58
+
59
+ return new WCJ_Shipping_Descriptions();
includes/class-wcj-shipping-icons.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Booster for WooCommerce - Module - Shipping Icons
4
+ *
5
+ * @version 3.4.0
6
+ * @since 3.4.0
7
+ * @author Algoritmika Ltd.
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
+
12
+ if ( ! class_exists( 'WCJ_Shipping_Icons' ) ) :
13
+
14
+ class WCJ_Shipping_Icons extends WCJ_Module {
15
+
16
+ /**
17
+ * Constructor.
18
+ *
19
+ * @version 3.4.0
20
+ * @since 3.4.0
21
+ */
22
+ function __construct() {
23
+
24
+ $this->id = 'shipping_icons';
25
+ $this->short_desc = __( 'Shipping Icons', 'woocommerce-jetpack' );
26
+ $this->desc = __( 'Add icons to shipping methods on frontend.', 'woocommerce-jetpack' );
27
+ $this->link_slug = 'woocommerce-shipping-icons';
28
+ parent::__construct();
29
+
30
+ if ( $this->is_enabled() ) {
31
+ add_filter( 'woocommerce_cart_shipping_method_full_label', array( $this, 'shipping_icon' ), PHP_INT_MAX, 2 );
32
+ }
33
+ }
34
+
35
+ /**
36
+ * shipping_icon.
37
+ *
38
+ * @version 2.6.0
39
+ * @since 2.5.6
40
+ */
41
+ function shipping_icon( $label, $method ) {
42
+ $shipping_icons_visibility = apply_filters( 'booster_option', 'both', get_option( 'wcj_shipping_icons_visibility', 'both' ) );
43
+ if ( 'checkout_only' === $shipping_icons_visibility && is_cart() ) {
44
+ return $label;
45
+ }
46
+ if ( 'cart_only' === $shipping_icons_visibility && is_checkout() ) {
47
+ return $label;
48
+ }
49
+ if ( '' != ( $icon_url = get_option( 'wcj_shipping_icon_' . $method->method_id, '' ) ) ) {
50
+ $style_html = ( '' != ( $style = get_option( 'wcj_shipping_icons_style', 'display:inline;' ) ) ) ? 'style="' . $style . '" ' : '';
51
+ $img = '<img ' . $style_html . 'class="wcj_shipping_icon" id="wcj_shipping_icon_' . $method->method_id . '" src="' . $icon_url . '">';
52
+ $label = ( 'before' === get_option( 'wcj_shipping_icons_position', 'before' ) ) ? $img . ' ' . $label : $label . ' ' . $img;
53
+ }
54
+ return $label;
55
+ }
56
+
57
+ }
58
+
59
+ endif;
60
+
61
+ return new WCJ_Shipping_Icons();
includes/class-wcj-shipping-options.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Shipping Options
4
  *
5
- * @version 3.2.4
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,17 +16,15 @@ class WCJ_Shipping_Options extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 3.2.4
20
  * @since 2.9.0
21
- * @todo (maybe) move "Display radio buttons instead of drop box for variable products" to new module(s)
22
- * @todo (maybe) remove (or at least mark ass deprecated) "Grant free shipping on per product basis" (offer to use "Shipping Methods by Products" module instead)
23
  */
24
  function __construct() {
25
 
26
  $this->id = 'shipping_options';
27
  $this->short_desc = __( 'Shipping Options', 'woocommerce-jetpack' );
28
- $this->desc = __( 'Add descriptions and icons to shipping methods on frontend.', 'woocommerce-jetpack') . ' ' .
29
- __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack') . ' ' .
30
  __( 'Grant free shipping on per product basis.', 'woocommerce-jetpack');
31
  $this->link_slug = 'woocommerce-shipping-options';
32
  parent::__construct();
@@ -40,16 +38,6 @@ class WCJ_Shipping_Options extends WCJ_Module {
40
  }
41
  add_filter( 'woocommerce_shipping_settings', array( $this, 'add_hide_shipping_if_free_available_fields' ), PHP_INT_MAX );
42
 
43
- // Shipping Descriptions
44
- if ( 'yes' === get_option( 'wcj_shipping_description_enabled', 'no' ) ) {
45
- add_filter( 'woocommerce_cart_shipping_method_full_label', array( $this, 'shipping_description' ), PHP_INT_MAX, 2 );
46
- }
47
-
48
- // Shipping Icons
49
- if ( 'yes' === get_option( 'wcj_shipping_icons_enabled', 'no' ) ) {
50
- add_filter( 'woocommerce_cart_shipping_method_full_label', array( $this, 'shipping_icon' ), PHP_INT_MAX, 2 );
51
- }
52
-
53
  // Free shipping by product
54
  if ( 'yes' === get_option( 'wcj_shipping_free_shipping_by_product_enabled', 'no' ) ) {
55
  add_filter( 'woocommerce_shipping_free_shipping_is_available', array( $this, 'free_shipping_by_product' ), PHP_INT_MAX, 2 );
@@ -87,48 +75,6 @@ class WCJ_Shipping_Options extends WCJ_Module {
87
  return ( $package_grants_free_shipping ) ? true : $is_available;
88
  }
89
 
90
- /**
91
- * shipping_icon.
92
- *
93
- * @version 2.6.0
94
- * @since 2.5.6
95
- */
96
- function shipping_icon( $label, $method ) {
97
- $shipping_icons_visibility = apply_filters( 'booster_option', 'both', get_option( 'wcj_shipping_icons_visibility', 'both' ) );
98
- if ( 'checkout_only' === $shipping_icons_visibility && is_cart() ) {
99
- return $label;
100
- }
101
- if ( 'cart_only' === $shipping_icons_visibility && is_checkout() ) {
102
- return $label;
103
- }
104
- if ( '' != ( $icon_url = get_option( 'wcj_shipping_icon_' . $method->method_id, '' ) ) ) {
105
- $style_html = ( '' != ( $style = get_option( 'wcj_shipping_icons_style', 'display:inline;' ) ) ) ? 'style="' . $style . '" ' : '';
106
- $img = '<img ' . $style_html . 'class="wcj_shipping_icon" id="wcj_shipping_icon_' . $method->method_id . '" src="' . $icon_url . '">';
107
- $label = ( 'before' === get_option( 'wcj_shipping_icons_position', 'before' ) ) ? $img . ' ' . $label : $label . ' ' . $img;
108
- }
109
- return $label;
110
- }
111
-
112
- /**
113
- * shipping_description.
114
- *
115
- * @version 2.6.0
116
- * @since 2.5.6
117
- */
118
- function shipping_description( $label, $method ) {
119
- $shipping_descriptions_visibility = apply_filters( 'booster_option', 'both', get_option( 'wcj_shipping_descriptions_visibility', 'both' ) );
120
- if ( 'checkout_only' === $shipping_descriptions_visibility && is_cart() ) {
121
- return $label;
122
- }
123
- if ( 'cart_only' === $shipping_descriptions_visibility && is_checkout() ) {
124
- return $label;
125
- }
126
- if ( '' != ( $desc = get_option( 'wcj_shipping_description_' . $method->method_id, '' ) ) ) {
127
- $label .= $desc;
128
- }
129
- return $label;
130
- }
131
-
132
  /**
133
  * hide_shipping_when_free_is_available.
134
  *
2
  /**
3
  * Booster for WooCommerce - Module - Shipping Options
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 2.9.0
21
+ * @todo (maybe) remove (or at least mark as deprecated) "Grant free shipping on per product basis" (offer to use "Shipping Methods by Products" module instead)
 
22
  */
23
  function __construct() {
24
 
25
  $this->id = 'shipping_options';
26
  $this->short_desc = __( 'Shipping Options', 'woocommerce-jetpack' );
27
+ $this->desc = __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack') . ' ' .
 
28
  __( 'Grant free shipping on per product basis.', 'woocommerce-jetpack');
29
  $this->link_slug = 'woocommerce-shipping-options';
30
  parent::__construct();
38
  }
39
  add_filter( 'woocommerce_shipping_settings', array( $this, 'add_hide_shipping_if_free_available_fields' ), PHP_INT_MAX );
40
 
 
 
 
 
 
 
 
 
 
 
41
  // Free shipping by product
42
  if ( 'yes' === get_option( 'wcj_shipping_free_shipping_by_product_enabled', 'no' ) ) {
43
  add_filter( 'woocommerce_shipping_free_shipping_is_available', array( $this, 'free_shipping_by_product' ), PHP_INT_MAX, 2 );
75
  return ( $package_grants_free_shipping ) ? true : $is_available;
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  /**
79
  * hide_shipping_when_free_is_available.
80
  *
includes/class-wcj-shipping.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Custom Shipping
4
  *
5
- * @version 2.9.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -15,7 +15,8 @@ class WCJ_Shipping extends WCJ_Module {
15
  /**
16
  * Constructor.
17
  *
18
- * @version 2.9.0
 
19
  */
20
  function __construct() {
21
 
@@ -26,13 +27,69 @@ class WCJ_Shipping extends WCJ_Module {
26
  parent::__construct();
27
 
28
  if ( $this->is_enabled() ) {
29
- include_once( 'shipping/class-wc-shipping-wcj-custom.php' );
 
 
 
 
30
  if ( 'yes' === get_option( 'wcj_shipping_custom_shipping_w_zones_enabled', 'no' ) ) {
31
- include_once( 'shipping/class-wc-shipping-wcj-custom-with-shipping-zones.php' );
32
  }
33
  }
34
  }
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
 
38
  endif;
2
  /**
3
  * Booster for WooCommerce - Module - Custom Shipping
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
15
  /**
16
  * Constructor.
17
  *
18
+ * @version 3.4.0
19
+ * @todo (maybe) deprecated "Custom Shipping (Legacy - without Shipping Zones)" - hide when disabled
20
  */
21
  function __construct() {
22
 
27
  parent::__construct();
28
 
29
  if ( $this->is_enabled() ) {
30
+
31
+ // Custom Shipping (Legacy - without Shipping Zones)
32
+ add_action( 'init', array( $this, 'init_wc_shipping_wcj_custom_class' ) );
33
+
34
+ // Custom Shipping
35
  if ( 'yes' === get_option( 'wcj_shipping_custom_shipping_w_zones_enabled', 'no' ) ) {
36
+ add_action( 'init', array( $this, 'init_wc_shipping_wcj_custom_w_zones_class' ) );
37
  }
38
  }
39
  }
40
 
41
+ /*
42
+ * init_wc_shipping_wcj_custom_class.
43
+ *
44
+ * @version 3.4.0
45
+ * @since 2.4.8
46
+ */
47
+ function init_wc_shipping_wcj_custom_class() {
48
+ if ( class_exists( 'WC_Shipping_Method' ) ) {
49
+ require_once( 'shipping/class-wc-shipping-wcj-custom.php' );
50
+ add_filter( 'woocommerce_shipping_methods', array( $this, 'add_wc_shipping_wcj_custom_class' ) );
51
+ }
52
+ }
53
+
54
+ /*
55
+ * add_wc_shipping_wcj_custom_class.
56
+ *
57
+ * @version 2.8.0
58
+ */
59
+ function add_wc_shipping_wcj_custom_class( $methods ) {
60
+ $total_number = get_option( 'wcj_shipping_custom_shipping_total_number', 1 );
61
+ for ( $i = 1; $i <= $total_number; $i++ ) {
62
+ $the_method = new WC_Shipping_WCJ_Custom_Template();
63
+ $the_method->init( $i );
64
+ $methods[ $the_method->id ] = $the_method;
65
+ }
66
+ return $methods;
67
+ }
68
+
69
+ /*
70
+ * init_wc_shipping_wcj_custom_w_zones_class.
71
+ *
72
+ * @version 3.4.0
73
+ * @since 2.5.6
74
+ */
75
+ function init_wc_shipping_wcj_custom_w_zones_class() {
76
+ if ( class_exists( 'WC_Shipping_Method' ) ) {
77
+ require_once( 'shipping/class-wc-shipping-wcj-custom-with-shipping-zones.php' );
78
+ add_filter( 'woocommerce_shipping_methods', array( $this, 'add_wc_shipping_wcj_custom_w_zones_class' ) );
79
+ }
80
+ }
81
+
82
+ /*
83
+ * add_wc_shipping_wcj_custom_w_zones_class.
84
+ *
85
+ * @version 2.5.6
86
+ * @since 2.5.6
87
+ */
88
+ function add_wc_shipping_wcj_custom_w_zones_class( $methods ) {
89
+ $methods[ 'booster_custom_shipping_w_zones' ] = 'WC_Shipping_WCJ_Custom_W_Zones';
90
+ return $methods;
91
+ }
92
+
93
  }
94
 
95
  endif;
includes/class-wcj-sku.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - SKU
4
  *
5
- * @version 3.2.3
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -15,7 +15,7 @@ class WCJ_SKU extends WCJ_Module {
15
  /**
16
  * Constructor.
17
  *
18
- * @version 3.1.3
19
  */
20
  function __construct() {
21
 
@@ -46,9 +46,16 @@ class WCJ_SKU extends WCJ_Module {
46
  if ( 'yes' === get_option( 'wcj_sku_add_to_customer_emails', 'no' ) ) {
47
  add_filter( 'woocommerce_email_order_items_args', array( $this, 'add_sku_to_customer_emails' ), PHP_INT_MAX, 1 );
48
  }
 
 
 
49
  // Search by SKU
50
  if ( 'yes' === get_option( 'wcj_sku_search_enabled', 'no' ) ) {
51
- add_filter( 'pre_get_posts', array( $this, 'add_search_by_sku_to_frontend' ), PHP_INT_MAX );
 
 
 
 
52
  }
53
  // Disable SKU
54
  if ( 'yes' === get_option( 'wcj_sku_disabled', 'no' ) ) {
@@ -57,14 +64,68 @@ class WCJ_SKU extends WCJ_Module {
57
  }
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  * add_sku_to_customer_emails.
62
  *
63
- * @version 2.5.5
64
  * @since 2.5.5
65
  */
66
  function add_sku_to_customer_emails( $args ) {
67
- $args['show_sku'] = true;
 
 
68
  return $args;
69
  }
70
 
2
  /**
3
  * Booster for WooCommerce - Module - SKU
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
15
  /**
16
  * Constructor.
17
  *
18
+ * @version 3.4.0
19
  */
20
  function __construct() {
21
 
46
  if ( 'yes' === get_option( 'wcj_sku_add_to_customer_emails', 'no' ) ) {
47
  add_filter( 'woocommerce_email_order_items_args', array( $this, 'add_sku_to_customer_emails' ), PHP_INT_MAX, 1 );
48
  }
49
+ if ( 'yes' === get_option( 'wcj_sku_remove_from_admin_emails', 'no' ) ) {
50
+ add_filter( 'woocommerce_email_order_items_args', array( $this, 'remove_sku_from_admin_emails' ), PHP_INT_MAX, 1 );
51
+ }
52
  // Search by SKU
53
  if ( 'yes' === get_option( 'wcj_sku_search_enabled', 'no' ) ) {
54
+ if ( 'pre_get_posts' === get_option( 'wcj_sku_search_hook', 'pre_get_posts' ) ) {
55
+ add_filter( 'pre_get_posts', array( $this, 'add_search_by_sku_to_frontend' ), PHP_INT_MAX );
56
+ } else { // 'posts_search'
57
+ add_filter( 'posts_search', array( $this, 'add_search_by_sku_to_frontend_posts_search' ), 9 );
58
+ }
59
  }
60
  // Disable SKU
61
  if ( 'yes' === get_option( 'wcj_sku_disabled', 'no' ) ) {
64
  }
65
  }
66
 
67
+ /**
68
+ * add_search_by_sku_to_frontend_posts_search.
69
+ *
70
+ * @version 3.4.0
71
+ * @since 3.4.0
72
+ * @see https://plugins.svn.wordpress.org/search-by-sku-for-woocommerce/
73
+ */
74
+ function add_search_by_sku_to_frontend_posts_search( $where ) {
75
+ global $pagenow, $wpdb, $wp;
76
+ if (
77
+ ( is_admin() && 'edit.php' != $pagenow ) ||
78
+ ! is_search() ||
79
+ ! isset( $wp->query_vars['s'] ) ||
80
+ ( isset( $wp->query_vars['post_type'] ) && 'product' != $wp->query_vars['post_type'] ) ||
81
+ ( isset( $wp->query_vars['post_type'] ) && is_array( $wp->query_vars['post_type'] ) && ! in_array( 'product', $wp->query_vars['post_type'] ) )
82
+ ) {
83
+ return $where;
84
+ }
85
+ $search_ids = array();
86
+ $terms = explode( ',', $wp->query_vars['s'] );
87
+ foreach ( $terms as $term ) {
88
+ if ( is_admin() && is_numeric( $term ) ) {
89
+ $search_ids[] = $term;
90
+ }
91
+ $variations_query = "SELECT p.post_parent as post_id" .
92
+ " FROM {$wpdb->posts} as p join {$wpdb->postmeta} pm on p.ID = pm.post_id and pm.meta_key='_sku' and pm.meta_value" .
93
+ " LIKE '%%%s%%' where p.post_parent <> 0 group by p.post_parent";
94
+ $regular_products_query = "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_sku' AND meta_value LIKE '%%%s%%';";
95
+ $sku_to_parent_id = $wpdb->get_col( $wpdb->prepare( $variations_query, wc_clean( $term ) ) );
96
+ $sku_to_id = $wpdb->get_col( $wpdb->prepare( $regular_products_query, wc_clean( $term ) ) );
97
+ $search_ids = array_merge( $search_ids, $sku_to_id, $sku_to_parent_id );
98
+ }
99
+ $search_ids = array_filter( array_map( 'absint', $search_ids ) );
100
+ if ( sizeof( $search_ids ) > 0 ) {
101
+ $where = str_replace( ')))', ") OR ({$wpdb->posts}.ID IN (" . implode( ',', $search_ids ) . "))))", $where );
102
+ }
103
+ return $where;
104
+ }
105
+
106
+ /**
107
+ * remove_sku_from_admin_emails.
108
+ *
109
+ * @version 3.4.0
110
+ * @since 3.4.0
111
+ */
112
+ function remove_sku_from_admin_emails( $args ) {
113
+ if ( $args['sent_to_admin'] ) {
114
+ $args['show_sku'] = false;
115
+ }
116
+ return $args;
117
+ }
118
+
119
  /**
120
  * add_sku_to_customer_emails.
121
  *
122
+ * @version 3.4.0
123
  * @since 2.5.5
124
  */
125
  function add_sku_to_customer_emails( $args ) {
126
+ if ( ! $args['sent_to_admin'] ) {
127
+ $args['show_sku'] = true;
128
+ }
129
  return $args;
130
  }
131
 
includes/class-wcj-stock.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Stock
4
  *
5
- * @version 2.8.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,9 +16,10 @@ class WCJ_Stock extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 2.8.0
20
  * @since 2.8.0
21
- * @todo (maybe) products_stock or product_stock
 
22
  */
23
  function __construct() {
24
 
@@ -29,6 +30,16 @@ class WCJ_Stock extends WCJ_Module {
29
  parent::__construct();
30
 
31
  if ( $this->is_enabled() ) {
 
 
 
 
 
 
 
 
 
 
32
  if ( 'yes' === get_option( 'wcj_stock_custom_out_of_stock_section_enabled', 'no' ) ) {
33
  if ( 'yes' === get_option( 'wcj_stock_custom_out_of_stock_enabled', 'no' ) ) {
34
  add_filter( 'woocommerce_get_availability_text', array( $this, 'custom_out_of_stock' ), PHP_INT_MAX, 2 );
@@ -37,9 +48,79 @@ class WCJ_Stock extends WCJ_Module {
37
  add_filter( 'woocommerce_get_availability_class', array( $this, 'custom_out_of_stock_class' ), PHP_INT_MAX, 2 );
38
  }
39
  }
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
  }
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  /**
44
  * custom_out_of_stock_class.
45
  *
2
  /**
3
  * Booster for WooCommerce - Module - Stock
4
  *
5
+ * @version 3.4.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 2.8.0
21
+ * @todo custom stock html
22
+ * @todo (maybe) "woocommerce-products-stock" or "woocommerce-product-stock"
23
  */
24
  function __construct() {
25
 
30
  parent::__construct();
31
 
32
  if ( $this->is_enabled() ) {
33
+ // Custom "In Stock"
34
+ if ( 'yes' === get_option( 'wcj_stock_custom_in_stock_section_enabled', 'no' ) ) {
35
+ if ( 'yes' === get_option( 'wcj_stock_custom_in_stock_enabled', 'no' ) ) {
36
+ add_filter( 'woocommerce_get_availability_text', array( $this, 'custom_in_stock' ), PHP_INT_MAX, 2 );
37
+ }
38
+ if ( 'yes' === get_option( 'wcj_stock_custom_in_stock_class_enabled', 'no' ) ) {
39
+ add_filter( 'woocommerce_get_availability_class', array( $this, 'custom_in_stock_class' ), PHP_INT_MAX, 2 );
40
+ }
41
+ }
42
+ // Custom "Out of Stock"
43
  if ( 'yes' === get_option( 'wcj_stock_custom_out_of_stock_section_enabled', 'no' ) ) {
44
  if ( 'yes' === get_option( 'wcj_stock_custom_out_of_stock_enabled', 'no' ) ) {
45
  add_filter( 'woocommerce_get_availability_text', array( $this, 'custom_out_of_stock' ), PHP_INT_MAX, 2 );
48
  add_filter( 'woocommerce_get_availability_class', array( $this, 'custom_out_of_stock_class' ), PHP_INT_MAX, 2 );
49
  }
50
  }
51
+ // Custom stock HTML
52
+ if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_stock_custom_stock_html_section_enabled', 'no' ) ) ) {
53
+ if ( WCJ_IS_WC_VERSION_BELOW_3 ) {
54
+ add_filter( 'woocommerce_stock_html', array( $this, 'custom_stock_html_below_wc_3' ), PHP_INT_MAX, 3 );
55
+ } else {
56
+ add_filter( 'woocommerce_get_stock_html', array( $this, 'custom_stock_html' ), PHP_INT_MAX, 2 );
57
+ }
58
+ }
59
+ // Remove stock display
60
+ if ( 'yes' === apply_filters( 'booster_option', 'no', get_option( 'wcj_stock_remove_frontend_display_enabled', 'no' ) ) ) {
61
+ add_filter( ( WCJ_IS_WC_VERSION_BELOW_3 ? 'woocommerce_stock_html' : 'woocommerce_get_stock_html' ), '__return_empty_string', PHP_INT_MAX );
62
+ }
63
  }
64
  }
65
 
66
+ /**
67
+ * custom_stock_html_below_wc_3.
68
+ *
69
+ * @version 3.4.0
70
+ * @version 3.4.0
71
+ */
72
+ function custom_stock_html_below_wc_3( $html, $availability_availability, $product ) {
73
+ $availability = $product->get_availability();
74
+ $replacements = array(
75
+ '%class%' => ( ! empty( $availability['class'] ) ? $availability['class'] : '' ),
76
+ '%availability%' => $availability_availability,
77
+ );
78
+ return str_replace( array_keys( $replacements ), $replacements, apply_filters( 'booster_option', '<p class="stock %class%">%availability%</p>',
79
+ get_option( 'wcj_stock_custom_stock_html', '<p class="stock %class%">%availability%</p>' ) ) );
80
+ }
81
+
82
+ /**
83
+ * custom_stock_html.
84
+ *
85
+ * @version 3.4.0
86
+ * @version 3.4.0
87
+ */
88
+ function custom_stock_html( $html, $product ) {
89
+ $availability = $product->get_availability();
90
+ $replacements = array(
91
+ '%class%' => ( ! empty( $availability['class'] ) ? $availability['class'] : '' ),
92
+ '%availability%' => ( ! empty( $availability['availability'] ) ? $availability['availability'] : '' ),
93
+ );
94
+ return str_replace( array_keys( $replacements ), $replacements, apply_filters( 'booster_option', '<p class="stock %class%">%availability%</p>',
95
+ get_option( 'wcj_stock_custom_stock_html', '<p class="stock %class%">%availability%</p>' ) ) );
96
+ }
97
+
98
+ /**
99
+ * custom_in_stock_class.
100
+ *
101
+ * @version 3.4.0
102
+ * @version 3.4.0
103
+ */
104
+ function custom_in_stock_class( $class, $_product ) {
105
+ if ( $_product->is_in_stock() ) {
106
+ return get_option( 'wcj_stock_custom_in_stock_class', '' );
107
+ }
108
+ return $class;
109
+ }
110
+
111
+ /**
112
+ * custom_in_stock.
113
+ *
114
+ * @version 3.4.0
115
+ * @version 3.4.0
116
+ */
117
+ function custom_in_stock( $availability, $_product ) {
118
+ if ( $_product->is_in_stock() ) {
119
+ return get_option( 'wcj_stock_custom_in_stock', '' );
120
+ }
121
+ return $availability;
122
+ }
123
+
124
  /**
125
  * custom_out_of_stock_class.
126
  *
includes/class-wcj-wholesale-price.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Wholesale Price
4
  *
5
- * @version 3.3.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  * @todo per variation
@@ -49,10 +49,28 @@ class WCJ_Wholesale_Price extends WCJ_Module {
49
  }
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  /**
53
  * add_discount_info_to_cart_page.
54
  *
55
- * @version 3.2.1
56
  */
57
  function add_discount_info_to_cart_page( $price_html, $cart_item, $cart_item_key ) {
58
 
@@ -67,12 +85,17 @@ class WCJ_Wholesale_Price extends WCJ_Module {
67
  : get_option( 'wcj_wholesale_price_discount_type', 'percent' );
68
  if ( 'price_directly' === $discount_type ) {
69
  $_product = $cart_item['data'];
 
70
  if ( isset( $_product->wcj_wholesale_price ) ) {
 
71
  unset( $_product->wcj_wholesale_price );
72
  }
73
- $discount = wc_price( $_product->get_price() - $discount );
 
 
 
74
  } elseif ( 'fixed' === $discount_type ) {
75
- $discount = wc_price( $discount );
76
  } else {
77
  $discount = $discount . '%';
78
  }
@@ -173,9 +196,8 @@ class WCJ_Wholesale_Price extends WCJ_Module {
173
  /**
174
  * calculate_totals.
175
  *
176
- * @version 3.3.0
177
  * @since 2.5.0
178
- * @todo `$price_old` must be price to display *in cart* (now it's *in shop*)
179
  */
180
  function calculate_totals( $cart ) {
181
 
@@ -198,7 +220,7 @@ class WCJ_Wholesale_Price extends WCJ_Module {
198
 
199
  // Prices
200
  $price = $_product->get_price();
201
- $price_old = wcj_get_product_display_price( $_product ); // used for display only
202
 
203
  // If other discount was applied in cart...
204
  if ( 'yes' === get_option( 'wcj_wholesale_price_apply_only_if_no_other_discounts', 'no' ) ) {
2
  /**
3
  * Booster for WooCommerce - Module - Wholesale Price
4
  *
5
+ * @version 3.4.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  * @todo per variation
49
  }
50
  }
51
 
52
+ /**
53
+ * get_price_for_cart.
54
+ *
55
+ * @version 3.4.0
56
+ * @since 3.4.0
57
+ */
58
+ function get_price_for_cart( $price, $_product ) {
59
+ $product_prices_include_tax = ( 'yes' === get_option( 'woocommerce_prices_include_tax' ) );
60
+ $cart_prices_include_tax = ( 'incl' === get_option( 'woocommerce_tax_display_cart' ) );
61
+ if ( $product_prices_include_tax != $cart_prices_include_tax ) {
62
+ return ( $cart_prices_include_tax ?
63
+ wc_get_price_including_tax( $_product, array( 'price' => $price, 'qty' => 1 ) ) :
64
+ wc_get_price_excluding_tax( $_product, array( 'price' => $price, 'qty' => 1 ) ) );
65
+ } else {
66
+ return $price;
67
+ }
68
+ }
69
+
70
  /**
71
  * add_discount_info_to_cart_page.
72
  *
73
+ * @version 3.4.0
74
  */
75
  function add_discount_info_to_cart_page( $price_html, $cart_item, $cart_item_key ) {
76
 
85
  : get_option( 'wcj_wholesale_price_discount_type', 'percent' );
86
  if ( 'price_directly' === $discount_type ) {
87
  $_product = $cart_item['data'];
88
+ $saved_wcj_wholesale_price = false;
89
  if ( isset( $_product->wcj_wholesale_price ) ) {
90
+ $saved_wcj_wholesale_price = $_product->wcj_wholesale_price;
91
  unset( $_product->wcj_wholesale_price );
92
  }
93
+ $discount = wc_price( $this->get_price_for_cart( ( $_product->get_price() - $discount ), $_product ) );
94
+ if ( false !== $saved_wcj_wholesale_price ) {
95
+ $_product->wcj_wholesale_price = $saved_wcj_wholesale_price;
96
+ }
97
  } elseif ( 'fixed' === $discount_type ) {
98
+ $discount = wc_price( $this->get_price_for_cart( $discount, $cart_item['data'] ) );
99
  } else {
100
  $discount = $discount . '%';
101
  }
196
  /**
197
  * calculate_totals.
198
  *
199
+ * @version 3.4.0
200
  * @since 2.5.0
 
201
  */
202
  function calculate_totals( $cart ) {
203
 
220
 
221
  // Prices
222
  $price = $_product->get_price();
223
+ $price_old = wcj_get_product_display_price( $_product, '', 1, 'cart' ); // used for display only
224
 
225
  // If other discount was applied in cart...
226
  if ( 'yes' === get_option( 'wcj_wholesale_price_apply_only_if_no_other_discounts', 'no' ) ) {
includes/classes/class-wcj-pdf-invoice.php CHANGED
@@ -4,6 +4,7 @@
4
  *
5
  * @version 3.2.4
6
  * @author Algoritmika Ltd.
 
7
  */
8
 
9
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -23,6 +24,7 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
23
  * prepare_pdf.
24
  *
25
  * @version 3.2.4
 
26
  */
27
  function prepare_pdf() {
28
 
@@ -129,9 +131,6 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
129
  $pdf->setFontSubsetting( true );
130
 
131
  // Set font
132
- /* if ( 'DroidSansFallback' === $tcpdf_font ) {
133
- $pdf->addTTFfont( wcj_plugin_path() . '/includes/lib/tcpdf_min/fonts/' . 'DroidSansFallback.ttf' );
134
- } */
135
  $pdf->SetFont( $tcpdf_font, '', get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_size', 8 ), '', true );
136
 
137
  // Add a page
4
  *
5
  * @version 3.2.4
6
  * @author Algoritmika Ltd.
7
+ * @todo clean up
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
24
  * prepare_pdf.
25
  *
26
  * @version 3.2.4
27
+ * @todo check `addTTFfont()`
28
  */
29
  function prepare_pdf() {
30
 
131
  $pdf->setFontSubsetting( true );
132
 
133
  // Set font
 
 
 
134
  $pdf->SetFont( $tcpdf_font, '', get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_size', 8 ), '', true );
135
 
136
  // Add a page
includes/classes/class-wcj-tcpdf.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce TCPDF
4
  *
5
- * @version 2.9.0
6
  * @author Algoritmika Ltd.
7
  * @todo (maybe) `Header()`
8
  */
@@ -11,8 +11,26 @@ if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
  if ( ! class_exists( 'WCJ_TCPDF' ) ) :
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  // Include the main TCPDF library
15
- require_once( wcj_plugin_path() . '/includes/lib/tcpdf_min/tcpdf.php' );
16
 
17
  class WCJ_TCPDF extends TCPDF {
18
 
2
  /**
3
  * Booster for WooCommerce TCPDF
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  * @todo (maybe) `Header()`
8
  */
11
 
12
  if ( ! class_exists( 'WCJ_TCPDF' ) ) :
13
 
14
+ // TCPDF config
15
+ // Path for PDF fonts
16
+ if ( wcj_check_tcpdf_fonts_version( true ) ) {
17
+ define( 'K_PATH_FONTS', wcj_get_wcj_uploads_dir( 'tcpdf_fonts' ) . '/' );
18
+ }
19
+ // Default images directory
20
+ switch ( get_option( 'wcj_invoicing_general_header_images_path', 'empty' ) ) {
21
+ case 'empty':
22
+ define ( 'K_PATH_IMAGES', '' );
23
+ break;
24
+ case 'document_root':
25
+ define ( 'K_PATH_IMAGES', $_SERVER['DOCUMENT_ROOT'] );
26
+ break;
27
+ case 'abspath':
28
+ define ( 'K_PATH_IMAGES', ABSPATH );
29
+ break;
30
+ }
31
+
32
  // Include the main TCPDF library
33
+ require_once( wcj_plugin_path() . '/includes/lib/tcpdf/tcpdf.php' );
34
 
35
  class WCJ_TCPDF extends TCPDF {
36
 
includes/core/class-wcj-admin.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Core - Admin
4
  *
5
- * @version 3.3.0
6
  * @since 3.2.4
7
  * @author Algoritmika Ltd.
8
  */
@@ -21,7 +21,7 @@ class WCJ_Admin {
21
  */
22
  function __construct() {
23
  if ( is_admin() ) {
24
- add_filter( 'booster_message', 'wcj_get_plus_message', 100, 3 );
25
  add_filter( 'woocommerce_get_settings_pages', array( $this, 'add_wcj_settings_tab' ), 1 );
26
  add_filter( 'plugin_action_links_' . plugin_basename( WCJ_PLUGIN_FILE ), array( $this, 'action_links' ) );
27
  add_action( 'admin_menu', array( $this, 'booster_menu' ), 100 );
@@ -35,31 +35,23 @@ class WCJ_Admin {
35
  /**
36
  * check_plus_version.
37
  *
38
- * @version 3.3.0
39
  * @since 2.5.9
 
40
  * @todo (maybe) expand "Please upgrade ..." message
41
  */
42
  function check_plus_version() {
43
- if ( ! is_admin() ) {
44
- return;
45
- }
46
- // Check if Plus is installed and activated
47
  $is_deprecated_plus_active = false;
48
- $active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) );
49
- if ( is_multisite() ) {
50
- $active_plugins = array_merge( $active_plugins, array_keys( get_site_option( 'active_sitewide_plugins', array() ) ) );
51
- }
52
- foreach ( $active_plugins as $active_plugin ) {
53
  $active_plugin = explode( '/', $active_plugin );
54
  if ( isset( $active_plugin[1] ) ) {
55
  if ( 'booster-plus-for-woocommerce.php' === $active_plugin[1] ) {
56
  return;
57
  } elseif ( 'woocommerce-jetpack-plus.php' === $active_plugin[1] || 'woocommerce-booster-plus.php' === $active_plugin[1] ) {
58
- $is_deprecated_plus_active = true;
59
  }
60
  }
61
  }
62
- // Check Plus version
63
  if ( $is_deprecated_plus_active ) {
64
  $class = 'notice notice-error';
65
  $message = __( 'Please update <strong>Booster Plus for WooCommerce</strong> plugin.', 'woocommerce-jetpack' ) . ' ' .
2
  /**
3
  * Booster for WooCommerce - Core - Admin
4
  *
5
+ * @version 3.4.0
6
  * @since 3.2.4
7
  * @author Algoritmika Ltd.
8
  */
21
  */
22
  function __construct() {
23
  if ( is_admin() ) {
24
+ add_filter( 'booster_message', 'wcj_get_plus_message', 100, 3 );
25
  add_filter( 'woocommerce_get_settings_pages', array( $this, 'add_wcj_settings_tab' ), 1 );
26
  add_filter( 'plugin_action_links_' . plugin_basename( WCJ_PLUGIN_FILE ), array( $this, 'action_links' ) );
27
  add_action( 'admin_menu', array( $this, 'booster_menu' ), 100 );
35
  /**
36
  * check_plus_version.
37
  *
38
+ * @version 3.4.0
39
  * @since 2.5.9
40
+ * @todo (maybe) use `wcj_is_plugin_active_by_file()`
41
  * @todo (maybe) expand "Please upgrade ..." message
42
  */
43
  function check_plus_version() {
 
 
 
 
44
  $is_deprecated_plus_active = false;
45
+ foreach ( wcj_get_active_plugins() as $active_plugin ) {
 
 
 
 
46
  $active_plugin = explode( '/', $active_plugin );
47
  if ( isset( $active_plugin[1] ) ) {
48
  if ( 'booster-plus-for-woocommerce.php' === $active_plugin[1] ) {
49
  return;
50
  } elseif ( 'woocommerce-jetpack-plus.php' === $active_plugin[1] || 'woocommerce-booster-plus.php' === $active_plugin[1] ) {
51
+ $is_deprecated_plus_active = true; // can't `brake` because of possible active `booster-plus-for-woocommerce.php`
52
  }
53
  }
54
  }
 
55
  if ( $is_deprecated_plus_active ) {
56
  $class = 'notice notice-error';
57
  $message = __( 'Please update <strong>Booster Plus for WooCommerce</strong> plugin.', 'woocommerce-jetpack' ) . ' ' .
includes/core/class-wcj-scripts.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Scripts
4
  *
5
- * @version 3.0.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ class WCJ_Scripts {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 3.0.0
20
  * @since 2.9.0
21
  */
22
  function __construct() {
@@ -28,7 +28,8 @@ class WCJ_Scripts {
28
  wcj_is_module_enabled( 'purchase_data' ) ||
29
  wcj_is_module_enabled( 'pdf_invoicing' ) ||
30
  wcj_is_module_enabled( 'crowdfunding' ) ||
31
- wcj_is_module_enabled( 'reports' )
 
32
  ) {
33
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend_scripts' ) );
34
  }
2
  /**
3
  * Booster for WooCommerce - Scripts
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 3.4.0
20
  * @since 2.9.0
21
  */
22
  function __construct() {
28
  wcj_is_module_enabled( 'purchase_data' ) ||
29
  wcj_is_module_enabled( 'pdf_invoicing' ) ||
30
  wcj_is_module_enabled( 'crowdfunding' ) ||
31
+ wcj_is_module_enabled( 'reports' ) ||
32
+ wcj_is_module_enabled( 'product_by_date' )
33
  ) {
34
  add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend_scripts' ) );
35
  }
includes/core/wcj-constants.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce Constants
4
  *
5
- * @version 3.3.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -73,10 +73,10 @@ if ( ! defined( 'WCJ_SESSION_TYPE' ) ) {
73
  /**
74
  * Session type.
75
  *
76
- * @version 3.1.0
77
  * @since 3.1.0
78
  */
79
- define( 'WCJ_SESSION_TYPE', ( 'yes' === get_option( 'wcj_general_enabled', 'no' ) ? get_option( 'wcj_general_advanced_session_type', 'standard' ) : 'standard' ) );
80
  }
81
 
82
  if ( ! defined( 'WCJ_VERSION_OPTION' ) ) {
2
  /**
3
  * Booster for WooCommerce Constants
4
  *
5
+ * @version 3.4.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
73
  /**
74
  * Session type.
75
  *
76
+ * @version 3.4.0
77
  * @since 3.1.0
78
  */
79
+ define( 'WCJ_SESSION_TYPE', ( 'yes' === get_option( 'wcj_general_enabled', 'no' ) ? get_option( 'wcj_general_advanced_session_type', 'wc' ) : 'wc' ) );
80
  }
81
 
82
  if ( ! defined( 'WCJ_VERSION_OPTION' ) ) {
includes/core/wcj-modules.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Modules
4
  *
5
- * @version 3.3.0
6
  * @since 3.2.4
7
  * @author Algoritmika Ltd.
8
  */
@@ -71,6 +71,8 @@ $wcj_module_files = array(
71
  'class-wcj-payment-gateways-by-shipping.php',
72
  'class-wcj-shipping.php',
73
  'class-wcj-shipping-options.php',
 
 
74
  'class-wcj-left-to-free-shipping.php',
75
  'class-wcj-shipping-calculator.php',
76
  'class-wcj-shipping-by-user-role.php',
2
  /**
3
  * Booster for WooCommerce - Modules
4
  *
5
+ * @version 3.4.0
6
  * @since 3.2.4
7
  * @author Algoritmika Ltd.
8
  */
71
  'class-wcj-payment-gateways-by-shipping.php',
72
  'class-wcj-shipping.php',
73
  'class-wcj-shipping-options.php',
74
+ 'class-wcj-shipping-icons.php',
75
+ 'class-wcj-shipping-description.php',
76
  'class-wcj-left-to-free-shipping.php',
77
  'class-wcj-shipping-calculator.php',
78
  'class-wcj-shipping-by-user-role.php',
includes/exchange-rates/class-wcj-exchange-rates-crons.php CHANGED
@@ -164,7 +164,7 @@ class WCJ_Exchange_Rates_Crons {
164
  foreach ( $currency_pairs as $currency_pair ) {
165
  $currency_from = $currency_pair['currency_from'];
166
  $currency_to = $currency_pair['currency_to'];
167
- $the_rate = alg_get_exchange_rate( $currency_from, $currency_to );
168
  if ( 0 != $the_rate ) {
169
  if ( 0 != $rate_offset_percent ) {
170
  $the_rate = round( $the_rate * $rate_offset_percent, 6 );
164
  foreach ( $currency_pairs as $currency_pair ) {
165
  $currency_from = $currency_pair['currency_from'];
166
  $currency_to = $currency_pair['currency_to'];
167
+ $the_rate = wcj_get_exchange_rate( $currency_from, $currency_to );
168
  if ( 0 != $the_rate ) {
169
  if ( 0 != $rate_offset_percent ) {
170
  $the_rate = round( $the_rate * $rate_offset_percent, 6 );
includes/functions/wcj-functions-core.php CHANGED
@@ -2,26 +2,78 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Core
4
  *
5
- * @version 3.3.0
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
- if ( ! function_exists( 'wcj_is_plugin_active' ) ) {
13
  /**
14
- * wcj_is_plugin_active.
15
  *
16
- * @version 2.8.0
17
  * @since 2.8.0
18
  * @return bool
19
- * @todo (maybe) check `.php` file only (i.e. no folder)
20
  */
21
- function wcj_is_plugin_active( $plugin ) {
22
  return (
23
  in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ) ) ||
24
  ( is_multisite() && array_key_exists( $plugin, get_site_option( 'active_sitewide_plugins', array() ) ) )
25
  );
26
  }
27
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Booster for WooCommerce - Functions - Core
4
  *
5
+ * @version 3.4.0
6
  * @since 3.3.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
+ if ( ! function_exists( 'wcj_is_plugin_active_simple' ) ) {
13
  /**
14
+ * wcj_is_plugin_active_simple.
15
  *
16
+ * @version 3.4.0
17
  * @since 2.8.0
18
  * @return bool
 
19
  */
20
+ function wcj_is_plugin_active_simple( $plugin ) {
21
  return (
22
  in_array( $plugin, apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ) ) ||
23
  ( is_multisite() && array_key_exists( $plugin, get_site_option( 'active_sitewide_plugins', array() ) ) )
24
  );
25
  }
26
  }
27
+
28
+ if ( ! function_exists( 'wcj_get_active_plugins' ) ) {
29
+ /**
30
+ * wcj_get_active_plugins.
31
+ *
32
+ * @version 3.4.0
33
+ * @since 3.4.0
34
+ * @return array
35
+ */
36
+ function wcj_get_active_plugins() {
37
+ $active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) );
38
+ if ( is_multisite() ) {
39
+ $active_plugins = array_merge( $active_plugins, array_keys( get_site_option( 'active_sitewide_plugins', array() ) ) );
40
+ }
41
+ return $active_plugins;
42
+ }
43
+ }
44
+
45
+ if ( ! function_exists( 'wcj_is_plugin_active_by_file' ) ) {
46
+ /**
47
+ * wcj_is_plugin_active_by_file.
48
+ *
49
+ * @version 3.4.0
50
+ * @since 3.4.0
51
+ * @return bool
52
+ */
53
+ function wcj_is_plugin_active_by_file( $plugin_file ) {
54
+ foreach ( wcj_get_active_plugins() as $active_plugin ) {
55
+ $active_plugin = explode( '/', $active_plugin );
56
+ if ( isset( $active_plugin[1] ) && $plugin_file === $active_plugin[1] ) {
57
+ return true;
58
+ }
59
+ }
60
+ return false;
61
+ }
62
+ }
63
+
64
+ if ( ! function_exists( 'wcj_is_plugin_activated' ) ) {
65
+ /**
66
+ * wcj_is_plugin_activated.
67
+ *
68
+ * @version 3.4.0
69
+ * @since 3.4.0
70
+ * @return bool
71
+ */
72
+ function wcj_is_plugin_activated( $plugin_folder, $plugin_file ) {
73
+ if ( wcj_is_plugin_active_simple( $plugin_folder . '/' . $plugin_file ) ) {
74
+ return true;
75
+ } else {
76
+ return wcj_is_plugin_active_by_file( $plugin_file );
77
+ }
78
+ }
79
+ }
includes/functions/wcj-functions-exchange-rates.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Exchange Rates
4
  *
5
- * @version 3.3.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -105,14 +105,14 @@ if ( ! function_exists( 'wcj_get_currency_exchange_rate_server_name' ) ) {
105
  }
106
  }
107
 
108
- if ( ! function_exists( 'alg_get_exchange_rate' ) ) {
109
  /*
110
- * alg_get_exchange_rate.
111
  *
112
  * @version 3.2.4
113
  * @since 2.6.0
114
  */
115
- function alg_get_exchange_rate( $currency_from, $currency_to ) {
116
  $exchange_rates_server = wcj_get_currency_exchange_rate_server( $currency_from, $currency_to );
117
  if ( 'yes' === ( $calculate_by_invert = get_option( 'wcj_currency_exchange_rates_calculate_by_invert', 'no' ) ) ) {
118
  $_currency_to = $currency_to;
@@ -121,22 +121,22 @@ if ( ! function_exists( 'alg_get_exchange_rate' ) ) {
121
  }
122
  switch ( $exchange_rates_server ) {
123
  case 'tcmb':
124
- $return = alg_tcmb_get_exchange_rate( $currency_from, $currency_to );
125
  break;
126
  case 'ecb':
127
- $return = alg_ecb_get_exchange_rate( $currency_from, $currency_to );
128
  break;
129
  case 'fixer':
130
- $return = alg_fixer_io_get_exchange_rate( $currency_from, $currency_to );
131
  break;
132
  case 'coinbase':
133
- $return = alg_coinbase_get_exchange_rate( $currency_from, $currency_to );
134
  break;
135
  case 'coinmarketcap':
136
- $return = alg_coinmarketcap_get_exchange_rate( $currency_from, $currency_to );
137
  break;
138
  default: // 'yahoo'
139
- $return = alg_yahoo_get_exchange_rate( $currency_from, $currency_to );
140
  break;
141
  }
142
  return ( 'yes' === $calculate_by_invert ) ? round( ( 1 / $return ), 6 ) : $return;
@@ -166,9 +166,9 @@ if ( ! function_exists( 'wcj_get_currency_exchange_rates_url_response' ) ) {
166
  }
167
  }
168
 
169
- if ( ! function_exists( 'alg_coinmarketcap_get_exchange_rate_specific' ) ) {
170
  /*
171
- * alg_coinmarketcap_get_exchange_rate_specific.
172
  *
173
  * @version 3.2.4
174
  * @since 3.2.4
@@ -176,7 +176,7 @@ if ( ! function_exists( 'alg_coinmarketcap_get_exchange_rate_specific' ) ) {
176
  * @todo add more `$cryptocurrencies_ids`
177
  * @todo (maybe) try reverse only if `! isset( $cryptocurrencies_ids[ $currency_from ] )`
178
  */
179
- function alg_coinmarketcap_get_exchange_rate_specific( $currency_from, $currency_to, $try_reverse = true ) {
180
  $return = false;
181
  $cryptocurrencies_ids = array(
182
  'BTC' => 'bitcoin',
@@ -190,7 +190,7 @@ if ( ! function_exists( 'alg_coinmarketcap_get_exchange_rate_specific' ) ) {
190
  }
191
  }
192
  if ( false === $return && $try_reverse ) {
193
- $return = alg_coinmarketcap_get_exchange_rate_specific( $currency_to, $currency_from, false );
194
  if ( 0 != $return ) {
195
  $return = round( ( 1 / $return ), 12 );
196
  }
@@ -199,18 +199,18 @@ if ( ! function_exists( 'alg_coinmarketcap_get_exchange_rate_specific' ) ) {
199
  }
200
  }
201
 
202
- if ( ! function_exists( 'alg_coinmarketcap_get_exchange_rate' ) ) {
203
  /*
204
- * alg_coinmarketcap_get_exchange_rate.
205
  *
206
  * @version 3.2.4
207
  * @since 3.2.4
208
  * @see https://coinmarketcap.com/api/
209
  * @todo `WCJ()->modules['currency_exchange_rates']->coinmarketcap_response`
210
- * @todo `alg_coinmarketcap_get_exchange_rate_specific()`
211
  * @todo (maybe) `limit=0`
212
  */
213
- function alg_coinmarketcap_get_exchange_rate( $currency_from, $currency_to, $try_reverse = true ) {
214
  $return = false;
215
  /*
216
  if ( ! isset( WCJ()->modules['currency_exchange_rates']->coinmarketcap_response ) ) {
@@ -232,7 +232,7 @@ if ( ! function_exists( 'alg_coinmarketcap_get_exchange_rate' ) ) {
232
  }
233
  }
234
  if ( false === $return && $try_reverse ) {
235
- $return = alg_coinmarketcap_get_exchange_rate( $currency_to, $currency_from, false );
236
  if ( 0 != $return ) {
237
  $return = round( ( 1 / $return ), 12 );
238
  }
@@ -241,27 +241,27 @@ if ( ! function_exists( 'alg_coinmarketcap_get_exchange_rate' ) ) {
241
  }
242
  }
243
 
244
- if ( ! function_exists( 'alg_coinbase_get_exchange_rate' ) ) {
245
  /*
246
- * alg_coinbase_get_exchange_rate.
247
  *
248
  * @version 3.2.4
249
  * @since 3.2.4
250
  */
251
- function alg_coinbase_get_exchange_rate( $currency_from, $currency_to ) {
252
  $response = wcj_get_currency_exchange_rates_url_response( "https://api.coinbase.com/v2/exchange-rates?currency=$currency_from" );
253
  return ( isset( $response->data->rates->{$currency_to} ) ? $response->data->rates->{$currency_to} : false );
254
  }
255
  }
256
 
257
- if ( ! function_exists( 'alg_ecb_get_exchange_rate' ) ) {
258
  /*
259
- * alg_ecb_get_exchange_rate.
260
  *
261
  * @version 2.7.0
262
  * @since 2.6.0
263
  */
264
- function alg_ecb_get_exchange_rate( $currency_from, $currency_to ) {
265
  $final_rate = false;
266
  if ( function_exists( 'simplexml_load_file' ) ) {
267
  $xml = simplexml_load_file( 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml' );
@@ -292,14 +292,14 @@ if ( ! function_exists( 'alg_ecb_get_exchange_rate' ) ) {
292
  }
293
  }
294
 
295
- if ( ! function_exists( 'alg_tcmb_get_exchange_rate_TRY' ) ) {
296
  /*
297
- * alg_tcmb_get_exchange_rate_TRY.
298
  *
299
  * @version 2.7.0
300
  * @since 2.6.0
301
  */
302
- function alg_tcmb_get_exchange_rate_TRY( $currency_from ) {
303
  if ( 'TRY' === $currency_from ) {
304
  return 1;
305
  }
@@ -340,19 +340,19 @@ if ( ! function_exists( 'alg_tcmb_get_exchange_rate_TRY' ) ) {
340
  }
341
  }
342
 
343
- if ( ! function_exists( 'alg_tcmb_get_exchange_rate' ) ) {
344
  /*
345
- * alg_tcmb_get_exchange_rate.
346
  *
347
  * @version 2.7.0
348
  * @since 2.6.0
349
  */
350
- function alg_tcmb_get_exchange_rate( $currency_from, $currency_to ) {
351
- $currency_from_TRY = alg_tcmb_get_exchange_rate_TRY( strtoupper( $currency_from ) );
352
  if ( false == $currency_from_TRY ) {
353
  return false;
354
  }
355
- $currency_to_TRY = alg_tcmb_get_exchange_rate_TRY( strtoupper( $currency_to ) );
356
  if ( false == $currency_to_TRY ) {
357
  return false;
358
  }
@@ -363,15 +363,14 @@ if ( ! function_exists( 'alg_tcmb_get_exchange_rate' ) ) {
363
  }
364
  }
365
 
366
- if ( ! function_exists( 'alg_yahoo_get_exchange_rate' ) ) {
367
  /*
368
- * alg_yahoo_get_exchange_rate.
369
  *
370
  * @version 3.2.4
371
  * @return float rate on success, else 0
372
- * @todo `alg_` to `wcj_`
373
  */
374
- function alg_yahoo_get_exchange_rate( $currency_from, $currency_to ) {
375
  $response = wcj_get_currency_exchange_rates_url_response( "https://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json" );
376
  if ( ! isset( $response->list->resources ) ) {
377
  return false;
@@ -402,15 +401,15 @@ if ( ! function_exists( 'alg_yahoo_get_exchange_rate' ) ) {
402
  }
403
  }
404
 
405
- if ( ! function_exists( 'alg_fixer_io_get_exchange_rate' ) ) {
406
  /*
407
- * alg_fixer_io_get_exchange_rate.
408
  *
409
  * @version 3.2.2
410
  * @since 3.2.2
411
  * @return false or rate
412
  */
413
- function alg_fixer_io_get_exchange_rate( $currency_from, $currency_to ) {
414
  return wcj_fixer_io_get_exchange_rate_by_date( $currency_from, $currency_to, 'latest' );
415
  }
416
  }
2
  /**
3
  * Booster for WooCommerce - Functions - Exchange Rates
4
  *
5
+ * @version 3.4.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
105
  }
106
  }
107
 
108
+ if ( ! function_exists( 'wcj_get_exchange_rate' ) ) {
109
  /*
110
+ * wcj_get_exchange_rate.
111
  *
112
  * @version 3.2.4
113
  * @since 2.6.0
114
  */
115
+ function wcj_get_exchange_rate( $currency_from, $currency_to ) {
116
  $exchange_rates_server = wcj_get_currency_exchange_rate_server( $currency_from, $currency_to );
117
  if ( 'yes' === ( $calculate_by_invert = get_option( 'wcj_currency_exchange_rates_calculate_by_invert', 'no' ) ) ) {
118
  $_currency_to = $currency_to;
121
  }
122
  switch ( $exchange_rates_server ) {
123
  case 'tcmb':
124
+ $return = wcj_tcmb_get_exchange_rate( $currency_from, $currency_to );
125
  break;
126
  case 'ecb':
127
+ $return = wcj_ecb_get_exchange_rate( $currency_from, $currency_to );
128
  break;
129
  case 'fixer':
130
+ $return = wcj_fixer_io_get_exchange_rate( $currency_from, $currency_to );
131
  break;
132
  case 'coinbase':
133
+ $return = wcj_coinbase_get_exchange_rate( $currency_from, $currency_to );
134
  break;
135
  case 'coinmarketcap':
136
+ $return = wcj_coinmarketcap_get_exchange_rate( $currency_from, $currency_to );
137
  break;
138
  default: // 'yahoo'
139
+ $return = wcj_yahoo_get_exchange_rate( $currency_from, $currency_to );
140
  break;
141
  }
142
  return ( 'yes' === $calculate_by_invert ) ? round( ( 1 / $return ), 6 ) : $return;
166
  }
167
  }
168
 
169
+ if ( ! function_exists( 'wcj_coinmarketcap_get_exchange_rate_specific' ) ) {
170
  /*
171
+ * wcj_coinmarketcap_get_exchange_rate_specific.
172
  *
173
  * @version 3.2.4
174
  * @since 3.2.4
176
  * @todo add more `$cryptocurrencies_ids`
177
  * @todo (maybe) try reverse only if `! isset( $cryptocurrencies_ids[ $currency_from ] )`
178
  */
179
+ function wcj_coinmarketcap_get_exchange_rate_specific( $currency_from, $currency_to, $try_reverse = true ) {
180
  $return = false;
181
  $cryptocurrencies_ids = array(
182
  'BTC' => 'bitcoin',
190
  }
191
  }
192
  if ( false === $return && $try_reverse ) {
193
+ $return = wcj_coinmarketcap_get_exchange_rate_specific( $currency_to, $currency_from, false );
194
  if ( 0 != $return ) {
195
  $return = round( ( 1 / $return ), 12 );
196
  }
199
  }
200
  }
201
 
202
+ if ( ! function_exists( 'wcj_coinmarketcap_get_exchange_rate' ) ) {
203
  /*
204
+ * wcj_coinmarketcap_get_exchange_rate.
205
  *
206
  * @version 3.2.4
207
  * @since 3.2.4
208
  * @see https://coinmarketcap.com/api/
209
  * @todo `WCJ()->modules['currency_exchange_rates']->coinmarketcap_response`
210
+ * @todo `wcj_coinmarketcap_get_exchange_rate_specific()`
211
  * @todo (maybe) `limit=0`
212
  */
213
+ function wcj_coinmarketcap_get_exchange_rate( $currency_from, $currency_to, $try_reverse = true ) {
214
  $return = false;
215
  /*
216
  if ( ! isset( WCJ()->modules['currency_exchange_rates']->coinmarketcap_response ) ) {
232
  }
233
  }
234
  if ( false === $return && $try_reverse ) {
235
+ $return = wcj_coinmarketcap_get_exchange_rate( $currency_to, $currency_from, false );
236
  if ( 0 != $return ) {
237
  $return = round( ( 1 / $return ), 12 );
238
  }
241
  }
242
  }
243
 
244
+ if ( ! function_exists( 'wcj_coinbase_get_exchange_rate' ) ) {
245
  /*
246
+ * wcj_coinbase_get_exchange_rate.
247
  *
248
  * @version 3.2.4
249
  * @since 3.2.4
250
  */
251
+ function wcj_coinbase_get_exchange_rate( $currency_from, $currency_to ) {
252
  $response = wcj_get_currency_exchange_rates_url_response( "https://api.coinbase.com/v2/exchange-rates?currency=$currency_from" );
253
  return ( isset( $response->data->rates->{$currency_to} ) ? $response->data->rates->{$currency_to} : false );
254
  }
255
  }
256
 
257
+ if ( ! function_exists( 'wcj_ecb_get_exchange_rate' ) ) {
258
  /*
259
+ * wcj_ecb_get_exchange_rate.
260
  *
261
  * @version 2.7.0
262
  * @since 2.6.0
263
  */
264
+ function wcj_ecb_get_exchange_rate( $currency_from, $currency_to ) {
265
  $final_rate = false;
266
  if ( function_exists( 'simplexml_load_file' ) ) {
267
  $xml = simplexml_load_file( 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml' );
292
  }
293
  }
294
 
295
+ if ( ! function_exists( 'wcj_tcmb_get_exchange_rate_TRY' ) ) {
296
  /*
297
+ * wcj_tcmb_get_exchange_rate_TRY.
298
  *
299
  * @version 2.7.0
300
  * @since 2.6.0
301
  */
302
+ function wcj_tcmb_get_exchange_rate_TRY( $currency_from ) {
303
  if ( 'TRY' === $currency_from ) {
304
  return 1;
305
  }
340
  }
341
  }
342
 
343
+ if ( ! function_exists( 'wcj_tcmb_get_exchange_rate' ) ) {
344
  /*
345
+ * wcj_tcmb_get_exchange_rate.
346
  *
347
  * @version 2.7.0
348
  * @since 2.6.0
349
  */
350
+ function wcj_tcmb_get_exchange_rate( $currency_from, $currency_to ) {
351
+ $currency_from_TRY = wcj_tcmb_get_exchange_rate_TRY( strtoupper( $currency_from ) );
352
  if ( false == $currency_from_TRY ) {
353
  return false;
354
  }
355
+ $currency_to_TRY = wcj_tcmb_get_exchange_rate_TRY( strtoupper( $currency_to ) );
356
  if ( false == $currency_to_TRY ) {
357
  return false;
358
  }
363
  }
364
  }
365
 
366
+ if ( ! function_exists( 'wcj_yahoo_get_exchange_rate' ) ) {
367
  /*
368
+ * wcj_yahoo_get_exchange_rate.
369
  *
370
  * @version 3.2.4
371
  * @return float rate on success, else 0
 
372
  */
373
+ function wcj_yahoo_get_exchange_rate( $currency_from, $currency_to ) {
374
  $response = wcj_get_currency_exchange_rates_url_response( "https://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json" );
375
  if ( ! isset( $response->list->resources ) ) {
376
  return false;
401
  }
402
  }
403
 
404
+ if ( ! function_exists( 'wcj_fixer_io_get_exchange_rate' ) ) {
405
  /*
406
+ * wcj_fixer_io_get_exchange_rate.
407
  *
408
  * @version 3.2.2
409
  * @since 3.2.2
410
  * @return false or rate
411
  */
412
+ function wcj_fixer_io_get_exchange_rate( $currency_from, $currency_to ) {
413
  return wcj_fixer_io_get_exchange_rate_by_date( $currency_from, $currency_to, 'latest' );
414
  }
415
  }
includes/functions/wcj-functions-general.php CHANGED
@@ -2,23 +2,52 @@
2
  /**
3
  * Booster for WooCommerce - Functions
4
  *
5
- * @version 3.3.0
6
  * @author Algoritmika Ltd.
7
  * @todo add `wcj_add_actions()` and `wcj_add_filters()`
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  if ( ! function_exists( 'wcj_get_js_confirmation' ) ) {
13
  /**
14
  * wcj_get_js_confirmation.
15
  *
16
- * @version 3.3.0
17
  * @since 3.3.0
18
  * @todo use where needed
19
  */
20
- function wcj_get_js_confirmation() {
21
- return ' onclick="return confirm(\'' . __( 'Are you sure?', 'woocommerce-jetpack' ) . '\')"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  }
23
  }
24
 
@@ -26,7 +55,7 @@ if ( ! function_exists( 'wcj_tcpdf_barcode' ) ) {
26
  /**
27
  * wcj_tcpdf_barcode.
28
  *
29
- * @version 3.3.0
30
  * @since 3.3.0
31
  * @todo `color`
32
  * @todo `align` (try 'T')
@@ -84,10 +113,7 @@ if ( ! function_exists( 'wcj_tcpdf_barcode' ) ) {
84
  false, // distort
85
  );
86
  }
87
- require_once( WCJ_PLUGIN_PATH . '/includes/lib/tcpdf_min/include/tcpdf_static.php' );
88
- $params = TCPDF_STATIC::serializeTCPDFtagParameters( $params );
89
- $method = ( '1D' === $atts['dimension'] ? 'write1DBarcode' : 'write2DBarcode' );
90
- return '<tcpdf method="' . $method . '" params="' . $params . '" />';
91
  }
92
  }
93
 
@@ -95,7 +121,7 @@ if ( ! function_exists( 'wcj_barcode' ) ) {
95
  /**
96
  * wcj_barcode.
97
  *
98
- * @version 3.3.0
99
  * @since 3.3.0
100
  * @todo (maybe) "Barcodes" module
101
  * @todo (maybe) `getBarcodePNG()`
@@ -114,10 +140,10 @@ if ( ! function_exists( 'wcj_barcode' ) ) {
114
  $atts['height'] = ( '1D' === $atts['dimension'] ? 30 : 10 );
115
  }
116
  if ( '1D' === $atts['dimension'] ) {
117
- require_once( WCJ_PLUGIN_PATH . '/includes/lib/tcpdf_min/tcpdf_barcodes_1d.php' );
118
  $barcode = new TCPDFBarcode( $atts['code'], $atts['type'] );
119
  } else {
120
- require_once( WCJ_PLUGIN_PATH . '/includes/lib/tcpdf_min/tcpdf_barcodes_2d.php' );
121
  $barcode = new TCPDF2DBarcode( $atts['code'], $atts['type'] );
122
  }
123
  $barcode_array = $barcode->getBarcodeArray();
@@ -150,13 +176,13 @@ if ( ! function_exists( 'wcj_session_maybe_start' ) ) {
150
  /**
151
  * wcj_session_maybe_start.
152
  *
153
- * @version 3.1.0
154
  * @since 3.1.0
155
  */
156
  function wcj_session_maybe_start() {
157
  switch ( WCJ_SESSION_TYPE ) {
158
  case 'wc':
159
- if ( ! WC()->session->has_session() ) {
160
  WC()->session->set_customer_session_cookie( true );
161
  }
162
  break;
@@ -173,13 +199,15 @@ if ( ! function_exists( 'wcj_session_set' ) ) {
173
  /**
174
  * wcj_session_set.
175
  *
176
- * @version 3.1.0
177
  * @since 3.1.0
178
  */
179
  function wcj_session_set( $key, $value ) {
180
  switch ( WCJ_SESSION_TYPE ) {
181
  case 'wc':
182
- WC()->session->set( $key, $value );
 
 
183
  break;
184
  default: // 'standard'
185
  $_SESSION[ $key ] = $value;
@@ -192,13 +220,13 @@ if ( ! function_exists( 'wcj_session_get' ) ) {
192
  /**
193
  * wcj_session_get.
194
  *
195
- * @version 3.1.0
196
  * @since 3.1.0
197
  */
198
  function wcj_session_get( $key, $default = null ) {
199
  switch ( WCJ_SESSION_TYPE ) {
200
  case 'wc':
201
- return WC()->session->get( $key, $default );
202
  default: // 'standard'
203
  return ( isset( $_SESSION[ $key ] ) ? $_SESSION[ $key ] : $default );
204
  }
@@ -466,7 +494,7 @@ if ( ! function_exists( 'wcj_get_left_to_free_shipping' ) ) {
466
  /*
467
  * wcj_get_left_to_free_shipping.
468
  *
469
- * @version 3.3.0
470
  * @since 2.4.4
471
  * @return string
472
  */
@@ -475,7 +503,8 @@ if ( ! function_exists( 'wcj_get_left_to_free_shipping' ) ) {
475
  foreach ( $packages as $i => $package ) {
476
  $available_shipping_methods = $package['rates'];
477
  foreach ( $available_shipping_methods as $available_shipping_method ) {
478
- if ( 'free_shipping' === $available_shipping_method->get_method_id() ) {
 
479
  return do_shortcode( get_option( 'wcj_shipping_left_to_free_info_content_reached', __( 'You have Free delivery', 'woocommerce-jetpack' ) ) );
480
  }
481
  }
2
  /**
3
  * Booster for WooCommerce - Functions
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  * @todo add `wcj_add_actions()` and `wcj_add_filters()`
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
+ if ( ! function_exists( 'wcj_handle_replacements' ) ) {
13
+ /**
14
+ * wcj_handle_replacements.
15
+ *
16
+ * @version 3.4.0
17
+ * @since 3.4.0
18
+ */
19
+ function wcj_handle_replacements( $replacements, $template ) {
20
+ return str_replace( array_keys( $replacements ), $replacements, $template );
21
+ }
22
+ }
23
+
24
  if ( ! function_exists( 'wcj_get_js_confirmation' ) ) {
25
  /**
26
  * wcj_get_js_confirmation.
27
  *
28
+ * @version 3.4.0
29
  * @since 3.3.0
30
  * @todo use where needed
31
  */
32
+ function wcj_get_js_confirmation( $confirmation_message = '' ) {
33
+ if ( '' === $confirmation_message ) {
34
+ $confirmation_message = __( 'Are you sure?', 'woocommerce-jetpack' );
35
+ }
36
+ return ' onclick="return confirm(\'' . $confirmation_message . '\')"';
37
+ }
38
+ }
39
+
40
+ if ( ! function_exists( 'wcj_tcpdf_method' ) ) {
41
+ /**
42
+ * wcj_tcpdf_method.
43
+ *
44
+ * @version 3.4.0
45
+ * @since 3.4.0
46
+ */
47
+ function wcj_tcpdf_method( $method, $params ) {
48
+ require_once( WCJ_PLUGIN_PATH . '/includes/lib/tcpdf/include/tcpdf_static.php' );
49
+ $params = TCPDF_STATIC::serializeTCPDFtagParameters( $params );
50
+ return '<tcpdf method="' . $method . '" params="' . $params . '" />';
51
  }
52
  }
53
 
55
  /**
56
  * wcj_tcpdf_barcode.
57
  *
58
+ * @version 3.4.0
59
  * @since 3.3.0
60
  * @todo `color`
61
  * @todo `align` (try 'T')
113
  false, // distort
114
  );
115
  }
116
+ return wcj_tcpdf_method( ( '1D' === $atts['dimension'] ? 'write1DBarcode' : 'write2DBarcode' ), $params );
 
 
 
117
  }
118
  }
119
 
121
  /**
122
  * wcj_barcode.
123
  *
124
+ * @version 3.4.0
125
  * @since 3.3.0
126
  * @todo (maybe) "Barcodes" module
127
  * @todo (maybe) `getBarcodePNG()`
140
  $atts['height'] = ( '1D' === $atts['dimension'] ? 30 : 10 );
141
  }
142
  if ( '1D' === $atts['dimension'] ) {
143
+ require_once( WCJ_PLUGIN_PATH . '/includes/lib/tcpdf/tcpdf_barcodes_1d.php' );
144
  $barcode = new TCPDFBarcode( $atts['code'], $atts['type'] );
145
  } else {
146
+ require_once( WCJ_PLUGIN_PATH . '/includes/lib/tcpdf/tcpdf_barcodes_2d.php' );
147
  $barcode = new TCPDF2DBarcode( $atts['code'], $atts['type'] );
148
  }
149
  $barcode_array = $barcode->getBarcodeArray();
176
  /**
177
  * wcj_session_maybe_start.
178
  *
179
+ * @version 3.4.0
180
  * @since 3.1.0
181
  */
182
  function wcj_session_maybe_start() {
183
  switch ( WCJ_SESSION_TYPE ) {
184
  case 'wc':
185
+ if ( function_exists( 'WC' ) && WC()->session && ! WC()->session->has_session() ) {
186
  WC()->session->set_customer_session_cookie( true );
187
  }
188
  break;
199
  /**
200
  * wcj_session_set.
201
  *
202
+ * @version 3.4.0
203
  * @since 3.1.0
204
  */
205
  function wcj_session_set( $key, $value ) {
206
  switch ( WCJ_SESSION_TYPE ) {
207
  case 'wc':
208
+ if ( function_exists( 'WC' ) && WC()->session ) {
209
+ WC()->session->set( $key, $value );
210
+ }
211
  break;
212
  default: // 'standard'
213
  $_SESSION[ $key ] = $value;
220
  /**
221
  * wcj_session_get.
222
  *
223
+ * @version 3.4.0
224
  * @since 3.1.0
225
  */
226
  function wcj_session_get( $key, $default = null ) {
227
  switch ( WCJ_SESSION_TYPE ) {
228
  case 'wc':
229
+ return ( function_exists( 'WC' ) && WC()->session ? WC()->session->get( $key, $default ) : $default );
230
  default: // 'standard'
231
  return ( isset( $_SESSION[ $key ] ) ? $_SESSION[ $key ] : $default );
232
  }
494
  /*
495
  * wcj_get_left_to_free_shipping.
496
  *
497
+ * @version 3.4.0
498
  * @since 2.4.4
499
  * @return string
500
  */
503
  foreach ( $packages as $i => $package ) {
504
  $available_shipping_methods = $package['rates'];
505
  foreach ( $available_shipping_methods as $available_shipping_method ) {
506
+ $method_id = ( WCJ_IS_WC_VERSION_BELOW_3_2_0 ? $available_shipping_method->method_id : $available_shipping_method->get_method_id() );
507
+ if ( 'free_shipping' === $method_id ) {
508
  return do_shortcode( get_option( 'wcj_shipping_left_to_free_info_content_reached', __( 'You have Free delivery', 'woocommerce-jetpack' ) ) );
509
  }
510
  }
includes/functions/wcj-functions-invoicing.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Invoicing
4
  *
5
- * @version 3.2.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -12,6 +12,8 @@ if ( ! function_exists( 'wcj_get_fonts_list' ) ) {
12
  *
13
  * @version 2.9.0
14
  * @since 2.9.0
 
 
15
  */
16
  function wcj_get_fonts_list() {
17
  return array(
@@ -105,6 +107,7 @@ if ( ! function_exists( 'wcj_get_tcpdf_fonts_version' ) ) {
105
  *
106
  * @version 2.9.0
107
  * @since 2.9.0
 
108
  */
109
  function wcj_get_tcpdf_fonts_version() {
110
  return '2.9.0';
@@ -200,7 +203,7 @@ if ( ! function_exists( 'wcj_get_invoice_types' ) ) {
200
  /*
201
  * wcj_get_invoice_types.
202
  *
203
- * @version 3.1.0
204
  */
205
  function wcj_get_invoice_types() {
206
  $invoice_types = array(
@@ -229,7 +232,7 @@ if ( ! function_exists( 'wcj_get_invoice_types' ) ) {
229
  'color' => 'red',
230
  ),
231
  );
232
- $total_custom_docs = get_option( 'wcj_invoicing_custom_doc_total_number', 1 );
233
  for ( $i = 1; $i <= $total_custom_docs; $i++ ) {
234
  $invoice_types[] = array(
235
  'id' => ( 1 == $i ? 'custom_doc' : 'custom_doc' . '_' . $i ),
2
  /**
3
  * Booster for WooCommerce - Functions - Invoicing
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
12
  *
13
  * @version 2.9.0
14
  * @since 2.9.0
15
+ * @todo (maybe) update existing fonts files
16
+ * @todo (maybe) add more fonts
17
  */
18
  function wcj_get_fonts_list() {
19
  return array(
107
  *
108
  * @version 2.9.0
109
  * @since 2.9.0
110
+ * @todo (maybe) save old (i.e. fallback) versions
111
  */
112
  function wcj_get_tcpdf_fonts_version() {
113
  return '2.9.0';
203
  /*
204
  * wcj_get_invoice_types.
205
  *
206
+ * @version 3.4.0
207
  */
208
  function wcj_get_invoice_types() {
209
  $invoice_types = array(
232
  'color' => 'red',
233
  ),
234
  );
235
+ $total_custom_docs = min( get_option( 'wcj_invoicing_custom_doc_total_number', 1 ), 100 );
236
  for ( $i = 1; $i <= $total_custom_docs; $i++ ) {
237
  $invoice_types[] = array(
238
  'id' => ( 1 == $i ? 'custom_doc' : 'custom_doc' . '_' . $i ),
includes/functions/wcj-functions-orders.php CHANGED
@@ -2,13 +2,43 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Orders
4
  *
5
- * @version 3.2.4
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  if ( ! function_exists( 'wcj_get_order_status' ) ) {
13
  /**
14
  * wcj_get_order_status.
2
  /**
3
  * Booster for WooCommerce - Functions - Orders
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit;
11
 
12
+ if ( ! function_exists( 'wcj_get_adjacent_order_id' ) ) {
13
+ /**
14
+ * wcj_get_adjacent_order_id.
15
+ *
16
+ * @version 3.4.0
17
+ * @since 3.4.0
18
+ * @todo isn't there an easier way?
19
+ */
20
+ function wcj_get_adjacent_order_id( $current_id, $direction = 'next' ) {
21
+ $args = array(
22
+ 'post_type' => 'shop_order',
23
+ 'post_status' => array_keys( wc_get_order_statuses() ),
24
+ 'posts_per_page' => -1,
25
+ 'orderby' => 'ID',
26
+ 'order' => 'ASC',
27
+ 'fields' => 'ids',
28
+ );
29
+ $loop = new WP_Query( $args );
30
+ if ( $loop->have_posts() ) {
31
+ foreach ( $loop->posts as $post_id ) {
32
+ if ( $current_id == $post_id ) {
33
+ return $direction( $loop->posts );
34
+ }
35
+ next( $loop->posts );
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+ }
41
+
42
  if ( ! function_exists( 'wcj_get_order_status' ) ) {
43
  /**
44
  * wcj_get_order_status.
includes/functions/wcj-functions-price-currency.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Price and Currency
4
  *
5
- * @version 3.3.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -389,14 +389,14 @@ if ( ! function_exists( 'wcj_get_current_currency_code' ) ) {
389
  /**
390
  * wcj_get_current_currency_code.
391
  *
392
- * @version 2.5.0
393
  * @since 2.5.0
394
  */
395
  function wcj_get_current_currency_code( $module ) {
396
  $current_currency_code = get_woocommerce_currency();
397
  if ( wcj_is_module_enabled( $module ) ) {
398
  if ( 'multicurrency' === $module ) {
399
- $current_currency_code = ( isset( $_SESSION['wcj-currency'] ) ) ? $_SESSION['wcj-currency'] : $current_currency_code;
400
  }
401
  }
402
  return $current_currency_code;
2
  /**
3
  * Booster for WooCommerce - Functions - Price and Currency
4
  *
5
+ * @version 3.4.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
389
  /**
390
  * wcj_get_current_currency_code.
391
  *
392
+ * @version 3.4.0
393
  * @since 2.5.0
394
  */
395
  function wcj_get_current_currency_code( $module ) {
396
  $current_currency_code = get_woocommerce_currency();
397
  if ( wcj_is_module_enabled( $module ) ) {
398
  if ( 'multicurrency' === $module ) {
399
+ $current_currency_code = ( null !== ( $session_value = wcj_session_get( 'wcj-currency' ) ) ? $session_value : $current_currency_code );
400
  }
401
  }
402
  return $current_currency_code;
includes/functions/wcj-functions-products.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Products
4
  *
5
- * @version 3.3.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -136,10 +136,11 @@ if ( ! function_exists( 'wcj_get_product_display_price' ) ) {
136
  /**
137
  * wcj_get_product_display_price.
138
  *
139
- * @version 2.8.0
140
  * @since 2.7.0
 
141
  */
142
- function wcj_get_product_display_price( $_product, $price = '', $qty = 1 ) {
143
  if ( WCJ_IS_WC_VERSION_BELOW_3 ) {
144
  return $_product->get_display_price( $price, $qty );
145
  } else {
@@ -148,7 +149,14 @@ if ( ! function_exists( 'wcj_get_product_display_price' ) ) {
148
  $minus_sign = '-';
149
  $price *= -1;
150
  }
151
- return $minus_sign . wc_get_price_to_display( $_product, array( 'price' => $price, 'qty' => $qty ) );
 
 
 
 
 
 
 
152
  }
153
  }
154
  }
2
  /**
3
  * Booster for WooCommerce - Functions - Products
4
  *
5
+ * @version 3.4.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
136
  /**
137
  * wcj_get_product_display_price.
138
  *
139
+ * @version 3.4.0
140
  * @since 2.7.0
141
+ * @todo `$scope` in `WCJ_IS_WC_VERSION_BELOW_3` (i.e. `cart`)
142
  */
143
+ function wcj_get_product_display_price( $_product, $price = '', $qty = 1, $scope = 'shop' ) {
144
  if ( WCJ_IS_WC_VERSION_BELOW_3 ) {
145
  return $_product->get_display_price( $price, $qty );
146
  } else {
149
  $minus_sign = '-';
150
  $price *= -1;
151
  }
152
+ if ( 'cart' === $scope ) {
153
+ $display_price = ( 'incl' === get_option( 'woocommerce_tax_display_cart' ) ?
154
+ wc_get_price_including_tax( $_product, array( 'price' => $price, 'qty' => $qty ) ) :
155
+ wc_get_price_excluding_tax( $_product, array( 'price' => $price, 'qty' => $qty ) ) );
156
+ } else { // 'shop'
157
+ $display_price = wc_get_price_to_display( $_product, array( 'price' => $price, 'qty' => $qty ) );
158
+ }
159
+ return $minus_sign . $display_price;
160
  }
161
  }
162
  }
includes/functions/wcj-functions-users.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Users
4
  *
5
- * @version 3.2.2
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -42,10 +42,13 @@ if ( ! function_exists( 'wcj_get_current_user_all_roles' ) ) {
42
  /**
43
  * wcj_get_current_user_all_roles.
44
  *
45
- * @version 2.5.6
46
  * @since 2.5.6
47
  */
48
  function wcj_get_current_user_all_roles() {
 
 
 
49
  $current_user = wp_get_current_user();
50
  return ( ! empty( $current_user->roles ) ) ? $current_user->roles : array( 'guest' );
51
  }
2
  /**
3
  * Booster for WooCommerce - Functions - Users
4
  *
5
+ * @version 3.4.0
6
  * @since 2.7.0
7
  * @author Algoritmika Ltd.
8
  */
42
  /**
43
  * wcj_get_current_user_all_roles.
44
  *
45
+ * @version 3.4.0
46
  * @since 2.5.6
47
  */
48
  function wcj_get_current_user_all_roles() {
49
+ if ( ! function_exists( 'wp_get_current_user' ) ) {
50
+ require_once( ABSPATH . 'wp-includes/pluggable.php' );
51
+ }
52
  $current_user = wp_get_current_user();
53
  return ( ! empty( $current_user->roles ) ) ? $current_user->roles : array( 'guest' );
54
  }
includes/input-fields/class-wcj-product-input-fields-core.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Product Input Fields - Core
4
  *
5
- * @version 3.2.4
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -18,7 +18,7 @@ class WCJ_Product_Input_Fields_Core {
18
  /**
19
  * Constructor.
20
  *
21
- * @version 3.1.0
22
  * @todo save all info in product meta
23
  */
24
  function __construct( $scope ) {
@@ -44,7 +44,11 @@ class WCJ_Product_Input_Fields_Core {
44
  add_filter( 'woocommerce_order_item_name', array( $this, 'add_product_input_fields_to_order_item_name' ), 100, 2 );
45
 
46
  // Add item meta from cart to order
47
- add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_product_input_fields_to_order_item_meta' ), 100, 3 );
 
 
 
 
48
 
49
  // Make nicer name for product input fields in order at backend (shop manager)
50
  add_action( 'woocommerce_after_order_itemmeta', array( $this, 'output_custom_input_fields_in_admin_order' ), 100, 3 );
@@ -411,7 +415,7 @@ class WCJ_Product_Input_Fields_Core {
411
  /**
412
  * add_product_input_fields_to_frontend.
413
  *
414
- * @version 3.2.4
415
  * @todo `$set_value` - add "default" option for all other types except checkbox
416
  * @todo `$set_value` - 'file' type
417
  * @todo add `required` attributes
@@ -477,6 +481,12 @@ class WCJ_Product_Input_Fields_Core {
477
  );
478
 
479
  $html = '';
 
 
 
 
 
 
480
  switch ( $type ) {
481
 
482
  case 'number':
@@ -485,7 +495,7 @@ class WCJ_Product_Input_Fields_Core {
485
  case 'password':
486
  case 'email':
487
  case 'tel':
488
- $html = '<input value="' . $set_value . '" class="wcj_product_input_fields" id="' . $field_name . '" type="' . $type . '" name="' .
489
  $field_name . '" placeholder="' . $placeholder . '"' . $custom_attributes . '>';
490
  break;
491
 
@@ -495,33 +505,33 @@ class WCJ_Product_Input_Fields_Core {
495
  'on',
496
  false
497
  );
498
- $html = '<input class="wcj_product_input_fields" id="' . $field_name . '" type="' . $type . '" name="' . $field_name . '"' .
499
  $custom_attributes . $checked . '>';
500
  break;
501
 
502
  case 'datepicker':
503
- $html = '<input value="' . $set_value . '" class="wcj_product_input_fields" id="' . $field_name . '" ' . $datepicker_year . 'firstday="' .
504
  $datepicker_firstday . '" dateformat="' . $datepicker_format . '" mindate="' .
505
  $datepicker_mindate . '" maxdate="' . $datepicker_maxdate . '" type="' .
506
  $type . '" display="date" name="' . $field_name . '" placeholder="' . $placeholder . '"' . $custom_attributes . '>';
507
  break;
508
 
509
  case 'weekpicker':
510
- $html = '<input value="' . $set_value . '" class="wcj_product_input_fields" id="' . $field_name . '" ' . $datepicker_year . 'firstday="' .
511
  $datepicker_firstday . '" dateformat="' . $datepicker_format . '" mindate="' .
512
  $datepicker_mindate . '" maxdate="' . $datepicker_maxdate . '" type="' .
513
  $type . '" display="week" name="' . $field_name . '" placeholder="' . $placeholder . '"' . $custom_attributes . '>';
514
  break;
515
 
516
  case 'timepicker':
517
- $html = '<input value="' . $set_value . '" class="wcj_product_input_fields" id="' . $field_name . '"' .
518
  $timepicker_mintime . $timepicker_maxtime . ' interval="' . $timepicker_interval . '" timeformat="' .
519
  $timepicker_format . '" type="' . $type . '" display="time" name="' . $field_name . '" placeholder="' .
520
  $placeholder . '"' . $custom_attributes . '>';
521
  break;
522
 
523
  case 'textarea':
524
- $html = '<textarea class="wcj_product_input_fields" id="' . $field_name . '" name="' . $field_name . '" placeholder="' . $placeholder . '">' .
525
  $set_value . '</textarea>';
526
  break;
527
 
@@ -541,7 +551,7 @@ class WCJ_Product_Input_Fields_Core {
541
  $select_options_html .= '</option>';
542
  }
543
  }
544
- $html = '<select class="wcj_product_input_fields" id="' . $field_name . '" name="' . $field_name . '">' . $select_options_html . '</select>';
545
  break;
546
 
547
  case 'radio':
@@ -555,7 +565,7 @@ class WCJ_Product_Input_Fields_Core {
555
  '%radio_field_html%<label for="%radio_field_id%" class="radio">%radio_field_title%</label><br>' );
556
  foreach ( $select_options as $option_key => $option_text ) {
557
  $replaced_values = array(
558
- '%radio_field_html%' => '<input type="radio" class="input-radio wcj_product_input_fields" value="' . esc_attr( $option_key ) .
559
  '" name="' . $field_name . '" id="' . $field_name . '_' . esc_attr( $option_key ) . '"' . checked( $value, $option_key, false ) . ' />',
560
  '%radio_field_id%' => $field_name . '_' . esc_attr( $option_key ),
561
  '%radio_field_title%' => $option_text,
@@ -570,7 +580,7 @@ class WCJ_Product_Input_Fields_Core {
570
  $countries = WC()->countries->get_allowed_countries();
571
  if ( sizeof( $countries ) > 1 ) {
572
  $value = ( '' != $set_value ? $set_value : key( $countries ) );
573
- $field = '<select name="' . $field_name . '" id="' . $field_name . '" class="country_to_state country_select wcj_product_input_fields">' .
574
  '<option value="">'.__( 'Select a country&hellip;', 'woocommerce' ) .'</option>';
575
  foreach ( $countries as $ckey => $cvalue ) {
576
  $field .= '<option value="' . esc_attr( $ckey ) . '" '.selected( $value, $ckey, false ) .'>'.__( $cvalue, 'woocommerce' ) .'</option>';
@@ -605,7 +615,9 @@ class WCJ_Product_Input_Fields_Core {
605
  }
606
 
607
  /**
608
- * add_product_input_fields_to_cart_item_data - from $_POST to $cart_item_data
 
 
609
  *
610
  * @version 3.1.0
611
  */
@@ -754,6 +766,19 @@ class WCJ_Product_Input_Fields_Core {
754
  return $item_data;
755
  }
756
 
 
 
 
 
 
 
 
 
 
 
 
 
 
757
  /**
758
  * add_product_input_fields_to_order_item_meta.
759
  *
2
  /**
3
  * Booster for WooCommerce - Product Input Fields - Core
4
  *
5
+ * @version 3.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
18
  /**
19
  * Constructor.
20
  *
21
+ * @version 3.4.0
22
  * @todo save all info in product meta
23
  */
24
  function __construct( $scope ) {
44
  add_filter( 'woocommerce_order_item_name', array( $this, 'add_product_input_fields_to_order_item_name' ), 100, 2 );
45
 
46
  // Add item meta from cart to order
47
+ if ( WCJ_IS_WC_VERSION_BELOW_3 ) {
48
+ add_action( 'woocommerce_add_order_item_meta', array( $this, 'add_product_input_fields_to_order_item_meta' ), 100, 3 );
49
+ } else {
50
+ add_action( 'woocommerce_new_order_item', array( $this, 'add_product_input_fields_to_order_item_meta_wc3' ), 100, 3 );
51
+ }
52
 
53
  // Make nicer name for product input fields in order at backend (shop manager)
54
  add_action( 'woocommerce_after_order_itemmeta', array( $this, 'output_custom_input_fields_in_admin_order' ), 100, 3 );
415
  /**
416
  * add_product_input_fields_to_frontend.
417
  *
418
+ * @version 3.4.0
419
  * @todo `$set_value` - add "default" option for all other types except checkbox
420
  * @todo `$set_value` - 'file' type
421
  * @todo add `required` attributes
481
  );
482
 
483
  $html = '';
484
+
485
+ $class = $this->get_value( 'wcj_product_input_fields_class_' . $this->scope . '_' . $i, $_product_id, '' );
486
+ if ( '' != $class ) {
487
+ $class = ' ' . $class;
488
+ }
489
+
490
  switch ( $type ) {
491
 
492
  case 'number':
495
  case 'password':
496
  case 'email':
497
  case 'tel':
498
+ $html = '<input value="' . $set_value . '" class="wcj_product_input_fields' . $class . '" id="' . $field_name . '" type="' . $type . '" name="' .
499
  $field_name . '" placeholder="' . $placeholder . '"' . $custom_attributes . '>';
500
  break;
501
 
505
  'on',
506
  false
507
  );
508
+ $html = '<input class="wcj_product_input_fields' . $class . '" id="' . $field_name . '" type="' . $type . '" name="' . $field_name . '"' .
509
  $custom_attributes . $checked . '>';
510
  break;
511
 
512
  case 'datepicker':
513
+ $html = '<input value="' . $set_value . '" class="wcj_product_input_fields' . $class . '" id="' . $field_name . '" ' . $datepicker_year . 'firstday="' .
514
  $datepicker_firstday . '" dateformat="' . $datepicker_format . '" mindate="' .
515
  $datepicker_mindate . '" maxdate="' . $datepicker_maxdate . '" type="' .
516
  $type . '" display="date" name="' . $field_name . '" placeholder="' . $placeholder . '"' . $custom_attributes . '>';
517
  break;
518
 
519
  case 'weekpicker':
520
+ $html = '<input value="' . $set_value . '" class="wcj_product_input_fields' . $class . '" id="' . $field_name . '" ' . $datepicker_year . 'firstday="' .
521
  $datepicker_firstday . '" dateformat="' . $datepicker_format . '" mindate="' .
522
  $datepicker_mindate . '" maxdate="' . $datepicker_maxdate . '" type="' .
523
  $type . '" display="week" name="' . $field_name . '" placeholder="' . $placeholder . '"' . $custom_attributes . '>';
524
  break;
525
 
526
  case 'timepicker':
527
+ $html = '<input value="' . $set_value . '" class="wcj_product_input_fields' . $class . '" id="' . $field_name . '"' .
528
  $timepicker_mintime . $timepicker_maxtime . ' interval="' . $timepicker_interval . '" timeformat="' .
529
  $timepicker_format . '" type="' . $type . '" display="time" name="' . $field_name . '" placeholder="' .
530
  $placeholder . '"' . $custom_attributes . '>';
531
  break;
532
 
533
  case 'textarea':
534
+ $html = '<textarea class="wcj_product_input_fields' . $class . '" id="' . $field_name . '" name="' . $field_name . '" placeholder="' . $placeholder . '">' .
535
  $set_value . '</textarea>';
536
  break;
537
 
551
  $select_options_html .= '</option>';
552
  }
553
  }
554
+ $html = '<select class="wcj_product_input_fields' . $class . '" id="' . $field_name . '" name="' . $field_name . '">' . $select_options_html . '</select>';
555
  break;
556
 
557
  case 'radio':
565
  '%radio_field_html%<label for="%radio_field_id%" class="radio">%radio_field_title%</label><br>' );
566
  foreach ( $select_options as $option_key => $option_text ) {
567
  $replaced_values = array(
568
+ '%radio_field_html%' => '<input type="radio" class="input-radio wcj_product_input_fields' . $class . '" value="' . esc_attr( $option_key ) .
569
  '" name="' . $field_name . '" id="' . $field_name . '_' . esc_attr( $option_key ) . '"' . checked( $value, $option_key, false ) . ' />',
570
  '%radio_field_id%' => $field_name . '_' . esc_attr( $option_key ),
571
  '%radio_field_title%' => $option_text,
580
  $countries = WC()->countries->get_allowed_countries();
581
  if ( sizeof( $countries ) > 1 ) {
582
  $value = ( '' != $set_value ? $set_value : key( $countries ) );
583
+ $field = '<select name="' . $field_name . '" id="' . $field_name . '" class="country_to_state country_select wcj_product_input_fields' . $class . '">' .
584
  '<option value="">'.__( 'Select a country&hellip;', 'woocommerce' ) .'</option>';
585
  foreach ( $countries as $ckey => $cvalue ) {
586
  $field .= '<option value="' . esc_attr( $ckey ) . '" '.selected( $value, $ckey, false ) .'>'.__( $cvalue, 'woocommerce' ) .'</option>';
615
  }
616
 
617
  /**
618
+ * add_product_input_fields_to_cart_item_data.
619
+ *
620
+ * from `$_POST` to `$cart_item_data`
621
  *
622
  * @version 3.1.0
623
  */
766
  return $item_data;
767
  }
768
 
769
+ /**
770
+ * add_product_input_fields_to_order_item_meta_wc3.
771
+ *
772
+ * @version 3.4.0
773
+ * @since 3.4.0
774
+ * @todo this is only a temporary solution: must replace `$item->legacy_values` (check "Bookings" module)
775
+ */
776
+ function add_product_input_fields_to_order_item_meta_wc3( $item_id, $item, $order_id ) {
777
+ if ( is_a( $item, 'WC_Order_Item_Product' ) ) {
778
+ $this->add_product_input_fields_to_order_item_meta( $item_id, $item->legacy_values, null );
779
+ }
780
+ }
781
+
782
  /**
783
  * add_product_input_fields_to_order_item_meta.
784
  *
includes/input-fields/wcj-product-input-fields-options.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Product Input Fields - Options
4
  *
5
- * @version 3.1.0
6
  * @since 3.1.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -70,6 +70,12 @@ return array(
70
  'type' => 'textarea',
71
  'default' => '',
72
  ),
 
 
 
 
 
 
73
  /* array(
74
  'id' => 'wcj_product_input_fields_type_checkbox_' . $this->scope . '_',
75
  'title' => __( 'If checkbox is selected, set possible pairs here.', 'woocommerce-jetpack' ),
2
  /**
3
  * Booster for WooCommerce - Product Input Fields - Options
4
  *
5
+ * @version 3.4.0
6
  * @since 3.1.0
7
  * @author Algoritmika Ltd.
8
  */
70
  'type' => 'textarea',
71
  'default' => '',
72
  ),
73
+ array(
74
+ 'id' => 'wcj_product_input_fields_class_' . $this->scope . '_',
75
+ 'title' => __( 'HTML Class', 'woocommerce-jetpack' ),
76
+ 'type' => 'text',
77
+ 'default' => '',
78
+ ),
79
  /* array(
80
  'id' => 'wcj_product_input_fields_type_checkbox_' . $this->scope . '_',
81
  'title' => __( 'If checkbox is selected, set possible pairs here.', 'woocommerce-jetpack' ),
includes/js/wcj-checkout.js CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  jQuery( function( $ ) {
2
  // Define that JavaScript code should be executed in "strict mode"
3
  "use strict";
1
+ /*
2
+ * wcj-checkout.js
3
+ */
4
  jQuery( function( $ ) {
5
  // Define that JavaScript code should be executed in "strict mode"
6
  "use strict";
includes/js/wcj-shipping-calculator.js CHANGED
@@ -9,11 +9,11 @@ jQuery(document).ready(change_labels);
9
  jQuery(document).ajaxComplete(change_labels);
10
  function change_labels() {
11
  jQuery("a.shipping-calculator-button").each( function () {
12
- jQuery(this).text( alg_object.calculate_shipping_label );
13
  jQuery(this).css( "visibility", "visible" );
14
  });
15
  jQuery("button[name=calc_shipping]").each( function () {
16
- jQuery(this).text( alg_object.update_totals_label );
17
  jQuery(this).css( "visibility", "visible" );
18
  });
19
  }
9
  jQuery(document).ajaxComplete(change_labels);
10
  function change_labels() {
11
  jQuery("a.shipping-calculator-button").each( function () {
12
+ jQuery(this).text( wcj_object.calculate_shipping_label );
13
  jQuery(this).css( "visibility", "visible" );
14
  });
15
  jQuery("button[name=calc_shipping]").each( function () {
16
+ jQuery(this).text( wcj_object.update_totals_label );
17
  jQuery(this).css( "visibility", "visible" );
18
  });
19
  }
includes/lib/PHPMathParser/Expressions.php CHANGED
@@ -2,11 +2,11 @@
2
 
3
  //namespace PHPMathParser;
4
 
5
- class Alg_Parenthesis extends Alg_TerminalExpression {
6
 
7
  protected $precedence = 6;
8
 
9
- public function operate(Alg_Stack $stack) {
10
  }
11
 
12
  public function getPrecedence() {
@@ -27,15 +27,15 @@ class Alg_Parenthesis extends Alg_TerminalExpression {
27
 
28
  }
29
 
30
- class Alg_Number extends Alg_TerminalExpression {
31
 
32
- public function operate(Alg_Stack $stack) {
33
  return $this->value;
34
  }
35
 
36
  }
37
 
38
- abstract class Alg_Operator extends Alg_TerminalExpression {
39
 
40
  protected $precedence = 0;
41
  protected $leftAssoc = true;
@@ -54,21 +54,21 @@ abstract class Alg_Operator extends Alg_TerminalExpression {
54
 
55
  }
56
 
57
- class Alg_Addition extends Alg_Operator {
58
 
59
  protected $precedence = 4;
60
 
61
- public function operate(Alg_Stack $stack) {
62
  return $stack->pop()->operate($stack) + $stack->pop()->operate($stack);
63
  }
64
 
65
  }
66
 
67
- class Alg_Subtraction extends Alg_Operator {
68
 
69
  protected $precedence = 4;
70
 
71
- public function operate(Alg_Stack $stack) {
72
  $left = $stack->pop()->operate($stack);
73
  $right = $stack->pop()->operate($stack);
74
  return $right - $left;
@@ -76,21 +76,21 @@ class Alg_Subtraction extends Alg_Operator {
76
 
77
  }
78
 
79
- class Alg_Multiplication extends Alg_Operator {
80
 
81
  protected $precedence = 5;
82
 
83
- public function operate(Alg_Stack $stack) {
84
  return $stack->pop()->operate($stack) * $stack->pop()->operate($stack);
85
  }
86
 
87
  }
88
 
89
- class Alg_Division extends Alg_Operator {
90
 
91
  protected $precedence = 5;
92
 
93
- public function operate(Alg_Stack $stack) {
94
  $left = $stack->pop()->operate($stack);
95
  $right = $stack->pop()->operate($stack);
96
  return $right / $left;
@@ -98,11 +98,11 @@ class Alg_Division extends Alg_Operator {
98
 
99
  }
100
 
101
- class Alg_Power extends Alg_Operator {
102
 
103
  protected $precedence = 5;
104
 
105
- public function operate(Alg_Stack $stack) {
106
  $left = $stack->pop()->operate($stack);
107
  $right = $stack->pop()->operate($stack);
108
  return pow($left,$right);
2
 
3
  //namespace PHPMathParser;
4
 
5
+ class WCJ_Parenthesis extends WCJ_TerminalExpression {
6
 
7
  protected $precedence = 6;
8
 
9
+ public function operate(WCJ_Stack $stack) {
10
  }
11
 
12
  public function getPrecedence() {
27
 
28
  }
29
 
30
+ class WCJ_Number extends WCJ_TerminalExpression {
31
 
32
+ public function operate(WCJ_Stack $stack) {
33
  return $this->value;
34
  }
35
 
36
  }
37
 
38
+ abstract class WCJ_Operator extends WCJ_TerminalExpression {
39
 
40
  protected $precedence = 0;
41
  protected $leftAssoc = true;
54
 
55
  }
56
 
57
+ class WCJ_Addition extends WCJ_Operator {
58
 
59
  protected $precedence = 4;
60
 
61
+ public function operate(WCJ_Stack $stack) {
62
  return $stack->pop()->operate($stack) + $stack->pop()->operate($stack);
63
  }
64
 
65
  }
66
 
67
+ class WCJ_Subtraction extends WCJ_Operator {
68
 
69
  protected $precedence = 4;
70
 
71
+ public function operate(WCJ_Stack $stack) {
72
  $left = $stack->pop()->operate($stack);
73
  $right = $stack->pop()->operate($stack);
74
  return $right - $left;
76
 
77
  }
78
 
79
+ class WCJ_Multiplication extends WCJ_Operator {
80
 
81
  protected $precedence = 5;
82
 
83
+ public function operate(WCJ_Stack $stack) {
84
  return $stack->pop()->operate($stack) * $stack->pop()->operate($stack);
85
  }
86
 
87
  }
88
 
89
+ class WCJ_Division extends WCJ_Operator {
90
 
91
  protected $precedence = 5;
92
 
93
+ public function operate(WCJ_Stack $stack) {
94
  $left = $stack->pop()->operate($stack);
95
  $right = $stack->pop()->operate($stack);
96
  return $right / $left;
98
 
99
  }
100
 
101
+ class WCJ_Power extends WCJ_Operator {
102
 
103
  protected $precedence = 5;
104
 
105
+ public function operate(WCJ_Stack $stack) {
106
  $left = $stack->pop()->operate($stack);
107
  $right = $stack->pop()->operate($stack);
108
  return pow($left,$right);
includes/lib/PHPMathParser/Math.php CHANGED
@@ -6,7 +6,7 @@ require_once 'Stack.php';
6
  require_once 'TerminalExpression.php';
7
  require_once 'Expressions.php';
8
 
9
- class Alg_Math {
10
 
11
  protected $variables = array();
12
 
@@ -17,11 +17,11 @@ class Alg_Math {
17
 
18
  public function parse($string) {
19
  $tokens = $this->tokenize($string);
20
- $output = new Alg_Stack();
21
- $operators = new Alg_Stack();
22
  foreach ($tokens as $token) {
23
  $token = $this->extractVariables($token);
24
- $expression = Alg_TerminalExpression::factory($token);
25
  if ($expression->isOperator()) {
26
  $this->parseOperator($expression, $output, $operators);
27
  } elseif ($expression->isParenthesis()) {
@@ -43,11 +43,11 @@ class Alg_Math {
43
  $this->variables[$name] = $value;
44
  }
45
 
46
- public function run(Alg_Stack $stack) {
47
  while (($operator = $stack->pop()) && $operator->isOperator()) {
48
  $value = $operator->operate($stack);
49
  if (!is_null($value)) {
50
- $stack->push(Alg_TerminalExpression::factory($value));
51
  }
52
  }
53
  return $operator ? $operator->render() : $this->render($stack);
@@ -61,7 +61,7 @@ class Alg_Math {
61
  return $token;
62
  }
63
 
64
- protected function render(Alg_Stack $stack) {
65
  $output = '';
66
  while (($el = $stack->pop())) {
67
  $output .= $el->render();
@@ -72,7 +72,7 @@ class Alg_Math {
72
  throw new RuntimeException('Could not render output');
73
  }
74
 
75
- protected function parseParenthesis(Alg_TerminalExpression $expression, Alg_Stack $output, Alg_Stack $operators) {
76
  if ($expression->isOpen()) {
77
  $operators->push($expression);
78
  } else {
@@ -91,7 +91,7 @@ class Alg_Math {
91
  }
92
  }
93
 
94
- protected function parseOperator(Alg_TerminalExpression $expression, Alg_Stack $output, Alg_Stack $operators) {
95
  $end = $operators->poke();
96
  if (!$end) {
97
  $operators->push($expression);
6
  require_once 'TerminalExpression.php';
7
  require_once 'Expressions.php';
8
 
9
+ class WCJ_Math {
10
 
11
  protected $variables = array();
12
 
17
 
18
  public function parse($string) {
19
  $tokens = $this->tokenize($string);
20
+ $output = new WCJ_Stack();
21
+ $operators = new WCJ_Stack();
22
  foreach ($tokens as $token) {
23
  $token = $this->extractVariables($token);
24
+ $expression = WCJ_TerminalExpression::factory($token);
25
  if ($expression->isOperator()) {
26
  $this->parseOperator($expression, $output, $operators);
27
  } elseif ($expression->isParenthesis()) {
43
  $this->variables[$name] = $value;
44
  }
45
 
46
+ public function run(WCJ_Stack $stack) {
47
  while (($operator = $stack->pop()) && $operator->isOperator()) {
48
  $value = $operator->operate($stack);
49
  if (!is_null($value)) {
50
+ $stack->push(WCJ_TerminalExpression::factory($value));
51
  }
52
  }
53
  return $operator ? $operator->render() : $this->render($stack);
61
  return $token;
62
  }
63
 
64
+ protected function render(WCJ_Stack $stack) {
65
  $output = '';
66
  while (($el = $stack->pop())) {
67
  $output .= $el->render();
72
  throw new RuntimeException('Could not render output');
73
  }
74
 
75
+ protected function parseParenthesis(WCJ_TerminalExpression $expression, WCJ_Stack $output, WCJ_Stack $operators) {
76
  if ($expression->isOpen()) {
77
  $operators->push($expression);
78
  } else {
91
  }
92
  }
93
 
94
+ protected function parseOperator(WCJ_TerminalExpression $expression, WCJ_Stack $output, WCJ_Stack $operators) {
95
  $end = $operators->poke();
96
  if (!$end) {
97
  $operators->push($expression);
includes/lib/PHPMathParser/Stack.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  //namespace PHPMathParser;
4
 
5
- class Alg_Stack {
6
 
7
  protected $data = array();
8
 
2
 
3
  //namespace PHPMathParser;
4
 
5
+ class WCJ_Stack {
6
 
7
  protected $data = array();
8
 
includes/lib/PHPMathParser/TerminalExpression.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  //namespace PHPMathParser;
4
 
5
- abstract class Alg_TerminalExpression {
6
 
7
  protected $value = '';
8
 
@@ -13,27 +13,27 @@ abstract class Alg_TerminalExpression {
13
  public static function factory($value) {
14
 
15
  // var_dump($value);
16
- if (is_object($value) && $value instanceof Alg_TerminalExpression) {
17
  return $value;
18
  } elseif (is_numeric($value)) {
19
- return new Alg_Number($value);
20
  } elseif ($value == '+') {
21
- return new Alg_Addition($value);
22
  } elseif ($value == '-') {
23
- return new Alg_Subtraction($value);
24
  } elseif ($value == '*') {
25
- return new Alg_Multiplication($value);
26
  } elseif ($value == '/') {
27
- return new Alg_Division($value);
28
  } elseif (in_array($value, array('(', ')'))) {
29
- return new Alg_Parenthesis($value);
30
  } elseif ($value == '^') {
31
- return new Alg_Power($value);
32
  }
33
  throw new Exception('Undefined Value ' . $value);
34
  }
35
 
36
- abstract public function operate(Alg_Stack $stack);
37
 
38
  public function isOperator() {
39
  return false;
2
 
3
  //namespace PHPMathParser;
4
 
5
+ abstract class WCJ_TerminalExpression {
6
 
7
  protected $value = '';
8
 
13
  public static function factory($value) {
14
 
15
  // var_dump($value);
16
+ if (is_object($value) && $value instanceof WCJ_TerminalExpression) {
17
  return $value;
18
  } elseif (is_numeric($value)) {
19
+ return new WCJ_Number($value);
20
  } elseif ($value == '+') {
21
+ return new WCJ_Addition($value);
22
  } elseif ($value == '-') {
23
+ return new WCJ_Subtraction($value);
24
  } elseif ($value == '*') {
25
+ return new WCJ_Multiplication($value);
26
  } elseif ($value == '/') {
27
+ return new WCJ_Division($value);
28
  } elseif (in_array($value, array('(', ')'))) {
29
+ return new WCJ_Parenthesis($value);
30
  } elseif ($value == '^') {
31
+ return new WCJ_Power($value);
32
  }
33
  throw new Exception('Undefined Value ' . $value);
34
  }
35
 
36
+ abstract public function operate(WCJ_Stack $stack);
37
 
38
  public function isOperator() {
39
  return false;
includes/lib/{tcpdf_min → tcpdf}/CHANGELOG.TXT RENAMED
@@ -1,2823 +1,2946 @@
1
- 6.0.084 (2014-06-13)
2
- - A bug related to MultiCell fitcell feature was fixed.
3
- - Bug item #931 "Documentation error for setPageFormat()" was fixed.
4
-
5
- 6.0.083 (2014-05-29)
6
- - Bug item #928 "setHtmlVSpace with HR element" was fixed.
7
-
8
- 6.0.082 (2014-05-23)
9
- - Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed.
10
- - Bug item #925 "924 transparent images bug" was fixed.
11
-
12
- 6.0.081 (2014-05-22)
13
- - Bug item #922 "writehtml tables thead repeating" was fixed.
14
- - Patch #71 "External and internal links, local and remote" wa applied.
15
-
16
- 6.0.080 (2014-05-20)
17
- - Bug item #921 "Fatal error in hyphenateText() function" was fixed.
18
- - Bug item #923 "Automatic Hyphenation error" was fixed.
19
- - Patch #70 "Augument TCPDFBarcode classes with ability to return raw png image data" was applied.
20
-
21
- 6.0.079 (2014-05-19)
22
- - Patch item #69 "Named destinations, HTML internal and external links" was merged.
23
- - Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed.
24
- - Image method now trigs an error in case the cache is now writeable.
25
- - Fixed issue with layer default status.
26
-
27
- 6.0.078 (2014-05-12)
28
- - A warning issue in addTTFfont() method was fixed.
29
- - Fonts were updated to include cbbox metrics.
30
-
31
- 6.0.077 (2014-05-06)
32
- - A Datamatrix barcode bug was fixed.
33
-
34
- 6.0.076 (2014-05-06)
35
- - A bug in Datamatrix Base256 encoding was fixed.
36
- - Merged fix for SVG use/clip-gradient.
37
- - Now it is possible to prefix a page number in Link methods with the * character to avoid been changed when adding/deleting/moving pages (see example_045.php).
38
-
39
- 6.0.075 (2014-05-05)
40
- - Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
41
-
42
- 6.0.074 (2014-05-03)
43
- - Part of Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
44
- - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
45
-
46
- 6.0.073 (2014-04-29)
47
- - Bug #913 "Possible bug with line-height" was fixed.
48
- - Bug #914 "MultiCell and FitCell" was fixed.
49
- - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
50
-
51
- 6.0.072 (2014-04-27)
52
- - Deprecated curly braces substring syntax was replaced with square braces.
53
-
54
- 6.0.071 (2014-04-25)
55
- - Bug #911 "error with buffered png pics" was fixed.
56
-
57
- 6.0.070 (2014-04-24)
58
- - Bug #910 "An SVG image is being cut off (with clipping mask) when you use align options" was fixed.
59
-
60
- 6.0.069 (2014-04-24)
61
- - Datamatrix Base256 encoding was fixed.
62
-
63
- 6.0.068 (2014-04-22)
64
- - Some Datamatrix barcode bugs were fixed.
65
-
66
- 6.0.067 (2014-04-21)
67
- - startLayer() method signature was changed to include a new "lock" parameter.
68
-
69
- 6.0.066 (2014-04-20)
70
- - Bug #908 "Linebreak is not considered when getting length of the next string" was fixed.
71
-
72
- 6.0.065 (2014-04-10)
73
- - Bug #905 "RGB percentage color bug in convertHTMLColorToDec()" was fixed.
74
-
75
- 6.0.064 (2014-04-07)
76
- - Header and Footer fonts are now set by default.
77
- - Bug #904 "PDF corrupted" was fixed.
78
-
79
- 6.0.063 (2014-04-03)
80
- - Method TCPDF_IMAGES::_parsepng() was fixed to support transparency in Indexed images.
81
-
82
- 6.0.062 (2014-03-02)
83
- - The method startLayer() now accepts the NULL value for the $print parameter to not set the print layer option.
84
-
85
- 6.0.061 (2014-02-18)
86
- - Bug #893 "Parsing error on streamed xref for secured pdf" was fixed.
87
-
88
- 6.0.060 (2014-02-16)
89
- - Bug #891 "Error on parsing hexa fields" was fixed.
90
- - Bug #892 "Parsing pdf with trailing space at start" was fixed.
91
-
92
- 6.0.059 (2014-02-03)
93
- - SVG 'use' support was imporved.
94
-
95
- 6.0.058 (2014-01-31)
96
- - Bug #886 "Bugs with SVG using <defs> and <use>" was fixed.
97
-
98
- 6.0.057 (2014-01-26)
99
- - Bug #883 "Parsing error" was fixed.
100
-
101
- 6.0.056 (2014-01-25)
102
- - The automatic cache folder selection now works also with some restricted hosting environments.
103
- - CSS text-transform property is now supported (requires the multibyte string library for php) - see examle n. 061 (Thanks to Walter Ferraz).
104
- - Bug #884 "Parsing error prev tag looking for" was fixed.
105
-
106
- 6.0.055 (2014-01-15)
107
- - Bug #880 "Error detecting hX tags (h1,h2..)" was fixed
108
- - Bug #879 "Thead on the second page inherits style of previous tr" was fixed
109
-
110
- 6.0.054 (2014-01-13)
111
- - Bug #877 "Parenteses causing corrupt text" was fixed.
112
-
113
- 6.0.053 (2014-01-03)
114
- - Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed.
115
- - Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied.
116
-
117
- 6.0.052 (2013-12-12)
118
- - Bug #871 "Datamatrix coding" was fixed.
119
-
120
- 6.0.051 (2013-12-02)
121
- - cbbox array values in addTTFfont() were converted to integers.
122
-
123
- 6.0.050 (2013-12-01)
124
- - The method getNumLines() was extended to support hyphenation.
125
- - The CSS property line-height now supports non percentage values.
126
-
127
- 6.0.050 (2013-11-27)
128
- - A bug related to PNG images was fixed.
129
-
130
- 6.0.048 (2013-11-24)
131
- - SVG vars are now reset in ImageSVG() method.
132
-
133
- 6.0.047 (2013-11-19)
134
- - SVG support was extended to support some nested defs.
135
-
136
- 6.0.046 (2013-11-17)
137
- - preg_replace_callback functions were replaced to improve memory performances.
138
-
139
- 6.0.045 (2013-11-17)
140
- - Bug #862 "Parsing error on flate filter" was fixed.
141
-
142
- 6.0.044 (2013-11-10)
143
- - Bug #857 "Undefined offset error" was fixed.
144
- - The uniord method now uses a static cache to improve performances (thanks to Mathieu Masseboeuf for the sugegstion).
145
- - Two bugs in the TCPDF_FONTS class were fixed.
146
-
147
- 6.0.043 (2013-10-29)
148
- - Bug #854 "CSS instruction display" was fixed.
149
-
150
- 6.0.042 (2013-10-25)
151
- - Bug #852 "CMYK Colors Bug" was fixed.
152
-
153
- 6.0.041 (2013-10-21)
154
- - Bug #851 "Problem with images in PDF. PHP timing out" was fixed.
155
-
156
- 6.0.040 (2013-10-20)
157
- - Bug #849 "SVG import bug" was fixed.
158
-
159
- 6.0.039 (2013-10-13)
160
- - Bug #843 "Wrong call in parser" was fixed.
161
- - Bug #844 "Wrong object type named" was fixed.
162
- - Bug #845 "Parsing error on obj ref prefixed by '000000'" was fixed.
163
-
164
- 6.0.038 (2013-10-06)
165
- - Bug #841 "Division by zero warning at writeHTML a <li> tag" was fixed.
166
-
167
- 6.0.037 (2013-09-30)
168
- - Method getAllSpotColors() was added to return all spot colors.
169
- - Method colorRegistrationBar() was extended to automatically print all spot colors and support individual spot colors.
170
- - The method registrationMarkCMYK() was added to print a registration mark for CMYK colors.
171
- - A bug related to page groups was fixed.
172
- - Gradient() method now supports CMYK equivalents of spot colors.
173
- - Example n. 56 was updated.
174
-
175
- 6.0.036 (2013-09-29)
176
- - Methods for registration bars and crop marks were extended to support registration color (see example n. 56).
177
- - New default spot colors were added to tcpdf_colors.php, including the 'All' and 'None' special registration colors.
178
-
179
- 6.0.035 (2013-09-25)
180
- - TCPDF_PARSER class was improved.
181
-
182
- 6.0.034 (2013-09-24)
183
- - Bug #839 "Error in xref parsing in mixed newline chars" was fixed.
184
-
185
- 6.0.033 (2013-09-23)
186
- - Bug fix related to PNG image transparency using GD library.
187
-
188
- 6.0.032 (2013-09-23)
189
- - Bug #838 "Fatal error when imagick cannot handle the image, even though GD is available and can" was fixed.
190
-
191
- 6.0.031 (2013-09-18)
192
- - Bug #836 "Optional EOL marker before endstream" was fixed.
193
- - Some additional controls were added to avoid "division by zero" error with badly formatted input.
194
-
195
- 6.0.030 (2013-09-17)
196
- - Bug #835 "PDF417 and Cyrilic simbols" was fixed.
197
-
198
- 6.0.029 (2013-09-15)
199
- - Constants K_TCPDF_PARSER_THROW_EXCEPTION_ERROR and K_TCPDF_PARSER_IGNORE_DECODING_ERRORS where removed in favor of a new configuration array in the TCPDF_PARSER class.
200
- - The TCPDF_PARSER class can now be configured using the new $cfg parameter.
201
-
202
- 6.0.028 (2013-09-15)
203
- - A debug print_r was removed form tcpdf_parser.php.
204
- - TCPDF_FILTERS class now throws an exception in case of error.
205
- - TCPDF_PARSER class now throws an exception in case of error unless you define the constant K_TCPDF_PARSER_THROW_EXCEPTION_ERROR to false.
206
- - The constant K_TCPDF_PARSER_IGNORE_DECODING_ERRORS can be set to tru eto ignore decoding errors on TCPDF_PARSER.
207
-
208
- 6.0.027 (2013-09-14)
209
- - A bug in tcpdf_parser wen parsing hexadecimal strings was fixed.
210
- - A bug in tcpdf_parser wen looking for statxref was fixed.
211
- - A bug on RC4 encryption was fixed.
212
-
213
- 6.0.026 (2013-09-14)
214
- - A bug in tcpdf_parser wen decoding streams was fixed.
215
-
216
- 6.0.025 (2013-09-04)
217
- - A pregSplit() bug was fixed.
218
- - Improved content loading from URLs.
219
- - Improved font path loading.
220
-
221
- 6.0.024 (2013-09-02)
222
- - Bug #826 "addEmptySignatureAppearance issue" was fixed.
223
-
224
- 6.0.023 (2013-08-05)
225
- - GNU Freefont fonts were updated.
226
- - Licensing and copyright information about fonts were improved.
227
- - PNG image support was improved.
228
-
229
- 6.0.022 (2013-08-02)
230
- - fixing initialization problem for signature_appearance property.
231
-
232
- 6.0.021 (2013-07-18)
233
- - The bug caused by the preg_split function on some PHP 5.2.x versions was fixed.
234
-
235
- 6.0.020 (2013-06-04)
236
- - The method addTTFfont() was fixed (Bug item #813 Undefined offset).
237
-
238
- 6.0.019 (2013-06-04)
239
- - The magic constant __DIR__ was replaced with dirname(__FILE__) for php 5.2 compatibility.
240
- - The exceptions raised by file_exists() function were suppressed.
241
-
242
- 6.0.018 (2013-05-19)
243
- - The barcode examples were changed to automatically search for the barcode class path (in case the examples directory is not installed under the TCPDF root).
244
-
245
- 6.0.017 (2013-05-16)
246
- - The command line tool tcpdf_addfont.php was improved.
247
- - The php logic was removed from configuration files that now contains only constant defines.
248
- - The tcpdf_autoconfig.php file was added to automatically set missing configuration values.
249
-
250
- 6.0.016 (2013-05-15)
251
- - The tcpdf_addfont.php tool was improved (thanks to Remi Collet).
252
- - Constant K_PATH_IMAGES is now automatically set in configuration file.
253
-
254
- 6.0.015 (2013-05-14)
255
- - Some unused vars were removed from AddFont() method.
256
- - Some directories were moved inside the examples directory.
257
- - All examples were updated to reflect the new default structure.
258
- - Source code were clean-up up to be more compatible with system packaging.
259
- - Files encodings and permissions were reset.
260
- - The command line tool tcpdf_addfont.php was added on the tools directory.
261
-
262
- 6.0.014 (2013-04-13)
263
- - The signature of addTTFfont() method includes a new parameter to link existing fonts instead of copying and compressing them.
264
-
265
- 6.0.013 (2013-04-10)
266
- - Add support for SVG dx and dy text/tspan attributes.
267
- - replace require() with require_once().
268
- - fix some minor typos on documentation.
269
- - fix a problem when deleting all pages.
270
-
271
- 6.0.012 (2013-04-24)
272
- - An error condition in addHtmlLink() method was fixed (bug #799).
273
-
274
- 6.0.011 (2013-04-22)
275
- - Minor documentation changes.
276
-
277
- 6.0.010 (2013-04-03)
278
- - The method Rect() was fixed to print borders correctly.
279
-
280
- 6.0.009 (2013-04-02)
281
- - Adding back some files that were not properly committed on the latest release.
282
-
283
- 6.0.008 (2013-04-01)
284
- - Duplicated encoding maps was removed from tcpdf_font_data.php.
285
- - Fixing bug on AddTTFFont().
286
-
287
- 6.0.007 (2013-03-29)
288
- - HTML/CSS font size conversion were improved.
289
-
290
- 6.0.006 (2013-03-27)
291
- - Bug related to SVG and EPS files on xobjects were fixed.
292
-
293
- 6.0.005 (2013-03-26)
294
- - Default font path was fixed.
295
-
296
- 6.0.004 (2013-03-21)
297
- - Return value of addTTFfont() method was fixed.
298
-
299
- 6.0.003 (2013-03-20)
300
- - A bug related to non-unicode mode was fixed.
301
-
302
- 6.0.002 (2013-03-18)
303
- - _getFIXED call on tcpdf_fonts.php was fixed.
304
-
305
- 6.0.001 (2013-03-18)
306
- - Fixed $uni_type call on tcpdf.php.
307
-
308
- 6.0.000 (2013-03-17)
309
- - IMPORTANT: PHP4 support has been removed starting from this version.
310
- - Several TCPDF methods and vars were moved to new class files: tcpdf_static.php, tcpdf_colors.php, tcpdf_images.php, tcpdf_font_data.php, tcpdf_fonts.php.
311
- - Files htmlcolors.php, spotcolors.php, unicode_data.php and ecodings_maps.php were removed.
312
- - Barcode classes were renamed and new barcode examples were added.
313
- - Class TCPDF_PARSER was improved.
314
-
315
- ********************************************************************************
316
-
317
- 5.9.209 (2013-03-15)
318
- - Image method was improved.
319
-
320
- 5.9.208 (2013-03-15)
321
- - objclone fuction was patched to support old imagick extensions.
322
- - tcpdf_parser was improved to support Cross-Reference Streams and large streams.
323
-
324
- 5.9.207 (2013-03-04)
325
- - Datamatrix class was fixed (a debug echo was removed).
326
-
327
- 5.9.206 (2013-02-22)
328
- - Bug item #754 "PNG with alpha channel becomes gray scale" was fixed.
329
- - Minor documentation fixes.
330
-
331
- 5.9.205 (2013-02-06)
332
- - The constant K_TCPDF_THROW_EXCEPTION_ERROR was added on configuration file to change the behavior of Error() method.
333
- - PDF417 barcode bug was fixed.
334
-
335
- 5.9.204 (2013-01-23)
336
- - The method Bookmark() was extended to include named destinations, URLs, internal links or embedded files (see example n. 15).
337
- - automatic path calculation on configuration file was fixed.
338
- - Error() method was extended to throw new Exception if PHP > 5.
339
-
340
- 5.9.203 (2013-01-22)
341
- - Horizontal position of radiobuttons and checkboxes was adjusted.
342
-
343
- 5.9.202 (2012-12-16)
344
- - Vertical space problem after table was fixed.
345
-
346
- 5.9.201 (2012-12-10)
347
- - First 256 chars are now always included on font subset to overcome a problem reported on the forum.
348
-
349
- 5.9.200 (2012-12-05)
350
- - Bug item #768 "Rowspan with Pagebreak error" was fixed.
351
- - Page regions now works also with limited MultiCell() cells.
352
-
353
- 5.9.199 (2012-11-29)
354
- - Internal setImageBuffer() method was improved.
355
-
356
- 5.9.198 (2012-11-19)
357
- - Datamatrix EDIFACT mode was fixed.
358
-
359
- 5.9.197 (2012-11-06)
360
- - Bug item #756 "TCPDF 5.9.196 shows line on top of all PDFs" was fixed.
361
-
362
- 5.9.196 (2012-11-02)
363
- - Several methods were improved to avoid output when the context is out of page.
364
- - Bug item #755 "remove cached files before unsetting" was fixed.
365
-
366
- 5.9.195 (2012-10-24)
367
- - Method _putfonts() was improved.
368
-
369
- 5.9.194 (2012-10-23)
370
- - Text alignment on TextField() method was fixed.
371
-
372
- 5.9.193 (2012-09-25)
373
- - Support for named destinations on HTML links was added (i.e.: <a href="#destinationname">link to named destination</a>).
374
-
375
- 5.9.192 (2012-09-24)
376
- - A problem on the releasing process was fixed.
377
-
378
- 5.9.191 (2012-09-24)
379
- - SVG image naow support svg and eps images.
380
-
381
- 5.9.190 (2012-09-23)
382
- - "page" word translation is now set to empty if not defined.
383
- - Tooltip feature was added on the radiobutton annotation.
384
-
385
- 5.9.189 (2012-09-18)
386
- - Bug item #3568969 "ini_get safe_mode error" was fixed.
387
-
388
- 5.9.188 (2012-09-15)
389
- - A datamatrix barcode bug was fixed.
390
-
391
- 5.9.187 (2012-09-14)
392
- - Subset feature was extended to include the first 256 characters.
393
-
394
- 5.9.186 (2012-09-13)
395
- - barcodes.php file was resynced.
396
- - Methods SetAbsX, SetAbsY, SetAbsXY where added to set the absolute pointer coordinates.
397
- - Method getCharBBox were added to get single character bounding box.
398
- - Signature of addTTFfont method was changed ($addcbbox paramter was added).
399
-
400
- 5.9.185 (2012-09-12)
401
- - Method _putfontwidths() was fixed.
402
-
403
- 5.9.184 (2012-09-11)
404
- - A problem with EAN barcodes was fixed.
405
-
406
- 5.9.183 (2012-09-07)
407
- - A problem with font names normalization was fixed.
408
-
409
- 5.9.182 (2012-09-05)
410
- - Bug item #3564982 "Infinite loop in Write() method" was fixed.
411
-
412
- 5.9.181 (2012-08-31)
413
- - composer.json file was added.
414
- - Bug item #3563369 "Cached images are not unlinked some time" was fixed.
415
-
416
- 5.9.180 (2012-08-22)
417
- - Bug item #3560493 "Problems with nested cells in HTML" was fixed.
418
-
419
- 5.9.179 (2012-08-04)
420
- - SVG 'use' tag was fixed for 'circle' and 'ellipse' shift problem.
421
- - Alpha status is now correctly stored and restored by getGraphicVars() and SetGraphicVars() methods.
422
-
423
- 5.9.178 (2012-08-02)
424
- - SVG 'use' tag was fixed for 'circle' and 'ellipse'.
425
-
426
- 5.9.177 (2012-08-02)
427
- - An additional control on annotations was fixed.
428
-
429
- 5.9.176 (2012-07-25)
430
- - A bug related to stroke width was fixed.
431
- - A problem related to font spacing in HTML was fixed.
432
-
433
- 5.9.175 (2012-07-25)
434
- - The problem of missing letter on hyphen break was fixed.
435
-
436
- 5.9.174 (2012-07-25)
437
- - The problem of wrong filename when downloading PDF from an Android device was fixed.
438
- - The method setHeaderData() was extended to set text and line color for header (see example n. 1).
439
- - The method setFooterData() was added to set text and line color for footer (see example n. 1).
440
- - The methods setTextShadow() and getTextShadow() were added to set text shadows (see example n. 1).
441
- - The GetCharWidth() method was fixed for negative character spacing.
442
- - A 'none' border mode is now correctly recognized.
443
- - Break on hyphen problem was fixed.
444
-
445
- 5.9.173 (2012-07-23)
446
- - Some additional control wher added on barcode methods.
447
- - The option CURLOPT_FOLLOWLOCATION on Image method is now disabled if PHP safe_mode is on or open_basedir is set.
448
- - Method Bookmark() was extended to include X parameter.
449
- - Method setDestination() was extended to include X parameter.
450
- - A problem with Thai language was fixed.
451
-
452
- 5.9.172 (2012-07-02)
453
- - A PNG color profile issue was fixed.
454
-
455
- 5.9.171 (2012-07-01)
456
- - Some SVG rendering problems were fixed.
457
-
458
- 5.9.170 (2012-06-27)
459
- - Bug #3538227 "Numerous errors inserting shared images" was fixed.
460
-
461
- 5.9.169 (2012-06-25)
462
- - Some SVG rendering problems were fixed.
463
-
464
- 5.9.168 (2012-06-22)
465
- - Thai language rendering was fixed.
466
-
467
- 5.9.167 (2012-06-22)
468
- - Thai language rendering was fixed and improved.
469
- - Method isCharDefined() was improved.
470
- - Protected method replaceChar() was added.
471
- - Font "kerning" word was corrected to "tracking".
472
-
473
- 5.9.166 (2012-06-21)
474
- - Array to string conversion on file_id creation was fixed.
475
- - Thai language rendering was fixed (thanks to Atsawin Chaowanakritsanakul).
476
-
477
- 5.9.165 (2012-06-07)
478
- - Some HTML form related bugs were fixed.
479
-
480
- 5.9.164 (2012-06-06)
481
- - A bug introduced on the latest release was fixed.
482
-
483
- 5.9.163 (2012-06-05)
484
- - Method getGDgamma() was changed.
485
- - Rendering performances of PNG images with alpha channel were improved.
486
-
487
- 5.9.162 (2012-05-11)
488
- - A bug related to long text on TD cells was fixed.
489
-
490
- 5.9.161 (2012-05-09)
491
- - A bug on XREF table was fixed (Bug ID: 3525051).
492
- - Deprecated Imagick:clone was replaced.
493
- - Method objclone() was fixed for PHP4.
494
-
495
- 5.9.160 (2012-05-03)
496
- - A bug on tcpdf_parser.php was fixed.
497
-
498
- 5.9.159 (2012-04-30)
499
- - Barcode classes were updated to fix PNG export Bug (ID: 3522291).
500
-
501
- 5.9.158 (2012-04-22)
502
- - Some SVG-related bugs were fixed.
503
-
504
- 5.9.157 (2012-04-16)
505
- - Some SVG-related bugs were fixed.
506
-
507
- 5.9.156 (2012-04-10)
508
- - Bug item #3515885 "TOC and booklet: left and right page exchanged".
509
- - SetAutoPageBreak(false) now works also in multicolumn mode.
510
-
511
- 5.9.155 (2012-04-02)
512
- - Bug item #3512596 "font import problems" was fixed.
513
- - Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation).
514
- - All fonts were updated.
515
- - Bug item #3513867 "booklet and setHeaderTemplateAutoreset: header shifted left" was fixed.
516
- - Bug item #3513749 "TCPDF Superscript/Subscript" was fixed.
517
-
518
- 5.9.154 (2012-03-29)
519
- - A debug echo was removed.
520
-
521
- 5.9.153 (2012-03-28)
522
- - A bug on font conversion was fixed.
523
- - All fonts were updated.
524
- - Method isCharDefined() was added to find if a character is defined on the selected font.
525
- - Method replaceMissingChars() was added to automatically replace missing chars on selected font.
526
- - SetFont() method was fixed.
527
-
528
- 5.9.152 (2012-03-23)
529
- - The following overprint methods were added: setOverprint(), getOverprint().
530
- - Signature of setAlpha() method was changed and method getAlpha() was added.
531
- - stroke-opacity support was added on SVG.
532
- - The following date methods were added: setDocCreationTimestamp(), setDocModificationTimestamp(), getDocCreationTimestamp(), getDocModificationTimestamp(), getFormattedDate(), getTimestamp().
533
- - Signature of _datestring() method was changed.
534
- - Method getFontBBox() was added.
535
- - Method setPageBoxTypes() was aded.
536
-
537
- 5.9.151 (2012-03-22)
538
- - Bug item #3509889 "Transform() distorts PDF" was fixed.
539
- - Precision of real number were extended.
540
- - ComboBox and ListBox methods were fixed.
541
- - Bulgarian language file was added.
542
- - addTOC() method was improved to include bookmark color and font style.
543
-
544
- 5.9.150 (2012-03-16)
545
- - A bug related to form fields in PDF/A mode was fixed.
546
-
547
- 5.9.149 (2012-02-21)
548
- - Bug item #3489933 "SVG Parser treats tspan like text" was fixed.
549
-
550
- 5.9.148 (2012-02-17)
551
- - Bug item #3488600 "Multiple radiobutton sets get first set value" was fixed.
552
-
553
- 5.9.147 (2012-02-14)
554
- - A problem with SVG gradients has been fixed.
555
-
556
- 5.9.146 (2012-02-12)
557
- - Bug item #3486880 "$filehash undefine error" was fixed.
558
- - The default font is now the one specified at PDF_FONT_NAME_MAIN constant.
559
-
560
- 5.9.145 (2012-01-28)
561
- - Japanese language file was added.
562
- - TCPDF license and README.TXT files were updated.
563
-
564
- 5.9.144 (2012-01-12)
565
- - HTML output on barcode classes was improved.
566
-
567
- 5.9.143 (2012-01-08)
568
- - Bug item #3471057 "setCreator() has no effect" was fixed.
569
-
570
- 5.9.142 (2011-12-23)
571
- - Source code documentation was updated.
572
-
573
- 5.9.141 (2011-12-14)
574
- - Some minor bugs were fixed.
575
-
576
- 5.9.140 (2011-12-13)
577
- - SVG now supports embedded images encoded as base64.
578
-
579
- 5.9.139 (2011-12-11)
580
- - Spot color methods were fixed.
581
-
582
- 5.9.138 (2011-12-10)
583
- - cropMark() method was improved (check source code documentation).
584
- - Example n. 56 was updated.
585
- - Bug item #3452390 "Check Box still not ticked when set to true" was fixed.
586
-
587
- 5.9.137 (2011-12-01)
588
- - Bug item #3447005 "Background color and border of Form Elements is printed" was fixed.
589
- - Color support for Form elements was improved.
590
-
591
- 5.9.136 (2011-11-27)
592
- - Bug item #3443387 "SetMargins with keep option does not work for top margin" was fixed.
593
-
594
- 5.9.135 (2011-11-04)
595
- - Bug item #3433406 "Double keywords in description" was fixed.
596
-
597
- 5.9.134 (2011-10-29)
598
- - The default value for $defcol parameter on convertHTMLColorToDec() method was fixed.
599
- - Deafult HTTP headers were changed to avoid browser caching.
600
- - Some deprecated syntax were replaced.
601
-
602
- 5.9.133 (2011-10-26)
603
- - Bug item #3428446 "copyPage method not working when diskcache enabled" was fixed.
604
-
605
- 5.9.132 (2011-10-20)
606
- - Bug item #3426167 "bug in function convertHTMLColorToDec()" was fixed.
607
-
608
- 5.9.131 (2011-10-13)
609
- - An error message was added to ImagePngAlpha() method.
610
-
611
- 5.9.130 (2011-10-12)
612
- - Now you can set image data strings on HTML img tag by encoding the image binary data in this way: $imgsrc = '@'.base64_encode($imgdata);
613
-
614
- 5.9.129 (2011-10-07)
615
- - Core fonts metrics was fixed (replace all helvetica and times php files on fonts folder).
616
- - Form fields support was improved and some problems were fixed (check the example n. 14).
617
- - Bug item #3420249 "Issue with booklet and MultiCell" was fixed.
618
-
619
- 5.9.128 (2011-10-06)
620
- - Method addTTFfont() was improved (check the source code documentation).
621
- - Method setExtraXMP() to set custom XMP data was added.
622
-
623
- 5.9.127 (2011-10-04)
624
- - Readonly mode option was activated for radiobuttons.
625
-
626
- 5.9.126 (2011-10-03)
627
- - Bug item #3417989 "Graphics State operator in form XObject fails to render" was fixed.
628
- - Xobjects problems with transparency, gradients and spot colors were fixed.
629
-
630
- 5.9.125 (2011-10-03)
631
- - Support for 8-digit CMYK hexadecimal color representation was added (to be used with XHTML and SVG).
632
- - Spot colors support was improved (check example n. 37).
633
- - Color methods were improved.
634
-
635
- 5.9.124 (2011-10-02)
636
- - Core fonts were updated.
637
-
638
- 5.9.123 (2011-10-02)
639
- - The method addTTFfont() wad added to automatically convert TTF fonts (check the new fonts guide at http://www.tcpdf.org).
640
- - Old font utils were removed.
641
- - All fonts were updated and new arabic fonts were added (almohanad were removed and replaced by aefurat and aealarabiya).
642
- - The file unicode_data.php was updated.
643
- - The file encodings_maps.php was added.
644
- - PDF/A files are now compressed to save space.
645
- - XHTML input form fields now support text-alignment attribute.
646
-
647
- 5.9.122 (2011-09-29)
648
- - PDF/A-1b compliance was improved to pass some online testing.
649
-
650
- 5.9.121 (2011-09-28)
651
- - This version includes support for PDF/A-1b format (the class constructor signature was changed - see example n. 65).
652
- - Method setSRGBmode() was added to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document (file sRGB.icc was added).
653
- - 14 new fonts were added to allow embedding core fonts (for PDF/A compliance).
654
- - Font utils were fixed.
655
-
656
- 5.9.120 (2011-09-22)
657
- - This version includes a fix for _getTrueTypeFontSubset() method.
658
-
659
- 5.9.119 (2011-09-19)
660
- - This version includes a fix for extra page numbering on TOC.
661
-
662
- 5.9.118 (2011-09-17)
663
- - This version includes some changes that allows you to add a bookmark for a page that do not exist.
664
-
665
- 5.9.117 (2011-09-15)
666
- - TCPDFBarcode and TCPDF2DBarcode classes were extended to include a method for exporting barcodes as PNG images.
667
-
668
- 5.9.116 (2011-09-14)
669
- - Datamatrix class was improved and documentation was fixed.
670
-
671
- 5.9.115 (2011-09-13)
672
- - Datamatrix ECC200 barcode support was added (a new datamatrix.php file was added) - check example n. 50.
673
- - getBarcodeHTML() method was added on TCPDFBarcode and TCPDF2DBarcode classes to return an HTML representation of the barcode.
674
- - cURL options on Image() method were improved.
675
- - A bug on write2DBarcode() was fixed.
676
-
677
- 5.9.114 (2011-09-04)
678
- - A bug related to column position was fixed.
679
-
680
- 5.9.113 (2011-08-24)
681
- - This release include two new experimental files for parsing an existing PDF document (the integration with TCPDF is under development).
682
-
683
- 5.9.112 (2011-08-18)
684
- - A newline character was added after the 'trailer' keyword for compatibility with some parsers.
685
- - Support for layers was improved.
686
-
687
- 5.9.111 (2011-08-17)
688
- - Barcode CODE 39 default gap was restored at 1.
689
-
690
- 5.9.110 (2011-08-17)
691
- - Barcode CODE 39 was fixed.
692
-
693
- 5.9.109 (2011-08-12)
694
- - Method getNumLines() was fixed.
695
- - A bug related to page break in multi-column mode was fixed.
696
-
697
- 5.9.108 (2011-08-09)
698
- - A bug on PHP4 version was fixed.
699
-
700
- 5.9.107 (2011-08-08)
701
- - This version includes a minor bugfix.
702
-
703
- 5.9.106 (2011-08-04)
704
- - This version includes transparency groups: check the new parameter on startTemplate() method and example 62.
705
-
706
- 5.9.105 (2011-08-04)
707
- - Bug item #3386153 "Check Box not ticked when set to true" was fixed.
708
-
709
- 5.9.104 (2011-08-01)
710
- - Bug item #3383698 "imagemagick, resize and dpi" was fixed.
711
-
712
- 5.9.103 (2011-07-16)
713
- - Alignment of XHTML lines was improved.
714
- - Spell of the "length" word was fixed.
715
-
716
- 5.9.102 (2011-07-13)
717
- - Methods startLayer() and endLayer() were added to support arbitrary PDF layers.
718
- - Some improvements/fixes for images were added (thanks to Brendan Abbott).
719
-
720
- 5.9.101 (2011-07-07)
721
- - Support for JPEG and PNG ICC Color Profiles was added.
722
- - Method addEmptySignatureAppearance() was added to add empty signature fields (see example n. 52).
723
- - Bug item #3354332 "Strange line spacing with reduced font-size in writeHTML" was fixed.
724
-
725
- 5.9.100 (2011-06-29)
726
- - An SVG bug has been fixed.
727
-
728
- 5.9.099 (2011-06-27)
729
- - Bug item #3335045 "Font freesans seems somehow corrupted in footer" was fixed.
730
-
731
- 5.9.098 (2011-06-23)
732
- - The Named Destination feature was fixed.
733
-
734
- 5.9.097 (2011-06-23)
735
- - The method setHtmlVSpace() now can be used also for tags: div, li, br, dt and dd.
736
- - The Named Destination feature was added (check the example n. 15) - thanks to Christian Deligant.
737
-
738
- 5.9.096 (2011-06-19)
739
- - Bug item #3322234 "Surrogate pairs codes in arrUTF8ToUTF16BE" was fixed.
740
-
741
- 5.9.095 (2011-06-18)
742
- - Numbers alignment for Table-Of-Content methods was improved and fixed.
743
- - Font subsetting was fixed to include all parts of composite fonts.
744
-
745
- 5.9.094 (2011-06-17)
746
- - Bug item #3317898 "Page Group numbering broken in 5.9.093" was fixed.
747
-
748
- 5.9.093 (2011-06-16)
749
- - Method setStartingPageNumber() was added to set starting page number (for automatic page numbering).
750
-
751
- 5.9.092 (2011-06-15)
752
- - Method _putpages() was improved.
753
- - Bug item #3316678 "Memory overflow when use Rotate and SetAutoPageBreak" was fixed.
754
- - Right alignment of page numbers was improved.
755
-
756
- 5.9.090 (2011-06-14)
757
- - Methods AliasNbPages() and AliasNumPage() were re-added as deprecated for backward compatibility.
758
-
759
- 5.9.089 (2011-06-13)
760
- - Example n. 8 was updated.
761
- - Method sendOutputData() was changed to remove default compression (it was incompatible with some server settings).
762
- - Bugs related to page group numbers were fixed.
763
- - Method copyPage() was fixed.
764
- - Method Image() was improved to include support for alternative and external images.
765
-
766
- 5.9.088 (2011-06-01)
767
- - Method getAutoPageBreak() was added (see example n. 51).
768
- - Example n. 51 (full page background) was updated.
769
-
770
- 5.9.087 (2011-06-01)
771
- - Method sendOutputData() was improved to include deflate encoding.
772
- - Barcode classes on PHP 4 version were fixed.
773
-
774
- 5.9.086 (2011-05-31)
775
- - Font files were updated (the ones on the previous release were broken).
776
- - The script fonts/utils/makeallttffonts.php was updated and fixed.
777
- - Output() method was improved to use compression when available.
778
-
779
- 5.9.085 (2011-05-31)
780
- - TCPDFBarcode class (barcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode.
781
- - TCPDF2DBarcode class (2dbarcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode.
782
-
783
- 5.9.084 (2011-05-29)
784
- - Font files were updated.
785
- - The file fonts/utils/makeallttffonts.php was updated.
786
- - Bug item# 3308774 "Problems with font subsetting" was fixed.
787
-
788
- 5.9.083 (2011-05-24)
789
- - Bug item #3308387 "line height & SetCellHeightRatio" was fixed.
790
-
791
- 5.9.082 (2011-05-22)
792
- - Bug item #3305592 "Setting fill color <> text color breaks text clipping" was fixed.
793
-
794
- 5.9.081 (2011-05-18)
795
- - Method resetHeaderTemplate() was added to reset the xobject template used by Header() method.
796
- - Method setHeaderTemplateAutoreset() was added to automatically reset the xobject template used by Header() method at each page.
797
-
798
- 5.9.080 (2011-05-17)
799
- - A problem related to file path calculation for images was fixed.
800
- - A problem related to unsupressed getimagesize() error was fixed.
801
-
802
- 5.9.079 (2011-05-16)
803
- - Footer() method was changed to use C128 barcode as default (instead of the previous C128B).
804
-
805
- 5.9.078 (2011-05-12)
806
- - Bug item #3300878 "wrong rendering for html bullet list in some case" was fixed.
807
- - Bug item #3301017 "Emphasized vs. font-weight" was fixed.
808
- - Barcode Code 128 was improved to include AUTO mode (automatically switch between A, B and C modes).
809
- - Examples n. 27 and 49 were updated.
810
-
811
- 5.9.077 (2011-05-07)
812
- - Bug item #3298591 "error code93" was fixed.
813
- - SetLineStyle() function was improved.
814
-
815
- 5.9.076 (2011-05-06)
816
- - Bug item #3298264 "codebar 93 error" was fixed.
817
-
818
- 5.9.075 (2011-05-02)
819
- - Table header alignment when using WriteHTMLCell() or MultiCell() was fixed.
820
-
821
- 5.9.074 (2011-04-28)
822
- - Bug item #3294306 "CSS classes not work in <thead> table section" was fixed.
823
-
824
- 5.9.073 (2011-04-27)
825
- - A bug related to character entities on HTML cells was fixed.
826
-
827
- 5.9.072 (2011-04-26)
828
- - Method resetColumns() was added to remove multiple columns and reset page margins (example n. 10 was updated).
829
-
830
- 5.9.071 (2011-04-19)
831
- - Bug #3288574 "<br/> trouble" was fixed.
832
-
833
- 5.9.069 (2011-04-19)
834
- - Bug #3288763 "HTML-Table: non-breaking table rows: Bug" was fixed.
835
-
836
- 5.9.068 (2011-04-15)
837
- - Bookmark, addTOC and addHTMLTOC methods were improved to include font style and color (Examples 15, 49 and 59 were updated).
838
- - Default $_SERVER['DOCUMENT_ROOT'] value on tcpdf_config.php file was changed.
839
-
840
- 5.9.067 (2011-04-10)
841
- - Performances were drastically improved (PDF documents are now created more quickly).
842
-
843
- 5.9.066 (2011-04-09)
844
- - A bug related to digital signature + encryption was fixed.
845
- - A bug related to encryption + xobject templates was fixed.
846
-
847
- 5.9.065 (2011-04-08)
848
- - Bug item #3280512 "Text encoding iso-8859-2 crashes" was fixed.
849
-
850
- 5.9.064 (2011-04-05)
851
- - A bug related to character entities on HTML cells was fixed.
852
-
853
- 5.9.063 (2011-04-01)
854
- - Bug item #3267235 "WriteHTML() and image that doesn't fit on the page" was fixed.
855
-
856
- 5.9.062 (2011-03-23)
857
- - Bug item #3232650 "Using Write if there are pageRegions active creates error" was fixed.
858
- - Bug item #3221891 "text input borders" was fixed.
859
- - Bug item #3228958 "Adobe Reader 9.4.2 crash" was fixed.
860
-
861
- 5.9.061 (2011-03-15)
862
- - Bug item #3213488 "wrong function call in function Write" was fixed.
863
- - Bug item #3203007 "list element with black background" was fixed.
864
-
865
- 5.9.060 (2011-03-08)
866
- - addTOC() method was fixed for text alignment problems.
867
-
868
- 5.9.059 (2011-02-27)
869
- - Default Header() method was improved to reduce document size.
870
-
871
- 5.9.058 (2011-02-25)
872
- - Image() method was improved to cache images with transparency layers (thanks to Korneliusz Jarzębski for reporting this problem).
873
-
874
- 5.9.057 (2011-02-24)
875
- - A problem with image caching system was fixed (thanks to Korneliusz Jarzębski for reporting this problem).
876
-
877
- 5.9.056 (2011-02-22)
878
- - A bug on fixHTMLCode() method was fixed.
879
- - Automatic line break for HTML was fixed.
880
-
881
- 5.9.055 (2011-02-17)
882
- - Another bug related to HTML table page break was fixed.
883
-
884
- 5.9.054 (2011-02-16)
885
- - A bug related to HTML table page break was fixed.
886
-
887
- 5.9.053 (2011-02-16)
888
- - Support for HTML attribute display="none" was added.
889
-
890
- 5.9.052 (2011-02-15)
891
- - A bug related to HTML automatic newlines was fixed.
892
-
893
- 5.9.051 (2011-02-12)
894
- - "Commas at beginning of new lines" problem was fixed.
895
-
896
- 5.9.050 (2011-02-11)
897
- - Bug #3177606 "SVG Bar chart error" was fixed.
898
-
899
- 5.9.049 (2011-02-03)
900
- - Bug #3170777 "TCPDF creates a new page after a single line in writeHTML" was fixed.
901
-
902
- 5.9.048 (2011-02-02)
903
- - No changes. Just released to override previous release that was not uploaded correctly.
904
-
905
- 5.9.047 (2011-01-28)
906
- - Bug #3167115 "PDF error in <table> (example 48)" was fixed (was introduced in 5.8.046).
907
-
908
- 5.9.046 (2011-01-18)
909
- - PDF view/print layers are now automatically turned off if not used (see setVisibility() method).
910
-
911
- 5.9.045 (2011-01-17)
912
- - HTML list support were improved.
913
-
914
- 5.9.044 (2011-01-15)
915
- - Bug #3158422 "writeHTMLCell Loop" was fixed.
916
- - Some HTML image alignment problems were fixed.
917
-
918
- 5.9.043 (2011-01-14)
919
- - Bug #3158178 "PHP Notice" was fixed.
920
- - Bug #3158193 "Endless loop in writeHTML" was fixed.
921
- - Bug #3157764 "SVG Pie chart incorrectly rendered2".
922
-
923
- 5.9.042 (2011-01-14)
924
- - Some problems of the PHP4 version were fixed.
925
-
926
- 5.9.041 (2011-01-13)
927
- - A problem with SVG elliptical arc path was fixed (ref. bug #3156574).
928
- - A problem related to font weight on HTML table headers was fixed.
929
-
930
- 5.9.040 (2011-01-12)
931
- - A bug related to empty pages after table was fixed.
932
-
933
- 5.9.039 (2011-01-12)
934
- - Bug item #3155759 "openssl_random_pseudo_bytes() slow under Windows" was fixed.
935
-
936
- 5.9.038 (2011-01-11)
937
- - Minor bugs were fixed.
938
-
939
- 5.9.037 (2011-01-09)
940
- - An alignment problem for HTML texts was fixed.
941
-
942
- 5.9.036 (2011-01-07)
943
- - A bug related to HTML tables on header was fixed.
944
-
945
- 5.9.035 (2011-01-03)
946
- - A problem related to HTML table border alignment was fixed.
947
- - Bug #2996366 "FastCGI and Header Problems" was fixed.
948
-
949
- 5.9.034 (2010-12-19)
950
- - DejaVu and GNU Free fonts were updated.
951
-
952
- 5.9.033 (2010-12-18)
953
- - Source code documetnation was improved.
954
-
955
- 5.9.032 (2010-12-18)
956
- - Default font stretching and spacing values are now inherited by HTML methods.
957
-
958
- 5.9.031 (2010-12-16)
959
- - Source code documentation errors were fixed.
960
-
961
- 5.9.030 (2010-12-16)
962
- - Several source code documentation errors were fixed.
963
- - Source code style was changed for Doxygen.
964
- - Source code documentation was moved online to http://www.tcpdf.org
965
-
966
- 5.9.029 (2010-12-04)
967
- - The $fitbox parameter on Image() method was extended to specify image alignment inside the box (check the example n. 9).
968
-
969
- 5.9.028 (2010-12-03)
970
- - Font utils makefont.php and makeallttffonts.php were updated.
971
-
972
- 5.9.027 (2010-12-01)
973
- - Spot Colors are now better integrated with HTML mode.
974
- - Method SetDocInfoUnicode() was added to turn on/off Unicode mode for document information dictionary (meta tags) - check the example n. 19.
975
-
976
- 5.9.026 (2010-12-01)
977
- - A problem with mixed text directions on HTML was fixed.
978
-
979
- 5.9.025 (2010-12-01)
980
- - The AddSpotColor() now automatically fills the spotcolor array (defined on spotcolors.php file).
981
-
982
- 5.9.024 (2010-11-30)
983
- - Bug item #3123612 "SVG not use gradientTransform in percentage mode" was fixed.
984
-
985
- 5.9.023 (2010-11-25)
986
- - A potential bug on SVG transcoder was fixed.
987
-
988
- 5.9.022 (2010-11-21)
989
- - Method ImageEPS includes support for EPS/AI Spot colors.
990
- - Method ImageEPS includes a new parameter $fixoutvals to remove values outside the bounding box.
991
-
992
- 5.9.021 (2010-11-20)
993
- - Support for custom bullet points images was added (check the example n.6)
994
- - Examples n. 6 and 61 were update (check the comments inside).
995
-
996
- 5.9.020 (2010-11-19)
997
- - A problem related to additional page when using multicolumn mode was fixed.
998
-
999
- 5.9.019 (2010-11-19)
1000
- - An SVG bug was fixed.
1001
- - ImageSVG() and ImageEPS() methods now accepts image data streams (put the string on the $file parameter preceded by '@' character).
1002
- - Option 'E' was added to the $dest parameter of Output() method to return the document as base64 mime multi-part email attachment (RFC 2045).
1003
-
1004
- 5.9.018 (2010-11-19)
1005
- - An SVG bug was fixed.
1006
-
1007
- 5.9.017 (2010-11-16)
1008
- - Tagline color was set to transparent.
1009
- - The method fixHTMLCode() was added to automatically clean up HTML code (requires HTML Tidy).
1010
-
1011
- 5.9.016 (2010-11-16)
1012
- - Bug item #3109705 "list item page break hanging bullet" was fixed.
1013
-
1014
- 5.9.015 (2010-11-16)
1015
- - Bug item affecting QRCode was fixed.
1016
- - Some bugs affecting HTML lists were fixed.
1017
- - ImageSVG() and fitBlock() methods were improved to handle some SVG problems.
1018
- - Some problems with PHP4 compatibility were fixed.
1019
-
1020
- 5.9.014 (2010-11-15)
1021
- - Bug item #3109464 "QRCode error" was fixed.
1022
-
1023
- 5.9.013 (2010-11-15)
1024
- - Bug item #3109257 "Problem with interlaced GIFs and PNGs" was fixed.
1025
- - Image function now accepts image data streams (check example n. 9).
1026
-
1027
- 5.9.012 (2010-11-12)
1028
- - Method getTCPDFVersion() was added.
1029
- - PDF_PRODUCER constant was removed.
1030
- - Method convertHTMLColorToDec() was improved.
1031
- - HTML colors now support spot color names defined on the new spotcolors.php file.
1032
- - The default method Header() was improved to support SVG and EPS/AI images.
1033
- - A bug on SVG importer was fixed.
1034
-
1035
- 5.9.011 (2010-11-02)
1036
- - Bug item #3101486 "Bug Fix for image loading" was fixed.
1037
-
1038
- 5.9.010 (2010-10-27)
1039
- - Support for CSS properties 'border-spacing' and 'padding' for tables were added.
1040
- - Several language files were added.
1041
-
1042
- 5.9.009 (2010-10-21)
1043
- - HTML text alignment was improved to include the case of RTL text on LTR direction and LTR text on RTL direction.
1044
-
1045
- 5.9.008 (2010-10-21)
1046
- - Bug item #3091502 "Bookmark oddity" was fixed.
1047
- - HTML internal links now accepts page number and Y position.
1048
- - The method write1DBarcode() was improved to accept separate horizontal and vertical padding (see example n. 27).
1049
-
1050
- 5.9.007 (2010-10-20)
1051
- - Method adjustCellPadding() was fixed to handle bad input.
1052
-
1053
- 5.9.006 (2010-10-19)
1054
- - Support for AES 256 bit encryption was added (see example n. 16).
1055
- - Method getNumLines() was fixed for the empty string case.
1056
-
1057
- 5.9.005 (2010-10-18)
1058
- - Method addPageRegion() was changed to accept regions starting exactly from the top of the page.
1059
-
1060
- 5.9.004 (2010-10-18)
1061
- - A bug related to annotations was fixed.
1062
- - The file unicode_data.php was canged to encapsulate all data in a class.
1063
- - The file htmlcolors.php was changed to remove the global variable.
1064
-
1065
- 5.9.003 (2010-10-15)
1066
- - Support for no-write page regions was added. Check the example n. 64 and new methods setPageRegions(), addPageRegion(), getPageRegions(), removePageRegion().
1067
- - A bug on Right-To-Left alignment was fixed.
1068
-
1069
- 5.9.002 (2010-10-08)
1070
- - Cell method was improved to preserve the font stretching and spacing values when using the $stretch parameter (see example n. 4).
1071
-
1072
- 5.9.001 (2010-10-07)
1073
- - The problem of blank page for nobr table higher than a single page was fixed.
1074
-
1075
- 5.9.000 (2010-10-06)
1076
- - Support for text stretching and spacing (tracking) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing().
1077
- - Support for CSS properties 'font-stretch' and 'letter-spacing' was added (see example n. 63).
1078
- - The cMargin state was replaced by cell_padding array that can be set/get using setCellPadding() and getCellPadding() methods.
1079
- - Methods getCellPaddings() and setCellPaddings() were added to fine tune cell paddings (see example n. 5).
1080
- - Methods getCellMargins() and setCellMargins() were added to fine tune cell margins (see example n. 5).
1081
- - Method write1DBarcode() was improved to permit custom labels (see example n. 27).
1082
- - Method ImagePngAlpha() now includes support for ImageMagick to improve performances.
1083
- - XObject Template support was extended to support Multicell(), writeHTML() and writeHTMLCell() methods.
1084
- - The signature of getNumLines() and getStringHeight() methods is changed.
1085
- - Example n. 57 was updated.
1086
-
1087
- // -------------------------------------------------------------------
1088
-
1089
- 5.8.034 (2010-09-27)
1090
- - A bug related to SetFont on XObject templates was fixed.
1091
-
1092
- 5.8.033 (2010-09-25)
1093
- - A problem with Footer() and multiple columns was fixed.
1094
-
1095
- 5.8.032 (2010-09-22)
1096
- - Bug #3073165 "Issues with changes to addHTMLVertSpace()" was fixed.
1097
-
1098
- 5.8.031 (2010-09-20)
1099
- - Bug #3071961 "Spaces in HTML" was fixed.
1100
-
1101
- 5.8.030 (2010-09-17)
1102
- - SVG support was improved and some bugs were fixed.
1103
-
1104
- 5.8.029 (2010-09-16)
1105
- - A problem with HTML borders was fixed.
1106
-
1107
- 5.8.028 (2010-09-13)
1108
- - Bug #3065224 "mcrypt_create_iv error on TCPDF 5.8.027 on PHP 5.3.2" was fixed.
1109
-
1110
- 5.8.027 (2010-09-13)
1111
- - Bug #3065118 "mcrypt_decrypt error on TCPDF 5.8.026 on PHP 5.3.2" was fixed.
1112
-
1113
- 5.8.026 (2010-09-13)
1114
- - A bug on addHTMLTOC() method was fixed. Note: be sure that the #TOC_PAGE_NUMBER# template has enough width to be printed correctly.
1115
-
1116
- 5.8.025 (2010-09-09)
1117
- - Bug #3062692 "Textarea inside a table" was fixed.
1118
-
1119
- 5.8.024 (2010-09-08)
1120
- - Bug #3062005 "Undefined variable: ann_obj_id" was fixed.
1121
-
1122
- 5.8.023 (2010-08-31)
1123
- - Forms bug added on version 5.8.019 was fixed.
1124
-
1125
- 5.8.022 (2010-08-31)
1126
- - Bug #3056632 "SVG rendered vertically flipped" was fixed.
1127
-
1128
- 5.8.021 (2010-08-30)
1129
- - A new CID-0 'chinese' font was added for traditional Chinese.
1130
- - Bug #3054287 'Inner tags are ignored due to "align" attribute' was fixed.
1131
-
1132
- 5.8.020 (2010-08-26)
1133
- - CSS "catch-all" class selector is now supported.
1134
-
1135
- 5.8.019 (2010-08-26)
1136
- - XObject Templates now includes support for links and annotations.
1137
- - A problem related to link alignment on cell was fixed.
1138
- - A problem related to SVG styles was fixed.
1139
-
1140
- 5.8.018 (2010-08-25)
1141
- - Method getNumberOfColumns() was added.
1142
- - A problem related to table header was fixed.
1143
- - Method getSVGTransformMatrix() was fixed to apply SVG transformations in the correct order.
1144
- - SVG support was improved and several bugs were fixed.
1145
-
1146
- 5.8.017 (2010-08-25)
1147
- - This version includes support for XObject Templates (see the new example n. 62).
1148
- - Methods starttemplate(), endTemplate() and printTemplate() were added (see the new example n. 62).
1149
-
1150
- 5.8.016 (2010-08-24)
1151
- - Alignment problem on write2DBarcode was fixed.
1152
-
1153
- 5.8.015 (2010-08-24)
1154
- - A problem arised with the latest bugfix was fixed.
1155
-
1156
- 5.8.014 (2010-08-23)
1157
- - Method _getxobjectdict() was added for better compatibility with external extensions.
1158
- - A bug related to radiobuttons was fixed.
1159
- - Bug #3051509 "new line after punctuation marks" was fixed (partially).
1160
-
1161
- 5.8.013 (2010-08-23)
1162
- - SVG support for 'direction' property was added.
1163
- - A problem on default width calculation for linear barcodes was fixed.
1164
- - New option was added to write1DBarcode() method to improve alignments (see example n. 27).
1165
- - Bug #3050896 "Nested HTML tables: styles are not applied" was fixed.
1166
- - Method _putresourcedict() was improved to include external XObject templates.
1167
-
1168
- 5.8.012 (2010-08-22)
1169
- - Support for SVG 'text-anchor' property was added.
1170
-
1171
- 5.8.011 (2010-08-21)
1172
- - Method write1DBarcode() was improved to be backward compatible (check the new example n. 27).
1173
- - Support for CSS width and height properties on images were added.
1174
-
1175
- 5.8.010 (2010-08-20)
1176
- - Documentation of unhtmlentities() was fixed.
1177
- - The 'fitwidth' option was added and border color problem was fixed on write1DBarcode() method (check the example n. 27).
1178
-
1179
- 5.8.009 (2010-08-20)
1180
- - Internal object numbering was improved.
1181
- - Some errors in object encryption were fixed.
1182
-
1183
- 5.8.008 (2010-08-19)
1184
- - Method write1DBarcode() was changed, check the example n. 27.
1185
- - Method Footer() was changed to account for barcode changes.
1186
- - Automatic calculation of K_PATH_URL constant was fixed on configuration file.
1187
- - Method setEqualColumns() was fixed for $width=0 case.
1188
- - Method AddTOC() was fixed for multipage and multicolumn modes.
1189
- - Better support for SVG "font-family" property.
1190
- - A problem on default Page Zoom mode was fixed.
1191
- - Several Annotation bugs were fixed.
1192
-
1193
- 5.8.007 (2010-08-18)
1194
- - A bug affecting HTML tables was fixed.
1195
- - Bug #3047500 "SVG not rendering paths properly" was fixed.
1196
-
1197
- 5.8.006 (2010-08-17)
1198
- - A bug affecting HTML table nesting was fixed.
1199
-
1200
- 5.8.005 (2010-08-17)
1201
- - A bug affecting the HTML 'select' tag in certain conditions was fixed.
1202
-
1203
- 5.8.004 (2010-08-17)
1204
- - Better support for HTML "font-family" property.
1205
- - A bug related to HTML multicolumn was fixed.
1206
-
1207
- 5.8.003 (2010-08-16)
1208
- - Better support for HTML "font-family" property.
1209
-
1210
- 5.8.002 (2010-08-14)
1211
- - HTML alignments were improved
1212
- - IMPORTANT: Default regular expression to find spaces has been changed to exclude the non-breaking-space (160 DEC- A0 HEX). If you are using setSpacesRE() method, please read the new documentation.
1213
- - Example n. 1 was updated.
1214
-
1215
- 5.8.001 (2010-08-12)
1216
- - Bug #3043650 "subsetchars incorrectly cached" was fixed.
1217
-
1218
- 5.8.000 (2010-08-11)
1219
- - A control to avoid bookmarking page 0 was added.
1220
- - addTOC() method now includes support for multicolumn mode.
1221
- - Support for tables in multicolumn mode was improved.
1222
- - Example n.10 was updated.
1223
- - All trimming functions were replaced with stringLeftTrim(), stringRightTrim() and stringTrim().
1224
- - HTML alignments were improved.
1225
-
1226
- ------------------------------------------------------------
1227
-
1228
- 5.7.003 (2010-08-08)
1229
- - Bug #3041263 "php source ending is bad" was fixed (all PHP files were updated, including fonts).
1230
-
1231
- 5.7.002 (2010-08-06)
1232
- - Methods copyPage(), movePage() and deletePage() were changed to account for internal markings.
1233
-
1234
- 5.7.001 (2010-08-05)
1235
- - Bug #3040105 "Broken PDF when using TOC (example 45)" was fixed.
1236
-
1237
- 5.7.000 (2010-08-03)
1238
- - CSS borders are now supported for HTML tables and other block tags (see example n. 61);
1239
- - Cell borders were improved (see example n. 57);
1240
- - Minor bugs were fixed.
1241
-
1242
- ------------------------------------------------------------
1243
-
1244
- 5.6.000 (2010-07-31)
1245
- - A bug with object IDs was fixes.
1246
- - Performances were improved.
1247
-
1248
- ------------------------------------------------------------
1249
-
1250
- 5.5.015 (2010-07-29)
1251
- - Automatic fix for unclosed self-closing tag.
1252
- - Support for deprecated 's' and 'strike' tags was added.
1253
- - Empty list items problem was fixed.
1254
-
1255
- 5.5.014 (2010-07-15)
1256
- - Support for external images was improved.
1257
-
1258
- 5.5.013 (2010-07-14)
1259
- - Bug #3029338 "FI and FO output destination filename bug" was fixed (previous fix was wrong).
1260
-
1261
- 5.5.012 (2010-07-14)
1262
- - Bug #3029310 "Font baseline inconsistencies with line-height and font-size" was fixed.
1263
- - Bug #3029338 "FI and FO output destination filename bug" was fixed.
1264
-
1265
- 5.5.011 (2010-07-09)
1266
- - Support for multiple CSS classes was added.
1267
- - The method getColumn() was added to return the current column number.
1268
- - Some regular Expressions were fixed to be more compatible with UTF-8.
1269
-
1270
- 5.5.010 (2010-07-06)
1271
- - Bug item #3025772 "Borders in all image functions are still flawed" was fixed.
1272
-
1273
- 5.5.009 (2010-07-05)
1274
- - A problem related to last page footer was fixed.
1275
- - Image alignments and fit-on-page features were improved.
1276
-
1277
- 5.5.008 (2010-07-02)
1278
- - A problem on table header alignment in booklet mode was fixed.
1279
- - Default graphic vars are now applied for setHeader();
1280
-
1281
- 5.5.007 (2010-07-02)
1282
- - Attribute "readonly" was added to input and textarea form fields.
1283
- - Vertical alignment feature was added on MultiCell() method only for simple text mode (see example n. 5).
1284
- - Text-Fit feature was added on MultiCell() method only for simple text mode (see example n. 5).
1285
-
1286
- 5.5.006 (2010-06-29)
1287
- - getStringHeight() and getNumLines() methods were fixed.
1288
-
1289
- 5.5.005 (2010-06-28)
1290
- - Bug #3022170 "getFontDescent() does not return correct descent value" was fixed.
1291
- - Some problems with multicolumn mode were fixed.
1292
-
1293
- 5.5.004 (2010-06-27)
1294
- - Bug #3021803 "SVG Border" was fixed.
1295
-
1296
- 5.5.003 (2010-06-26)
1297
- - On Write() method, blank lines at the beginning of a page or column are now automatically removed.
1298
-
1299
- 5.5.002 (2010-06-24)
1300
- - ToUnicode Identity-H name was replaced with a full CMap (to avoid preflight syntax error).
1301
- - Bug #3020638 "str_split() not available in php4" was fixed.
1302
- - Bug #3020665 "file_get_contents() too many parameters for php4" was fixed.
1303
-
1304
- 5.5.001 (2010-06-23)
1305
- - A problem on image streams was fixed.
1306
-
1307
- 5.5.000 (2010-06-22)
1308
- - Several PDF syntax errors (and related bugs) were fixed.
1309
- - Bug #3019090 "/Length values are wrong if AES encryption is used" was fixed.
1310
-
1311
- ------------------------------------------------------------
1312
-
1313
- 5.4.003 (2010-06-19)
1314
- - A problem related to page boxes was fixed.
1315
- - Bug #3016920 "Font subsetting issues when editing pdf" was partially fixed (Note that flattening transparency layers is currently incompatible with TrueTypeUnicode fonts).
1316
-
1317
- 5.4.002 (2010-06-18)
1318
- - A problem related with setProtection() method was fixed.
1319
-
1320
- 5.4.001 (2010-06-18)
1321
- - A problem related with setProtection() method was fixed.
1322
-
1323
- 5.4.000 (2010-06-18)
1324
- - The method setSignatureAppearance() was added, check the example n. 52.
1325
- - Several problems related to font subsetting were fixed.
1326
-
1327
- ------------------------------------------------------------
1328
-
1329
- 5.3.010 (2010-06-15)
1330
- - Previous release was corrupted.
1331
-
1332
- 5.3.009 (2010-06-15)
1333
- - Bug #3015934 "Bullets don't display correctly" was fixed.
1334
-
1335
- 5.3.008 (2010-06-13)
1336
- - This version fixes some problems of SVG rasterization.
1337
-
1338
- 5.3.007 (2010-06-13)
1339
- - This version improves SVG support.
1340
-
1341
- 5.3.006 (2010-06-10)
1342
- - This version includes a change in uniqid calls for backward compatibility with PHP4.
1343
-
1344
- 5.3.005 (2010-06-09)
1345
- - The method getPageSizeFromFormat() was changed to include all standard page formats (includes 281 page formats + variation).
1346
-
1347
- 5.3.004 (2010-06-08)
1348
- - Bug #3013291 "HTML table cell width" was fixed.
1349
- - Bug #3013294 "HTML table cell alignment" was fixed.
1350
- - The columns widths of HTML tables are now inherited from the first row.
1351
-
1352
- 5.3.003 (2010-06-08)
1353
- - Bug #3013102 "HTML table header misaligned after page break" was fixed.
1354
-
1355
- 5.3.002 (2010-06-07)
1356
- - The methods setFontSubsetting() and setFontSubsetting() were added to control the default font subsetting mode (see example n. 1).
1357
- - Bug #3012596 "Whitespace should not appeared after use Thai top characters" was fixed.
1358
- - Examples n. 1, 14, and 54 were updated.
1359
-
1360
- 5.3.001 (2010-06-06)
1361
- - Barcode PDF417 was improved to support Macro Code Blocks (see example n. 50).
1362
-
1363
- 5.3.000 (2010-06-05)
1364
- - License was changed to GNU-LGPLv3 (see the updated LICENSE.TXT file).
1365
- - PDF417 barcode support was added (check the example n. 50).
1366
- - The method write2DBarcode() was improved (some parameters were added and other changed - check example n. 50).
1367
-
1368
- ------------------------------------------------------------
1369
-
1370
- 5.2.000 (2010-06-02)
1371
- - IMPORTANT: Support for font subsetting was added by default to reduce the size of documents using large unicode font files.
1372
- If you embed the whole font in the PDF, the person on the other end can make changes to it even if he didn't have your font.
1373
- If you subset the font, file size of the PDF will be smaller but the person who receives your PDF would need to have your same font in order to make changes to your PDF.
1374
- - The signature of the SetFont() and AddFont() methods were changed to include the font subsetting option (subsetting is applied by default).
1375
- - Examples 14 and 54 were updated.
1376
-
1377
- ------------------------------------------------------------
1378
-
1379
- 5.1.002 (2010-05-27)
1380
- - Bug #3007818 "SetAutoPageBreak fails with MultiCell" was fixed.
1381
- - A bug related to MultiCell() minimun height was fixed.
1382
-
1383
- 5.1.001 (2010-05-26)
1384
- - The problem of blank page after table was fixed.
1385
-
1386
- 5.1.000 (2010-05-25)
1387
- - This version includes support for CSS (Cascading Style Sheets) (see example n. 61).
1388
- - The convertHTMLColorToDec() method was improved.
1389
-
1390
- ------------------------------------------------------------
1391
-
1392
- 5.0.014 (2010-05-21)
1393
- - A problem on color and style of HTML links was fixed.
1394
- - A bug relative to gradients was fixed.
1395
- - The getStringHeight() method was added and getNumLines() method was improved.
1396
- - All examples were updated.
1397
-
1398
- 5.0.013 (2010-05-19)
1399
- - A bug related to page-breaks and table cells was fixed.
1400
-
1401
- 5.0.012 (2010-05-19)
1402
- - Page orientation bug was fixed.
1403
- - The access to method setPageFormat() was changed to 'protected' because it is not intended to be directly called.
1404
-
1405
- 5.0.011 (2010-05-19)
1406
- - Page orientation bug was fixed.
1407
- - Bug #3003966 "Multiple columns and nested lists" was fixed.
1408
-
1409
- 5.0.010 (2010-05-17)
1410
- - The methods setPageFormat(), setPageOrientation() and related methods were extended to include page boxes, page rotations and page transitions.
1411
- - The method setPageBoxes() was added to set page boundaries (MediaBox, CropBox, BleedBox, TrimBox, ArtBox);
1412
- - A bug relative to underline, overline and linethrough was fixed.
1413
-
1414
- 5.0.009 (2010-05-16)
1415
- - Bug #3002381 "Multiple columns and nested lists" was fixed.
1416
-
1417
- 5.0.008 (2010-05-15)
1418
- - Bug "Columns WriteHTML and Justification" was fixed.
1419
-
1420
- 5.0.007 (2010-05-14)
1421
- - Bug #3001347 "Bug when using WriteHTML with setEqualColumns()" was fixed.
1422
- - Bug #3001505 "problem with sup and sub tags at the beginning of a line" was fixed.
1423
-
1424
- 5.0.006 (2010-05-13)
1425
- - Length of hr tag was fixed.
1426
- - An error on 2d barcode method was fixed.
1427
-
1428
- 5.0.005 (2010-05-12)
1429
- - WARNING: The logic of permissions on the SetProtection() method has been inverted and extended (see example 16). Now you have to specify the features you want to block.
1430
- - SetProtection() method was extended to support RSA and AES 128 encryption and public-keys (see example 16).
1431
- - Bug #2999489 "setEqualColumns() and TOC uses wrong columns" was fixed (see the example 10).
1432
-
1433
- 5.0.004 (2010-05-10)
1434
- - HTML line alignment when using sub and sup tags was fixed.
1435
-
1436
- 5.0.003 (2010-05-07)
1437
- - Horizontal alignment was fixed for images and barcodes. Now the X coordinate is always relative to the left margin. Use GetAbsX() instead of GetX() to get the X relative to left margin.
1438
- - Header() method was changed to account for new image alignment rules.
1439
-
1440
- 5.0.002 (2010-05-06)
1441
- - Bookmark() and related methods were fixed to accept HTML code.
1442
- - A problem on HTML links was fixed.
1443
-
1444
- 5.0.001 (2010-05-06)
1445
- - Protected method _putstream was re-added for backward compatibility.
1446
- - The following method were added to display HTML Table Of Content (see example n. 59):
1447
- addTOCPage(), endTOCPage(), addHTMLTOC().
1448
-
1449
- 5.0.000 (2010-05-05)
1450
- - Method ImageSVG() was added to embedd SVG images (see example n. 58). Note that not all SVG images are supported.
1451
- - Method setRasterizeVectorImages() was added to enable/disable rasterization for vector images via ImageMagick library.
1452
- - Method RoundedRectXY() was added.
1453
- - Method PieSectorXY() was added.
1454
- - Gradient() method is now public and support new features.
1455
- - Shading to transparency is now supported.
1456
- - Image alignments were fixed.
1457
- - Support for dynamic images were improved.
1458
- - PDF_IMAGE_SCALE_RATIO has been changed to 1.25 for better compatibility with SVG.
1459
- - RAW and RAW2 modes were added to 2D Barcodes (see example n. 50).
1460
- - Automatic padding feature was added on barcodes (see examples n. 27 and 50).
1461
- - Bug #2995003 "Reproduced thead bug" was fixed.
1462
- - The Output() method now accepts FI and FD destinations to save the document on server before sending it to the client.
1463
- - Ellipse() method was improved and fixed (see page 2 of example n. 12).
1464
-
1465
- ------------------------------------------------------------
1466
-
1467
- 4.9.018 (2010-04-21)
1468
- - Bug item #2990356 "Current font size not respected with more than two HTML <p>" was fixed.
1469
-
1470
- 4.9.017 (2010-04-21)
1471
- - Bug item #2990224 "Different behaviour for equivalent HTML strings" was fixed.
1472
- - Bug item #2990314 "Dash is not appearing with SHY character" was fixed.
1473
-
1474
- 4.9.016 (2010-04-20)
1475
- - An error on htmlcolors.php was fixed.
1476
- - getImageFileType() method was improved.
1477
- - GIF images with transparency are now better supported.
1478
- - Automatic page orientation was improved.
1479
-
1480
- 4.9.015 (2010-04-20)
1481
- - A new method copyPage() was added to clone pages (see example n. 44).
1482
- - Support for text overline was added.
1483
- - Underline and linethrough methods were fixed.
1484
- - Bug #2989058 "SHY character causes unnecessary word-wrapping" was fixed.
1485
-
1486
- 4.9.014 (2010-04-18)
1487
- - Bug item #2988845 was fixed.
1488
-
1489
- 4.9.013 (2010-04-15)
1490
- - Image() and ImageEPS() methods were fixed and improved; $fitonpage parameter was added.
1491
-
1492
- 4.9.012 (2010-04-12)
1493
- - The hyphenateText() method was added to automatically hyphenate text (see example n. 46).
1494
-
1495
- 4.9.011 (2010-04-07)
1496
- - Vertical alignments for Cell() method were improved (see example n. 57).
1497
-
1498
- 4.9.010 (2010-04-06)
1499
- - Signature of Cell() method now includes new parameters for vertical alignment (see example n. 57).
1500
- - Text() method was extended to include all Cell() parameters.
1501
- - HTML line alignment procedure was changed to fix some bugs.
1502
-
1503
- 4.9.009 (2010-04-05)
1504
- - Text() method was fixed for backward compatibility.
1505
-
1506
- 4.9.008 (2010-04-03)
1507
- - Additional line space after table header was removed.
1508
- - Support for HTML lists in multicolumn mode was added.
1509
- - The method setTextRenderingMode() was added to set text rendering modes (see the example n. 26).
1510
- - The following HTML attributes were added to set text rendering modes (see the example n. 26): stroke, strokecolor, fill.
1511
-
1512
- 4.9.007 (2010-04-03)
1513
- - Font Descent computation was fixed (patch #2981441).
1514
-
1515
- 4.9.006 (2010-04-02)
1516
- - The constant K_TCPDF_CALLS_IN_HTML was added on configuration file to enable/disable the ability to call TCPDF methods in HTML.
1517
- - The usage of tcpdf tag in HTML mode was changed to remove the possible security flaw offered by the eval() function (thanks to Matthias Hecker for spotting this security problem). See the new example n. 49 for further information.
1518
-
1519
- 4.9.005 (2010-04-01)
1520
- - Bug# 2980354 "Wrong File attachment description with security" was fixed.
1521
- - Several problems with HTML line alignment were fixed.
1522
- - The constant K_THAI_TOPCHAR was added on configuration file to enable/disable the special procedure used to avoid the overlappind of symbols on Thai language.
1523
- - A problem with font name directory was fixed.
1524
- - A bug on _destroy() method was fixed.
1525
-
1526
- 4.9.004 (2010-03-31)
1527
- - Patch #979681 "GetCharWidth - default character width" was applied (bugfix).
1528
-
1529
- 4.9.003 (2010-03-30)
1530
- - Problem of first <br /> on multiple columns was fixed.
1531
- - HTML line alignment was fixed.
1532
- - A QR-code bug was fixed.
1533
-
1534
- 4.9.002 (2010-03-29)
1535
- - Patch #2978349 "$ignore_min_height is ignored in function Cell()" was applied.
1536
- - Bug #2978607 "2D Barcodes are wrong" was fixed.
1537
- - A problem with HTML block tags was fixed.
1538
- - Artificial italic for CID-0 fonts was added.
1539
- - Several multicolumn bugs were fixed.
1540
- - Support for HTML tables on multicolumn was added.
1541
-
1542
- 4.9.001 (2010-03-28)
1543
- - QR Code minor bug was fixed.
1544
- - Multicolumn mode was added (see the new example n. 10).
1545
- - The following methods were added: setEqualColumns(), setColumnsArray(), selectColumn().
1546
- - Thai diacritics support were changed (note that this is incompatible with html justification).
1547
-
1548
- 4.9.000 (2010-03-27)
1549
- - QR Code (2D barcode) support was added (see example n. 50).
1550
- - The following methods were added to print crop and registration marks (see example n. 56): colorRegistrationBar(), cropMark(), registrationMark().
1551
- - Limited support for CSS line-height property was added.
1552
- - Gradient method now supports Gray, RGB and CMYK space color.
1553
- - Example n. 51 was updated.
1554
- - Vertical alignment of font inside cell was fixed.
1555
- - Support for multiple Thai diacritics was added.
1556
- - Bug item #2974929 "Duplicate case values" was fixed.
1557
- - Bug item #2976729 "File attachment not working with security" was fixed.
1558
-
1559
- ------------------------------------------------------------
1560
-
1561
- 4.8.039 (2010-03-20)
1562
- - Problems related to custom locale settings were fixed.
1563
- - Problems related to HTML on Header and Footer were fixed.
1564
-
1565
- 4.8.038 (2010-03-13)
1566
- - Various bugs related to page-break in HTML mode were fixed.
1567
- - Bug item #2968974 "Another <thead> pagebreak problem" was fixed.
1568
- - Bug item #2969276 "justification problem" was fixed.
1569
- - Bug item #2969289 "bug when using justified text and custom headers" was fixed.
1570
- - Images are now automatically resized to be contained on the page.
1571
- - Some HTML line alignments were fixed.
1572
- - Signature of AddPage() and SetMargins() methods were changed to include an option to set default page margins.
1573
-
1574
- 4.8.037 (2010-03-03)
1575
- - Bug item #2962068 was fixed.
1576
- - Bug item #2967017 "Problems with <thead> and pagebreaks" was fixed.
1577
- - Bug item #2967023 "table header lost with pagebreak" was fixed.
1578
- - Bug item #2967032 "Header lost with nested tables" was fixed.
1579
-
1580
- 4.8.036 (2010-02-24)
1581
- - Automatic page break for HTML images was improved.
1582
- - Example 10 was updated.
1583
- - Japanese was removed from example 8 because the freeserif font doesn't contain japanese (you can display it using arialunicid0 font).
1584
-
1585
- 4.8.035 (2010-02-23)
1586
- - Automatic page break for HTML images was added.
1587
- - Support for multicolumn HTML was added (example 10 was updated).
1588
-
1589
- 4.8.034 (2010-02-17)
1590
- - Language files were updated.
1591
-
1592
- 4.8.033 (2010-02-12)
1593
- - A bug related to protection mode with links was fixed.
1594
-
1595
- 4.8.032 (2010-02-04)
1596
- - A bug related to $maxh parameter on Write() and MultiCell() was fixed.
1597
- - Support for body tag was added.
1598
-
1599
- 4.8.031 (2010-01-30)
1600
- - Bug item #2941589 "paragraph justify not working on some non-C locales" was fixed.
1601
-
1602
- 4.8.030 (2010-01-27)
1603
- - Some text alignment cases were fixed.
1604
-
1605
- 4.8.029 (2010-01-27)
1606
- - Bug item #2941057 "TOC Error in PDF File Output" was fixed.
1607
- - Some text alignment cases were fixed.
1608
-
1609
- 4.8.028 (2010-01-26)
1610
- - Text alignment for RTL mode was fixed.
1611
-
1612
- 4.8.027 (2010-01-25)
1613
- - Bug item #2938412 "Table related problems - thead, nobr, table width" was fixed.
1614
-
1615
- 4.8.026 (2010-01-19)
1616
- - The misspelled word "lenght" was replaced with "length" in some variables and comments.
1617
-
1618
- 4.8.025 (2010-01-18)
1619
- - addExtGState() method was improved to reuse existing ExtGState objects.
1620
-
1621
- 4.8.024 (2010-01-15)
1622
- - Justification mode for HTML was fixed (Bug item #2932470).
1623
-
1624
- 4.8.023 (2010-01-15)
1625
- - Bug item #2932470 "Some HTML entities breaks justification" was fixed.
1626
-
1627
- 4.8.022 (2010-01-14)
1628
- - Source code documentation was fixed.
1629
-
1630
- 4.8.021 (2010-01-03)
1631
- - A Bug relative to Table Of Content index was fixed.
1632
-
1633
- 4.8.020 (2009-12-21)
1634
- - Bug item #2918545 "Display problem of the first row of a table with larger font" was fixed.
1635
- - A Bug relative to table rowspan mode was fixed.
1636
-
1637
- 4.8.019 (2009-12-16)
1638
- - Bug item #2915684 "Image size" was fixed.
1639
- - Bug item #2914995 "Image jpeg quality" was fixed.
1640
- - The signature of the Image() method was changed (check the documentation for the $resize parameter).
1641
-
1642
- 4.8.018 (2009-12-15)
1643
- - Bug item #2914352 "write error" was fixed.
1644
-
1645
- 4.8.017 (2009-11-27)
1646
- - THEAD problem when table is used on header/footer was fixed.
1647
- - A first line alignment on HTML justification was fixed.
1648
- - Method getImageFileType() was added.
1649
- - Images with unknown extension and type are now supported via ImageMagick PHP extension.
1650
-
1651
- 4.8.016 (2009-11-21)
1652
- - Document Information Dictionary was fixed.
1653
- - CSS attributes 'page-break-before', 'page-break-after' and 'page-break-inside' are now supported.
1654
- - Problem of unclosed last page was fixed.
1655
- - Problem of 'thead' unnecessarily repeated on the next page was fixed.
1656
-
1657
- 4.8.015 (2009-11-20)
1658
- - A problem with some PNG transparency images was fixed.
1659
- - Bug #2900762 "Sort issues in Bookmarks" was fixed.
1660
- - Text justification was fixed for various modes: underline, strikeout and background.
1661
-
1662
- 4.8.014 (2009-11-04)
1663
- - Bug item #2891316 "writeHTML, underlining replacing spaces" was fixed.
1664
- - The handling of temporary RTL text direction mode was fixed.
1665
-
1666
- 4.8.013 (2009-10-26)
1667
- - Bug item #2884729 "Problem with word-wrap and hyphen" was fixed.
1668
-
1669
- 4.8.012 (2009-10-23)
1670
- - Table cell alignments for RTL booklet mode were fixed.
1671
- - Images and barcode alignments for booklet mode were fixed.
1672
-
1673
- 4.8.011 (2009-10-22)
1674
- - DejaVu fonts were updated to latest version.
1675
-
1676
- 4.8.010 (2009-10-21)
1677
- - Bookmark for TOC page was added.
1678
- - Signature of addTOC() method is changed.
1679
- - Bookmarks are now automatically sorted by page and Y position.
1680
- - Example n. 45 was updated.
1681
- - Example n. 55 was added to display all charactes available on core fonts.
1682
-
1683
- 4.8.009 (2009-09-30)
1684
- - Compatibility with PHP 5.3 was improved.
1685
- - All examples were updated.
1686
- - Index file for examples was added.
1687
-
1688
- 4.8.008 (2009-09-29)
1689
- - Example 49 was updated.
1690
- - Underline and linethrough now works with cell stretching mode.
1691
-
1692
- 4.8.007 (2009-09-23)
1693
- - Infinite loop problem caused by nobr attribute was fixed.
1694
-
1695
- 4.8.006 (2009-09-23)
1696
- - Bug item #2864522 "No images if DOCUMENT_ROOT=='/'" was fixed.
1697
- - Support for text-indent CSS attribute was added.
1698
- - Method rollbackTransaction() was changed to support self-reassigment of previous object (check source code documentation).
1699
- - Support for the HTML "nobr" attribute was added to avoid splitting a table or a table row on two pages (i.e.: <tr nobr="true">...</tr>).
1700
-
1701
- 4.8.005 (2009-09-17)
1702
- - A bug relative to multiple transformations and annotations was fixed.
1703
-
1704
- 4.8.004 (2009-09-16)
1705
- - A bug on _putannotsrefs() method was fixed.
1706
-
1707
- 4.8.003 (2009-09-15)
1708
- - Bug item #2858754 "Division by zero" was fixed.
1709
- - A bug relative to HTML list items was fixed.
1710
- - A bug relative to form fields on multiple pages was fixed.
1711
- - PolyLine() method was added (see example n. 12).
1712
- - Signature of Polygon() method was changed.
1713
-
1714
- 4.8.002 (2009-09-12)
1715
- - A problem related to CID-0 fonts offset was fixed: if the $cw[1] entry on the CID-0 font file is not defined, then a CID keys offset is introduced.
1716
-
1717
- 4.8.001 (2009-09-09)
1718
- - The appearance streams (AP) for anotations form fields was fixed (see examples n. 14 and 54).
1719
- - Radiobuttons were fixed.
1720
-
1721
- 4.8.000 (2009-09-07)
1722
- - This version includes some support for Forms fields (see example n. 14) and XHTML forms (see example n. 54).
1723
- - The following methods were changed to work without JavaScript: TextField(), RadioButton(), ListBox(), ComboBox(), CheckBox(), Button().
1724
- - Support for Widget annotations was improved.
1725
- - Alignment of annotation objects was fixed (examples 36 and 41 were updated).
1726
- - addJavascriptObject() method was added.
1727
- - Signature of Image() method was changed.
1728
- - htmlcolors.php file was updated.
1729
-
1730
- ------------------------------------------------------------
1731
-
1732
- 4.7.003 (2009-09-03)
1733
- - Support for TCPDF methods on HTML was improved (see example n. 49).
1734
-
1735
- 4.7.002 (2009-09-02)
1736
- - Bug item #2848892 "writeHTML + table: Gaps between rows" was fixed.
1737
- - JavaScript support was fixed (see example n. 53).
1738
-
1739
- 4.7.001 (2009-08-30)
1740
- - The Polygon() and Arrow() methods were fixed and improved (see example n. 12).
1741
-
1742
- 4.7.000 (2009-08-29)
1743
- - This is a major release.
1744
- - Some procedures were internally optimized.
1745
- - The problem of mixed signature and annotations was fixed (example n. 52).
1746
-
1747
- 4.6.030 (2009-08-29)
1748
- - IMPORTANT: percentages on table cell widths are now relative to the full table width (as in standard HTML).
1749
- - Various minor bugs were fixed.
1750
- - Example n. 52 (digital signature) was updated.
1751
-
1752
- 4.6.029 (2009-08-26)
1753
- - PHP4 version was fixed.
1754
-
1755
- 4.6.028 (2009-08-25)
1756
- - Signature algorithm was finally fixed (see example n. 52).
1757
-
1758
- 4.6.027 (2009-08-24)
1759
- - TCPDF now supports unembedded TrueTypeUnicode Fonts (just comment the $file entry on the fonts' php file.
1760
-
1761
- 4.6.026 (2009-08-21)
1762
- - Bug #2841693 "Problem with MultiCell and ishtml and justification" was fixed.
1763
- - Signature functions were improved but not yet fixed (tcpdf.crt and example n. 52 were updated).
1764
-
1765
- 4.6.025 (2009-08-17)
1766
- - Carriage returns (\r) were removed from source code.
1767
- - Problem related to set_magic_quotes_runtime() depracated was fixed.
1768
-
1769
- 4.6.024 (2009-08-07)
1770
- - Bug item #2833556 "justification using other units than mm" was fixed.
1771
- - Documentation was fixed/updated.
1772
-
1773
- 4.6.023 (2009-08-02)
1774
- - Bug item #2830537 "MirrorH can show mask for transparent PNGs" was fixed.
1775
-
1776
- 4.6.022 (2009-07-24)
1777
- - A bug relative to single line printing when using WriteHTMLCell() was fixed.
1778
- - Signature support were improved but is still experimental.
1779
- - Fonts Free and Dejavu were updated to latest versions.
1780
-
1781
- 4.6.021 (2009-07-20)
1782
- - Bug item #2824015 "XHTML Ampersand &amp; in hyperlink bug" was fixed.
1783
- - Bug item #2824036 "Image as hyperlink in table, text displaced at page break" was fixed.
1784
- - Links alignment on justified text was fixed.
1785
- - Unicode "\u" modifier was added to re_spaces variable by default.
1786
-
1787
- 4.6.020 (2009-07-16)
1788
- - Bug item #2821921 "issue in example 18" was fixed.
1789
- - Signature of SetRTL() method was changed.
1790
-
1791
- 4.6.019 (2009-07-13)
1792
- - Bug item #2820703 "xref table broken" was fixed.
1793
-
1794
- 4.6.018 (2009-07-10)
1795
- - Bug item #2819319 "Text over text" was fixed.
1796
- - Method Arrow() was added to print graphic arrows (example 12 was updated).
1797
-
1798
- 4.6.017 (2009-07-05)
1799
- - Bug item #2816079 "Example 48 not working" was fixed.
1800
- - The signature of the checkPageBreak() was changed. The parameter $addpage was added to turn off the automatic page creation.
1801
-
1802
- 4.6.016 (2009-06-16)
1803
- - Method setSpacesRE() was added to set the regular expression used for detecting withespaces or word separators. If you are using chinese, try: setSpacesRE('/[\s\p{Z}\p{Lo}]/');, otherwise you can use setSpacesRE('/[\s\p{Z}]/');
1804
- - The method _putinfo() now automatically fills the metadata with '?' in case of empty string.
1805
-
1806
- 4.6.015 (2009-06-11)
1807
- - Bug #2804667 "word wrap bug" was fixed.
1808
-
1809
- 4.6.014 (2009-06-04)
1810
- - Bug #2800931 "Table thead tag bug" was fixed.
1811
- - A bug related to <pre> tag was fixed.
1812
-
1813
- 4.6.013 (2009-05-28)
1814
- - List bullets position was fixed for RTL languages.
1815
-
1816
- 4.6.012 (2009-05-23)
1817
- - setUserRights() method doesn't work anymore unless you call the setSignature() method with the Adobe private key!
1818
-
1819
- 4.6.011 (2009-05-18)
1820
- - Signature of the Image() method was changed to include the new $fitbox parameter (see source code documentation).
1821
-
1822
- 4.6.010 (2009-05-17)
1823
- - Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null.
1824
- - <tcpdf> tag indent problem was fixed.
1825
- - $y parameter was added to checkPageBreak() method.
1826
- - Bug n. 2791773 "writeHTML" was fixed.
1827
-
1828
- 4.6.009 (2009-05-13)
1829
- - xref table for embedded files was fixed.
1830
-
1831
- 4.6.008 (2009-05-07)
1832
- - setSignature() method was improved (but is still experimental).
1833
- - Example n. 52 was added.
1834
-
1835
- 4.6.007 (2009-05-05)
1836
- - Bug #2786685 "writeHtmlCell and <br /> in custom footer" was fixed.
1837
- - Table header repeating bug was fixed.
1838
- - Some newlines and tabs are now automatically removed from HTML strings.
1839
-
1840
- 4.6.006 (2009-04-28)
1841
- - Support for "<a name="...">...</a>" was added.
1842
- - By default TCPDF requires PCRE Unicode support turned on but now works also without it (with limited ability to detect some Unicode blank spaces).
1843
-
1844
- 4.6.005 (2009-04-25)
1845
- - Points (pt) conversion in getHTMLUnitToUnits() was fixed.
1846
- - Default tcpdf.pem certificate file was added.
1847
- - Experimental support for signing document was added but it is not yet completed (some help is needed - I think that the calculation of the ByteRange is OK and the problem is on the signature calculation).
1848
-
1849
- 4.6.004 (2009-04-23)
1850
- - Method deletePage() was added to delete pages (see example n. 44).
1851
-
1852
- 4.6.003 (2009-04-21)
1853
- - The caching mechanism of the UTF8StringToArray() method was fixed.
1854
-
1855
- 4.6.002 (2009-04-20)
1856
- - Documentation of rollbackTransaction() method was fixed.
1857
- - The setImageScale() and getImageScale() methods now set and get the adjusting parameter used by pixelsToUnits() method.
1858
- - HTML images now support other units of measure than pixels (getHTMLUnitToUnits() is now used instead of pixelsToUnits()).
1859
- - WARNING: PDF_IMAGE_SCALE_RATIO has been changed by default to 1.
1860
-
1861
- 4.6.001 (2009-04-17)
1862
- - Spaces between HTML block tags are now automatically removed.
1863
- - The bug related to cMargin changes between tables was fixed.
1864
-
1865
- 4.6.000 (2009-04-16)
1866
- - WARNING: THIS VERSION CHANGES THE BEHAVIOUR OF $x and $y parameters for several TCPDF methods:
1867
- zero coordinates for $x and $y are now valid coordinates;
1868
- set $x and $y as empty strings to get the current value.
1869
- - Some error caused by 'empty' funtion were fixed.
1870
- - Default color for convertHTMLColorToDec() method was changed to white and the return value for invalid color is false.
1871
- - HTML on footer bug was fixed.
1872
- - The following examples were fixed: 5,7,10,17,19,20,21,33,42,43.
1873
-
1874
- 4.5.043 (2009-04-15)
1875
- - Barcode class (barcode.php) was extended to include new linear barcode types (see example n. 27):
1876
- C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9
1877
- C39+ : CODE 39 with checksum
1878
- C39E : CODE 39 EXTENDED
1879
- C39E+ : CODE 39 EXTENDED + CHECKSUM
1880
- C93 : CODE 93 - USS-93
1881
- S25 : Standard 2 of 5
1882
- S25+ : Standard 2 of 5 + CHECKSUM
1883
- I25 : Interleaved 2 of 5
1884
- I25+ : Interleaved 2 of 5 + CHECKSUM
1885
- C128A : CODE 128 A
1886
- C128B : CODE 128 B
1887
- C128C : CODE 128 C
1888
- EAN2 : 2-Digits UPC-Based Extention
1889
- EAN5 : 5-Digits UPC-Based Extention
1890
- EAN8 : EAN 8
1891
- EAN13 : EAN 13
1892
- UPCA : UPC-A
1893
- UPCE : UPC-E
1894
- MSI : MSI (Variation of Plessey code)
1895
- MSI+ : MSI + CHECKSUM (modulo 11)
1896
- POSTNET : POSTNET
1897
- PLANET : PLANET
1898
- RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
1899
- KIX : KIX (Klant index - Customer index)
1900
- IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200 (NOTE: requires BCMath PHP extension)
1901
- CODABAR : CODABAR
1902
- CODE11 : CODE 11
1903
- PHARMA : PHARMACODE
1904
- PHARMA2T : PHARMACODE TWO-TRACKS
1905
-
1906
- 4.5.042 (2009-04-15)
1907
- - Method Write() was fixed for the strings containing only zero value.
1908
-
1909
- 4.5.041 (2009-04-14)
1910
- - Barcode methods were fixed.
1911
-
1912
- 4.5.040 (2009-04-14)
1913
- - Method Write() was fixed to handle empty strings.
1914
-
1915
- 4.5.039 (2009-04-11)
1916
- - Support for linear barcodes was extended (see example n. 27 and barcodes.php documentation).
1917
-
1918
- 4.5.038 (2009-04-10)
1919
- - Write() method was improved to support separators for Japanese, Korean, Chinese Traditional and Chinese Simplified.
1920
-
1921
- 4.5.037 (2009-04-09)
1922
- - General performances were improved.
1923
- - The signature of the method utf8Bidi() was changed.
1924
- - The method UniArrSubString() was added.
1925
- - Experimental support for 2D barcodes were added (see example n. 50 and 2dbarcodes.php class).
1926
-
1927
- 4.5.036 (2009-04-03)
1928
- - TCPDF methods can be called inside the HTML code (see example n. 49).
1929
- - All tag attributes, such as <p align="center"> must be enclosed within double quotes.
1930
-
1931
- 4.5.035 (2009-03-28)
1932
- - Bug #2717436 "writeHTML rowspan problem (continued)" was fixed.
1933
- - Bug #2719090 "writeHTML fix follow up" was fixed.
1934
- - The method _putuserrights() was changed to avoid Adobe Reader 9.1 crash. This broken the 'trick' that was used to display forms in Acrobat Reader.
1935
-
1936
- 4.5.034 (2009-03-27)
1937
- - Bug #2716914 "Bug writeHTML of a table in body and footer related with pb" was fixed.
1938
- - Bug #2717056 ] "writeHTML problem when setting tr style" was fixed.
1939
- - The signature of the Cell() method was changed.
1940
-
1941
- 4.5.033 (2009-03-27)
1942
- - The support for rowspan/colspan on HTML tables was improved (see example n. 48).
1943
-
1944
- 4.5.032 (2009-03-23)
1945
- - setPrintFooter(false) bug was fixed.
1946
-
1947
- 4.5.031 (2009-03-20)
1948
- - Table header support was extended to multiple pages.
1949
-
1950
- 4.5.030 (2009-03-20)
1951
- - thead tag is now supported on HTML tables (header rows are repeated after page breaks).
1952
- - The startTransaction() was improved to autocommit.
1953
- - List bullets now uses the foreground color (putHtmlListBullet()).
1954
-
1955
- 4.5.029 (2009-03-19)
1956
- - The following methods were added to UNDO commands (see example 47): startTransaction(), commitTransaction(), rollbackTransaction().
1957
- - All examples were updated.
1958
-
1959
- 4.5.028 (2009-03-18)
1960
- - Bug #2690945 "List Bugs" was fixed.
1961
- - HTML text alignment on lists was fixed.
1962
- - The constant PDF_FONT_MONOSPACED was added to the configuration file to define the default monospaced font.
1963
- - The following methods were fixed: getPageWidth(), getPageHeight(), getBreakMargin().
1964
- - All examples were updated.
1965
-
1966
- 4.5.027 (2009-03-16)
1967
- - Method getPageDimensions() was added to get page dimensions.
1968
- - The signature of the following methos were changed: getPageWidth(), getPageHeight(), getBreakMargin().
1969
- - _parsepng() method was fixed for PNG URL images (fread bug).
1970
-
1971
- 4.5.026 (2009-03-11)
1972
- - Bug #2681793 affecting URL images with spaces was fixed.
1973
-
1974
- 4.5.025 (2009-03-10)
1975
- - A small bug affecting hyphenation support was fixed.
1976
- - The method SetDefaultMonospacedFont() was added to define the default monospaced font.
1977
-
1978
- 4.5.024 (2009-03-07)
1979
- - The bug #2666493 was fixed "Footer corrupts document".
1980
-
1981
- 4.5.023 (2009-03-06)
1982
- - The bug #2666688 was fixed "Rowspan in tables".
1983
-
1984
- 4.5.022 (2009-03-05)
1985
- - The bug #2659676 was fixed "refer to #2157099 test 4 < BR > problem still not fixed".
1986
- - addTOC() function bug was fixed.
1987
-
1988
- 4.5.020 (2009-03-03)
1989
- - The following bug was fixed: "function removeSHY corrupts unicode".
1990
-
1991
- 4.5.019 (2009-02-28)
1992
- - The problem of decimal separator using different locale was fixed.
1993
- - The text hyphenation is now supported (see example n. 46).
1994
-
1995
- 4.5.018 (2009-02-26)
1996
- - The _destroy() method was added to unset all class variables and frees memory.
1997
- - Now it's possible to call Output() method multiple times.
1998
-
1999
- 4.5.017 (2009-02-24)
2000
- - A minor bug that raises a PHP warning was fixed.
2001
-
2002
- 4.5.016 (2009-02-24)
2003
- - Bug item #2631200 "getNumLines() counts wrong" was fixed.
2004
- - Multiple attachments bug was fixed.
2005
- - All class variables are now cleared on Output() for memory otpimization.
2006
-
2007
- 4.5.015 (2009-02-18)
2008
- - Bug item #2612553 "function Write() must not break a line on &nbsp; character" was fixed.
2009
-
2010
- 4.5.014 (2009-02-13)
2011
- - Bug item #2595015 "POSTNET Barcode Checksum Error" was fixed (on barcode.php).
2012
- - Pagebreak bug for barcode was fixed.
2013
-
2014
- 4.5.013 (2009-02-12)
2015
- - border attribute is now supported on HTML images (only accepts the same values accepted by Cell()).
2016
-
2017
- 4.5.012 (2009-02-12)
2018
- - An error on image border feature was fixed.
2019
-
2020
- 4.5.011 (2009-02-12)
2021
- - HTML links for images are now supported.
2022
- - height attribute is now supported on HTML cells.
2023
- - $border parameter was added to Image() and ImageEps() methods.
2024
- - The method getNumLines() was added to estimate the number of lines required for the specified text.
2025
-
2026
- 4.5.010 (2009-01-29)
2027
- - Bug n. 2546108 "BarCode Y position" was fixed.
2028
-
2029
- 4.5.009 (2009-01-26)
2030
- - Bug n. 2538094 "Empty pdf file created" was fixed.
2031
-
2032
- 4.5.008 (2009-01-26)
2033
- - setPage() method was fixed to correctly restore graphic states.
2034
- - Source code was cleaned up for performances.
2035
-
2036
- 4.5.007 (2009-01-24)
2037
- - checkPageBreak() and write1DBarcode() methods were fixed.
2038
- - Source code was cleaned up for performances.
2039
- - barcodes.php was updated.
2040
-
2041
- 4.5.006 (2009-01-23)
2042
- - getHTMLUnitToPoints() method was replaced by getHTMLUnitToUnits() to fix HTML units bugs.
2043
-
2044
- 4.5.005 (2009-01-23)
2045
- - Page closing bug was fixed.
2046
-
2047
- 4.5.004 (2009-01-21)
2048
- - The access of convertHTMLColorToDec() method was changed to public
2049
- - Fixed bug on UL tag.
2050
-
2051
- 4.5.003 (2009-01-19)
2052
- - Fonts on different folders are now supported.
2053
-
2054
- 4.5.002 (2009-01-07)
2055
- - addTOC() function was improved (see example n. 45).
2056
-
2057
- 4.5.001 (2009-01-04)
2058
- - The signature of startPageGroup() function was changed.
2059
- - Method Footer() was improved to automatically print page or page-group number (see example n. 23).
2060
- - Protected method formatTOCPageNumber() was added to customize the format of page numbers on the Table Of Content.
2061
- - The signature of addTOC() was changed to include the font used for page numbers.
2062
-
2063
- 4.5.000 (2009-01-03)
2064
- - A new $diskcache parameter was added to class constructor to enable disk caching and reduce RAM memory usage (see example n. 43).
2065
- - The method movePageTo() was added to move pages to previous positions (see example n. 44).
2066
- - The methods getAliasNumPage() and getPageNumGroupAlias() were added to get the alias for page number (needed when using movepageTo()).
2067
- - The methods addTOC() was added to print a Table Of Content (see example n. 45).
2068
- - Imagick class constant was removed for better compatibility with PHP4.
2069
- - All existing examples were updated and new examples were added.
2070
-
2071
- 4.4.009 (2008-12-29)
2072
- - Examples 1 and 35 were fixed.
2073
-
2074
- 4.4.008 (2008-12-28)
2075
- - Bug #2472169 "Unordered bullet size not adjusted for unit type" was fixed.
2076
-
2077
- 4.4.007 (2008-12-23)
2078
- - Bug #2459935 "no unit conversion for header line" was fixed.
2079
- - Example n. 42 for image alpha channel was added.
2080
- - All examples were updated.
2081
-
2082
- 4.4.006 (2008-12-11)
2083
- - Method setLIsymbol() was changed to reflect latest changes in HTML list handling.
2084
-
2085
- 4.4.005 (2008-12-10)
2086
- - Bug item #2413870 "ordered list override value" was fixed.
2087
-
2088
- 4.4.004 (2008-12-10)
2089
- - The protected method getHTMLUnitToPoints() was added to accept various HTML units of measure (em, ex, px, in, cm, mm, pt, pc, %).
2090
- - The method intToRoman() was added to convert integer number to Roman representation.
2091
- - Support fot HTML lists was improved: the CSS property list-style-type is now supported.
2092
-
2093
- 4.4.003 (2008-12-09)
2094
- - Bug item #2412147 "Warning on line 3367" was fixed.
2095
- - Method setHtmlLinksStyle() was added to set default HTML link colors and font style.
2096
- - Method addHtmlLink() was changed to use color and style defined on the inline CSS.
2097
-
2098
- 4.4.002 (2008-12-09)
2099
- - Borders on Multicell() were fixed.
2100
- - Problem of Multicell() on Header function (Bug item #2407579) was fixed.
2101
- - Problem on graphics tranformations applied to Multicell() was fixed.
2102
- - Support for ImageMagick was added.
2103
- - Width calculation for nested tables was fixed.
2104
-
2105
- 4.4.001 (2008-12-08)
2106
- - Some missing core fonts were added on fonts directory.
2107
- - CID0 fonts rendering was fixed.
2108
- - HTML support was improved (<pre> and <tt> tags are now supported).
2109
- - Bug item #2406022 "Left padding bug in MultiCell with maxh" was fixed.
2110
-
2111
- 4.4.000 (2008-12-07)
2112
- - File attachments are now supported (see example n. 41).
2113
- - Font functions were optimized to reduce document size.
2114
- - makefont.php was updated.
2115
- - Linux binaries were added on /fonts/utils
2116
- - All fonts were updated.
2117
- - $autopadding parameter was added to Multicell() to disable automatic padding features.
2118
- - $maxh parameter was added to Multicell() and Write() to set a maximum height.
2119
-
2120
- 4.3.009 (2008-12-05)
2121
- - Bug item #2392989 (Custom header + setlinewidth + cell border bug) was fixed.
2122
-
2123
- 4.3.008 (2008-12-05)
2124
- - Bug item #2390566 "rect bug" was fixed.
2125
- - File path was fixed for font embedded files.
2126
- - SetFont() method signature was changed to include the font filename.
2127
- - Some font-related methods were improved.
2128
- - Methods getFontFamily() and getFontStyle() were added.
2129
-
2130
- 4.3.007 (2008-12-03)
2131
- - PNG alpha channel is now supported (GD library is required).
2132
- - AddFont() function now support custom font file path on $file parameter.
2133
- - The default width variable ($dw) is now always defined for any font.
2134
- - The 'Style' attribute on CID-0 fonts was removed because of protection bug.
2135
-
2136
- 4.3.006 (2008-12-01)
2137
- - A regular expression on getHtmlDomArray() to find HTML tags was fixed.
2138
-
2139
- 4.3.005 (2008-11-25)
2140
- - makefont.php was fixed.
2141
- - Bug item #2339877 was fixed (false loop condition detected on WriteHTML()).
2142
- - Bug item #2336733 was fixed (lasth value update on Multicell() when border and fill are disabled).
2143
- - Bug item #2342303 was fixed (automatic page-break on Image() and ImageEPS()).
2144
-
2145
- 4.3.004 (2008-11-19)
2146
- - Function _textstring() was fixed (bug 2309051).
2147
- - All examples were updated.
2148
-
2149
- 4.3.003 (2008-11-18)
2150
- - CID-0 font bug was fixed.
2151
- - Some functions were optimized.
2152
- - Function getGroupPageNoFormatted() was added.
2153
- - Example n. 23 was updated.
2154
-
2155
- 4.3.002 (2008-11-17)
2156
- - Bug item #2305518 "CID-0 font don't work with encryption" was fixed.
2157
-
2158
- 4.3.001 (2008-11-17)
2159
- - Bug item #2300007 "download mimetype pdf" was fixed.
2160
- - Double quotes were replaced by single quotes to improve PHP performances.
2161
- - A bug relative to HTML cell borders was fixed.
2162
-
2163
- 4.3.000 (2008-11-14)
2164
- - The function setOpenCell() was added to set the top/bottom cell sides to be open or closed when the cell cross the page.
2165
- - A bug relative to list items indentation was fixed.
2166
- - A bug relative to borders on HTML tables and Multicell was fixed.
2167
- - A bug relative to rowspanned cells was fixed.
2168
- - A bug relative to html images across pages was fixed.
2169
-
2170
- 4.2.009 (2008-11-13)
2171
- - Spaces between li tags are now automatically removed.
2172
-
2173
- 4.2.008 (2008-11-12)
2174
- - A bug relative to fill color on next page was fixed.
2175
-
2176
- 4.2.007 (2008-11-12)
2177
- - The function setListIndentWidth() was added to set custom indentation widht for HTML lists.
2178
-
2179
- 4.2.006 (2008-11-06)
2180
- - A bug relative to HTML justification was fixed.
2181
-
2182
- 4.2.005 (2008-11-06)
2183
- - A bug relative to HTML justification was fixed.
2184
- - The methods formatPageNumber() and PageNoFormatted() were added to format page numbers.
2185
- - Default Footer() method was changed to use PageNoFormatted() instead of PageNo().
2186
- - Example 6 was updated.
2187
-
2188
- 4.2.004 (2008-11-04)
2189
- - Bug item n. 2217039 "filename handling improvement" was fixed.
2190
-
2191
- 4.2.003 (2008-10-31)
2192
- - Font style bug was fixed.
2193
-
2194
- 4.2.002 (2008-10-31)
2195
- - Bug item #2210922 (htm element br not work) was fixed.
2196
- - Write() function was improved to support margin changes.
2197
-
2198
- 4.2.001 (2008-10-30)
2199
- - setHtmlVSpace($tagvs) function was added to set custom vertical spaces for HTML tags.
2200
- - writeHTML() function now support margin changes during execution.
2201
- - Signature of addHTMLVertSpace() function is changed.
2202
-
2203
- 4.2.000 (2008-10-29)
2204
- - htmlcolors.php was changed to support class-loaders.
2205
- - ImageEps() function was improved in performances.
2206
- - Signature of Link() And Annotation() functions were changed.
2207
- - (Bug item #2198926) Links and Annotations alignment were fixed (support for geometric tranformations was added).
2208
- - rowspan mode for HTML table cells was improved and fixed.
2209
- - Booklet mode for double-sided pages was added; see SetBooklet() function and example n. 40.
2210
- - lastPage() signature is changed.
2211
- - Signature of Write() function is changed.
2212
- - Some HTML justification problems were fixed.
2213
- - Some functions were fixed to better support RTL mode.
2214
- - Example n. 10 was changed to support RTL mode.
2215
- - All examples were updated.
2216
-
2217
- 4.1.004 (2008-10-23)
2218
- - unicode_data.php was changed to support class-loaders.
2219
- - Bug item #2186040/2 (writeHTML margin problem) was fixed.
2220
-
2221
- 4.1.003 (2008-10-22)
2222
- - Bug item #2185399 was fixed (rowspan and page break).
2223
- - Bugs item #2186040 was fixed (writeHTML margin problem).
2224
- - Newline after table was removed.
2225
-
2226
- 4.1.002 (2008-10-21)
2227
- - Bug item #2184525 was fixed (rowspan on HTML cell).
2228
-
2229
- 4.1.001 (2008-10-21)
2230
- - Support for "start" attribute was added to HTML ordered list.
2231
- - unicode_data.php file was changed to include UTF-8 to ASCII table.
2232
- - Some functions were modified to better support UTF-8 extensions to core fonts.
2233
- - Support for images on HTML lists was improved.
2234
- - Examples n. 1 and 6 were updated.
2235
-
2236
- 4.1.000 (2008-10-18)
2237
- - Page-break bug using HTML content was fixed.
2238
- - The "false" parameter was reintroduced to class_exists function on PHP5 version to avoid autoload.
2239
- - addHtmlLink() function was improved to support internal links (i.e.: <a href="#23">link to page 23</a>).
2240
- - Justification alignment is now supported on HTML (see example n. 39).
2241
- - example_006.php was updated.
2242
-
2243
- 4.0.033 (2008-10-13)
2244
- - Bug n. 2157099 was fixed.
2245
- - SetX() and SetY() functions were improved.
2246
- - SetY() includes a new parameter to avoid the X reset.
2247
-
2248
- 4.0.032 (2008-10-10)
2249
- - Bug n. 2156926 was fixed (bold, italic, underlined, linethrough).
2250
- - setStyle() method was removed.
2251
- - Configuration file was changed to use helvetica (non-unicode) font by default.
2252
- - The use of mixed font types was improved.
2253
- - All examples were updated.
2254
-
2255
- 4.0.031 (2008-10-09)
2256
- - _putannots() and _putbookmarks() links alignments were fixed.
2257
-
2258
- 4.0.030 (2008-10-07)
2259
- - _putbookmarks() function was fixed.
2260
- - _putannots() was fixed to include internal links.
2261
-
2262
- 4.0.029 (2008-09-27)
2263
- - Infinite loop bug was fixed [Bug item #130309].
2264
- - Multicell() problem on Header() was fixed.
2265
-
2266
- 4.0.028 (2008-09-26)
2267
- - setLIsymbol() was added to set the LI symbol used on UL lists.
2268
- - Missing $padding and $encryption_key variables declarations were added [Bug item #2129058].
2269
-
2270
- 4.0.027 (2008-09-19)
2271
- - Bug #2118588 "Undefined offset in tcpdf.php on line 9581" was fixed.
2272
- - arailunicid0.php font was updated.
2273
- - The problem of javascript form fields duplication after saving was fixed.
2274
-
2275
- 4.0.026 (2008-09-17)
2276
- - convertHTMLColorToDec() function was improved to support rgb(RR,GG,BB) notation.
2277
- - The following inline CSS attributes are now supported: text-decoration, color, background-color and font-size names: xx-small, x-small, small, medium, large, x-large, xx-large
2278
- - Example n. 6 was updated.
2279
-
2280
- 4.0.025 (2008-09-15)
2281
- - _putcidfont0 function was improved to include CJK fonts (Chinese, Japanese, Korean, CJK, Asian fonts) without embedding.
2282
- - arialunicid0 font was added (see the new example n. 38).
2283
- - The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php.
2284
-
2285
- 4.0.024 (2008-09-12)
2286
- - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4.
2287
- - support for Spot Colors were added. Check the new example n. 37 and the following new functions:
2288
- AddSpotColor()
2289
- SetDrawSpotColor()
2290
- SetFillSpotColor()
2291
- SetTextSpotColor()
2292
- _putspotcolors()
2293
- - Bookmark() function was improved to fix wrong levels.
2294
- - $lasth changes after header/footer calls were fixed.
2295
-
2296
- 4.0.023 (2008-09-05)
2297
- - Some HTML related problems were fixed.
2298
- - Image alignment on HTML was changed, now it always defaults to the normal mode (see example_006.php).
2299
-
2300
- 4.0.022 (2008-08-28)
2301
- - Line height on HTML was fixed.
2302
- - Image inside an HTML cell problem was fixed.
2303
- - A new "zarbold" persian font was added.
2304
-
2305
- 4.0.021 (2008-08-24)
2306
- - HTTP headers were fixed on Output function().
2307
- - getAliasNbPages() and getPageGroupAlias() functions were changed to support non-unicode fonts on unicode documents.
2308
- - Function Write() was fixed.
2309
- - The problem of additional vertical spaces on HTML was fixed.
2310
- - The problem of frame around HTML links was fixed.
2311
-
2312
- 4.0.020 (2008-08-15)
2313
- - "[2052259] WriteHTML <u> & <b>" bug was fixed.
2314
-
2315
- 4.0.019 (2008-08-13)
2316
- - "Rowspan on first cell" bug was fixed.
2317
-
2318
- 4.0.018 (2008-08-08)
2319
- - Default cellpadding for HTML tables was fixed.
2320
- - Annotation() function was added to support some PDF annotations (see example_036.php and section 8.4 of PDF reference 1.7).
2321
- - HTML links are now correclty shifted during line alignments.
2322
- - function getAliasNbPages() was added and Footer() was updated.
2323
- - RowSpan mode for HTML tables was fixed.
2324
- - Bugs item #2043610 "Multiple sizes vertical align wrong" was fixed.
2325
- - ImageEPS() function was improved and RTL alignment was fixed (see example_032.php).
2326
-
2327
- 4.0.017 (2008-08-05)
2328
- - Missing CNZ and CEO style modes were added to Rect() function.
2329
- - Fonts utils were updated to include support for OpenType fonts.
2330
- - getLastH() function was added.
2331
-
2332
- 4.0.016 (2008-07-30)
2333
- - setPageMark() function was added. This function must be called after calling Image() function for a background image.
2334
-
2335
- 4.0.015 (2008-07-29)
2336
- - Some functions were changed to support different page formats (see example_028.php).
2337
- - The signature of setPage() function is changed.
2338
-
2339
- 4.0.014 (2008-07-29)
2340
- - K_PATH_MAIN calculation on tcpdf_config.php was fixed.
2341
- - HTML support for EPS/AI images was added (see example_006.php).
2342
- - Bugs item #2030807 "Truncated text on multipage html fields" was fixed.
2343
- - PDF header bug was fixed.
2344
- - helvetica was added as default font family.
2345
- - Stroke mode was fixed on Text function.
2346
- - several minor bugs were fixed.
2347
-
2348
- 4.0.013 (2008-07-27)
2349
- - Bugs item #2027799 " Big spaces between lines after page break" was fixed.
2350
- - K_PATH_MAIN calculation on tcpdf_config.php was changed.
2351
- - Function setVisibility() was fixed to avoid the "Incorrect PDEObject type" error message.
2352
-
2353
- 4.0.012 (2008-07-24)
2354
- - Addpage(), Header() and Footer() functions were changed to simplify the implementation of external header/footer functions.
2355
- - The following functions were added:
2356
- setHeader()
2357
- setFooter()
2358
- getImageRBX()
2359
- getImageRBY()
2360
- getCellHeightRatio()
2361
- getHeaderFont()
2362
- getFooterFont()
2363
- getRTL()
2364
- getBarcode()
2365
- getHeaderData()
2366
- getHeaderMargin()
2367
- getFooterMargin()
2368
-
2369
- 4.0.011 (2008-07-23)
2370
- - Font support was improved.
2371
- - The folder /fonts/utils contains new utilities and instructions for embedd font files.
2372
- - Documentation was updated.
2373
-
2374
- 4.0.010 (2008-07-22)
2375
- - HTML tables were fixed to work across pages.
2376
- - Header() and Footer() functions were updated to preserve previous settings.
2377
- - example_035.php was added.
2378
-
2379
- 4.0.009 (2008-07-21)
2380
- - UTF8StringToArray() function was fixed for non-unicode mode.
2381
-
2382
- 4.0.008 (2008-07-21)
2383
- - Barcodes alignment was fixed (see example_027.php).
2384
- - unicode_data.php was updated.
2385
- - Arabic shaping for "Zero-Width Non-Joiner" character (U+200C) was fixed.
2386
-
2387
- 4.0.007 (2008-07-18)
2388
- - str_split was replaced by preg_split for compatibility with PHP4 version.
2389
- - Clipping mode was added to all graphic functions by using parameter $style = "CNZ" or "CEO" (see example_034.php).
2390
-
2391
- 4.0.006 (2008-07-16)
2392
- - HTML rowspan bug was fixed.
2393
- - Line style for MultiCell() was fixed.
2394
- - WriteHTML() function was improved.
2395
- - CODE128C barcode was fixed (barcodes.php).
2396
-
2397
- 4.0.005 (2008-07-11)
2398
- - Bug [2015715] "PHP Error/Warning" was fixed.
2399
-
2400
- 4.0.004 (2008-07-09)
2401
- - HTML cell internal padding was fixed.
2402
-
2403
- 4.0.003 (2008-07-08)
2404
- - Removed URL encoding when F option is selected on Output() function.
2405
- - fixed some minor bugs in html tables.
2406
-
2407
- 4.0.002 (2008-07-07)
2408
- - Bug [2000861] was still unfixed and has been fixed.
2409
-
2410
- 4.0.001 (2008-07-05)
2411
- - Bug [2000861] was fixed.
2412
-
2413
- 4.0.000 (2008-07-03)
2414
- - THIS IS A MAIN RELEASE THAT INCLUDES SEVERAL NEW FEATURES AND BUGFIXES
2415
- - Signature fo SetTextColor() and SetFillColor() functions was changed (parameter $storeprev was removed).
2416
- - HTML support was completely rewritten and improved (see example 6).
2417
- - Alignments parameters were fixed.
2418
- - Functions GetArrStringWidth() and GetStringWidth() now include font parameters.
2419
- - Fonts support was improved.
2420
- - All core fonts were replaced and moved to fonts/ directory.
2421
- - The following functions were added: getMargins(), getFontSize(), getFontSizePt().
2422
- - File config/tcpdf_config_old.php was renamed tcpdf_config_alt.php and updated.
2423
- - Multicell and WriteHTMLCell fill function was fixed.
2424
- - Several minor bugs were fixed.
2425
- - barcodes.php was updated.
2426
- - All examples were updated.
2427
-
2428
- ------------------------------------------------------------
2429
-
2430
- 3.1.001 (2008-06-13)
2431
- - Bug [1992515] "K_PATH_FONTS default value wrong" was fixed.
2432
- - Vera font was removed, DejaVu font and Free fonts were updated.
2433
- - Image handling was improved.
2434
- - All examples were updated.
2435
-
2436
- 3.1.000 (2008-06-11)
2437
- - setPDFVersion() was added to change the default PDF version (currently 1.7).
2438
- - setViewerPreferences() was added to control the way the document is to be presented on the screen or printed (see example 29).
2439
- - SetDisplayMode() signature was changed (new options were added).
2440
- - LinearGradient(), RadialGradient(), CoonsPatchMesh() functions were added to print various color gradients (see example 30).
2441
- - PieSector() function was added to render render pie charts (see example 31).
2442
- - ImageEps() was added to display EPS and AI images with limited support (see example 32).
2443
- - writeBarcode() function is now depracated, a new write1DBarcode() function was added. The barcode directory was removed and a new barcodes.php file was added.
2444
- - The new write1DBarcode() function support more barcodes and do not need the GD library (see example 027). All barcodes are directly written to PDF using graphic functions.
2445
- - HTML lists were improved and could be nested (you may now represent trees).
2446
- - AddFont() bug was fixed.
2447
- - _putfonts() bug was fixed.
2448
- - graphics functions were fixed.
2449
- - unicode_data.php file was updated (fixed).
2450
- - almohanad font was updated.
2451
- - example 18 was updated (Farsi and Arabic languages).
2452
- - source code cleanup.
2453
- - All examples were updated and new examples were added.
2454
-
2455
- 3.0.015 (2008-06-06)
2456
- - AddPage() function signature is changed to include page format.
2457
- - example 28 was added to show page format changes.
2458
- - setPageUnit() function was added to change the page units of measure.
2459
- - setPageFormat() function was added to change the page format and orientation between pages.
2460
- - setPageOrientation() function was added to change the page orientation.
2461
- - Arabic font shaping was fixed for laa letter and square boxes (see the example 18).
2462
-
2463
- 3.0.014 (2008-06-04)
2464
- - Arabic font shaping was fixed.
2465
- - setDefaultTableColumns() function was added.
2466
- - $cell_height_ratio variable was added.
2467
- - setCellHeightRatio() function was added to define the default height of cell repect font height.
2468
-
2469
- 3.0.013 (2008-06-03)
2470
- - Multicell height parameter was fixed.
2471
- - Arabic font shaping was improved.
2472
- - unicode_data.php was updated.
2473
-
2474
- 3.0.012 (2008-05-30)
2475
- - K_PATH_MAIN and K_PATH_URL constants are now automatically set on config file.
2476
- - DOCUMENT_ROOT constant was fixed for IIS Webserver (config file was updated).
2477
- - Arabic font shaping was improved.
2478
- - TranslateY() function was fixed (bug [1977962]).
2479
- - setVisibility() function was fixed.
2480
- - writeBarcode() function was fixed to scale using $xref parameter.
2481
- - All examples were updated.
2482
-
2483
- 3.0.011 (2008-05-23)
2484
- - CMYK color support was added to all graphic functions.
2485
- - HTML table support was improved:
2486
- -- now it's possible to include additional html tags inside a cell;
2487
- -- colspan attribute was added.
2488
- - example 006 was updated.
2489
-
2490
- 3.0.010 (2008-05-21)
2491
- - fixed $laa_array inclusion on utf8Bidi() function.
2492
-
2493
- 3.0.009 (2008-05-20)
2494
- - unicode_data.php was updated.
2495
- - Arabic laa letter problem was fixed.
2496
-
2497
- 3.0.008 (2008-05-12)
2498
- - Arabic support was fixed and improved (unicode_data.php was updated).
2499
- - Polycurve() function was added to draw a poly-Bezier curve.
2500
- - list items alignment was fixed.
2501
- - example 6 was updated.
2502
-
2503
- 3.0.007 (2008-05-06)
2504
- - Arabic support was fixed and improved.
2505
- - AlMohanad (arabic) font was added.
2506
- - C128 barcode bugs were fixed.
2507
-
2508
- 3.0.006 (2008-04-21)
2509
- - Condition to check negative width values was added.
2510
-
2511
- 3.0.005 (2008-04-18)
2512
- - back-Slash character escape was fixed on writeHTML() function.
2513
- - Exampe 6 was updated.
2514
-
2515
- 3.0.004 (2008-04-11)
2516
- - Bug [1939304] (Right to Left Issue) was fixed.
2517
-
2518
- 3.0.003 (2008-04-07)
2519
- - Bug [1934523](Words between HTML tags in cell not kept on one line) was fixed.
2520
- - "face" attribute of "font" tag is now fully supported.
2521
-
2522
- 3.0.002 (2008-04-01)
2523
- - Write() functions now return the number of cells and not the number of lines.
2524
- - TCPDF is released under LGPL 2.1, or any later version.
2525
-
2526
- 3.0.001 (2008-05-28)
2527
- - _legacyparsejpeg() and _legacyparsepng() were renamed _parsejpeg() and _parsepng().
2528
- - function writeBarcode() was fixed.
2529
- - all examples were updated.
2530
- - example 27 was added to show various barcodes.
2531
-
2532
- 3.0.000 (2008-03-27)
2533
- - private function pixelsToMillimeters() was changed to public function pixelsToUnits() to fix html image size bug.
2534
- - Image-related functions were rewritten.
2535
- - resize parameter was added to Image() signature to reduce the image size and fit width and height (see example 9).
2536
- - TCPDF now supports all images supported by GD library: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM.
2537
- - CMYK support was added to SetDrawColor(), SetFillColor(), SetTextColor() (see example 22).
2538
- - Page Groups were added (see example 23).
2539
- - setVisibility() function was added to restrict the rendering of some elements to screen or printout (see example 24).
2540
- - All private variables and functions were changed to protected.
2541
- - setAlpha() function was added to give transparency support for all objects (see example 25).
2542
- - Clipping and stroke modes were added to Text() function (see example 26).
2543
- - All examples were moved to "examples" directory.
2544
- - function setJPEGQuality() was added to set the JPEG image comrpession (see example 9).
2545
-
2546
- 2.9.000 (2008-03-26)
2547
- - htmlcolors.php file was added to include html colors.
2548
- - Support for HTML color names and three-digit hexadecimal color codes was added.
2549
- - private function convertColorHexToDec() was renamed convertHTMLColorToDec().
2550
- - color and bgcolor attributes are now supported on all HTML tags (color nesting is also supported).
2551
- - Write() function were fixed.
2552
- - example_006.php was updated.
2553
- - private function setUserRights() was added to release user rights on Acrobat Reader (this allows to display forms, see example 14)
2554
-
2555
- 2.8.000 (2008-03-20)
2556
- - Private variables were changed to protected.
2557
- - Function Write() was fixed and improved.
2558
- - Support for dl, dt, dd, del HTML tags was introduced.
2559
- - Line-trought mode was added for HTML and text.
2560
- - Text vertical alignment on cells were fixed.
2561
- - Examples were updated to reflect changes.
2562
-
2563
- 2.7.002 (2008-03-13)
2564
- - Bug "[1912142] Encrypted PDF created/modified date" was fixed.
2565
-
2566
- 2.7.001 (2008-03-10)
2567
- - Cell justification was fixed for non-unicode mode.
2568
-
2569
- 2.7.000 (2008-03-09)
2570
- - Cell() stretching mode 4 (forced character spacing) was fixed.
2571
- - writeHTMLCell() now uses Multicell() to write.
2572
- - Multicell() has a new parameter $ishtml to act as writeHTMLCell().
2573
- - Write() speed was improved for non-arabic strings.
2574
- - Example n. 20 was changed.
2575
-
2576
- 2.6.000 (2008-03-07)
2577
- - various alignments bugs were fixed.
2578
-
2579
- 2.5.000 (2008-03-07)
2580
- - Several bugs were fixed.
2581
- - example_019.php was added to test non-unicode mode using old fonts.
2582
-
2583
- 2.4.000 (2008-03-06)
2584
- - RTL support was deeply improved.
2585
- - GetStringWidth() was fixed to support RTL languages.
2586
- - Text() RTL alignment was fixed.
2587
- - Some functions were added: GetArrStringWidth(), GetCharWidth(), uniord(), utf8Bidi().
2588
- - example_018.php was added and test_unicode.php was removed.
2589
-
2590
- 2.3.000 (2008-03-05)
2591
- - MultiCell() signature is changed. Now support multiple columns across pages (see example_017).
2592
- - Write() signature is changed. Now support the cell mode to be used with MultiCell.
2593
- - Header() and Footer() were changed.
2594
- - The following functions were added: UTF8ArrSubString() and unichr().
2595
- - Examples were updated to reflect last changes.
2596
-
2597
- 2.2.004 (2008-03-04)
2598
- - Several examples were added.
2599
- - AddPage() Header() and Footer() were fixed.
2600
- - Documentation is now available on http://www.tcpdf.org
2601
-
2602
- 2.2.003 (2008-03-03)
2603
- - [1894853] Performance of MultiCell() was improved.
2604
- - RadioButton and ListBox functions were added.
2605
- - javascript form functions were rewritten and properties names are changed. The properties function supported by form fields are listed on Possible values are listed on http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf.
2606
-
2607
- 2.2.002 (2008-02-28)
2608
- - [1900495] html images path was fixed.
2609
- - Legacy image functions were reintroduced to allow PNG and JPEG support without GD library.
2610
-
2611
- 2.2.001 (2008-02-16)
2612
- - The bug "[1894700] bug with replace relative path" was fixed
2613
- - Justification was fixed
2614
-
2615
- 2.2.000 (2008-02-12)
2616
- - fixed javascript bug introduced with latest release
2617
-
2618
- 2.1.002 (2008-02-12)
2619
- - Justify function was fixed on PHP4 version.
2620
- - Bookmank function was added ([1578250] Table of contents).
2621
- - Javascript and Form fields support was added ([1796359] Form fields).
2622
-
2623
- 2.1.001 (2008-02-10)
2624
- - The bug "[1885776] Race Condition in function justitfy" was fixed.
2625
- - The bug "[1890217] xpdf complains that pdf is incorrect" was fixed.
2626
-
2627
- 2.1.000 (2008-01-07)
2628
- - FPDF_FONTPATH constant was changed to K_PATH_FONTS on config file
2629
- - Bidirectional Algorithm to correctly reverse bidirectional languages was added.
2630
- - SetLeftMargin, SetTopMargin, SetRightMargin functions were fixed.
2631
- - SetCellPadding function was added.
2632
- - writeHTML was updated with new parameters.
2633
- - Text function was fixed.
2634
- - MultiCell function was fixed, now works also across multiple pages.
2635
- - Line width was fixed on Header and Footer functions and <hr> tag.
2636
- - "GetImageSize" was renamed "getimagesize".
2637
- - Document version was changed from 1.3 to 1.5.
2638
- - _begindoc() function was fixed.
2639
- - ChangeDate was fixed and ModDate was added.
2640
- - The following functions were added:
2641
- setPage() : Move pointer to the specified document page.
2642
- getPage() : Get current document page number.
2643
- lastpage() : Reset pointer to the last document page.
2644
- getNumPages() : Get the total number of inserted pages.
2645
- GetNumChars() : count the number of (UTF-8) characters in a string.
2646
- - $stretch parameter was added to Cell() function to fit text on cell:
2647
- 0 = disabled
2648
- 1 = horizontal scaling only if necessary
2649
- 2 = forced horizontal scaling
2650
- 3 = character spacing only if necessary
2651
- 4 = forced character spacing
2652
- - Line function was fixed for RTL.
2653
- - Graphic transformation functions were added [1811158]:
2654
- StartTransform()
2655
- StopTransform()
2656
- ScaleX()
2657
- ScaleY()
2658
- ScaleXY()
2659
- Scale()
2660
- MirrorH()
2661
- MirrorV()
2662
- MirrorP()
2663
- MirrorL()
2664
- TranslateX()
2665
- TranslateY()
2666
- Translate()
2667
- Rotate()
2668
- SkewX()
2669
- SkewY()
2670
- Skew()
2671
- - Graphic function were added/updated [1688549]:
2672
- SetLineStyle()
2673
- _outPoint()
2674
- _outLine()
2675
- _outRect()
2676
- _outCurve()
2677
- Line()
2678
- Rect()
2679
- Curve
2680
- Ellipse
2681
- Circle
2682
- Polygon
2683
- RegularPolygon
2684
-
2685
- 2.0.000 (2008-01-04)
2686
- - RTL (Right-To-Left) languages support was added. Language direction is set using the $l['a_meta_dir'] setting on /configure/language/xxx.php language files.
2687
- - setRTL($enable) method was added to manually enable/disable the RTL text direction.
2688
- - The attribute "dir" was added to support custom text direction on HTML tags. Possible values are: ltr - for Left-To-Right and RTL for Right-To-Left.
2689
- - RC4 40bit encryption was added. Check the SetProtection method.
2690
- - [1815213] Improved image support for GIF, JPEG, PNG formats.
2691
- - [1800094] Attribute "value" was added to ordered list items <li>.
2692
- - Image function now has a new "align" parameter that indicates the alignment of the pointer next to image insertion and relative to image height. The value can be:
2693
- T: top-right for LTR or top-left for RTL
2694
- M: middle-right for LTR or middle-left for RTL
2695
- B: bottom-right for LTR or bottom-left for RTL
2696
- N: next line
2697
- - Attribute "align" was added to <img> html tag to set the above image "align" parameter. Possible values are:
2698
- top: top-right for LTR or top-left for RTL
2699
- middle: middle-right for LTR or middle-left for RTL
2700
- bottom: bottom-right for LTR or bottom-left for RTL
2701
- - [1798103] newline was added after </ul>, </ol> and </p> tages.
2702
- - [1816393] Documentation was updated.
2703
- - 'ln' parameter was fixed on writeHTMLCell. Now it's possible to print two or more columns across several pages;
2704
- - The method lastPage() was added to move the pointer on the last page;
2705
-
2706
- ------------------------------------------------------------
2707
-
2708
- 1.53.0.TC034 (2007-07-30)
2709
- - fixed htmlentities conversion.
2710
- - MultiCell() function returns the number of cells.
2711
-
2712
- 1.53.0.TC033 (2007-07-30)
2713
- - fixed bug 1762550: case sensitive for font files
2714
- - NOTE: all fonts files names must be in lowercase!
2715
-
2716
- 1.53.0.TC032 (2007-07-27)
2717
- - setLastH method was added to resolve bug 1689071.
2718
- - all fonts names were converted in lowercase (bug 1713005).
2719
- - bug 1740954 was fixed.
2720
- - justification was added as Cell option.
2721
-
2722
- 1.53.0.TC031 (2007-03-20)
2723
- - ToUnicode CMap were added on _puttruetypeunicode function. Now you may search and copy unicode text.
2724
-
2725
- 1.53.0.TC030 (2007-03-06)
2726
- - fixed bug on PHP4 version.
2727
-
2728
- 1.53.0.TC029 (2007-03-06)
2729
- - DejaVu Fonts were added.
2730
-
2731
- 1.53.0.TC028 (2007-03-03)
2732
- - MultiCell function signature were changed: the $ln parameter were added. Check documentation for further information.
2733
- - Greek language were added on example sentences.
2734
- - setPrintHeader() and setPrintFooter() functions were added to enable or disable page header and footer.
2735
-
2736
- 1.53.0.TC027 (2006-12-14)
2737
- - $attr['face'] bug were fixed.
2738
- - K_TCPDF_EXTERNAL_CONFIG control where introduced on /config/tcpdf_config.php to use external configuration files.
2739
-
2740
- 1.53.0.TC026 (2006-10-28)
2741
- - writeHTML function call were fixed on examples.
2742
-
2743
- 1.53.0.TC025 (2006-10-27)
2744
- - Bugs item #1421290 were fixed (0D - 0A substitution in some characters)
2745
- - Bugs item #1573174 were fixed (MultiCell documentation)
2746
-
2747
- 1.53.0.TC024 (2006-09-26)
2748
- - getPageHeight() function were fixed (bug 1543476).
2749
- - fixed missing breaks on closedHTMLTagHandler function (bug 1535263).
2750
- - fixed extra spaces on Write function (bug 1535262).
2751
-
2752
- 1.53.0.TC023 (2006-08-04)
2753
- - paths to barcode directory were fixed.
2754
- - documentation were updated.
2755
-
2756
- 1.53.0.TC022 (2006-07-16)
2757
- - fixed bug: [ 1516858 ] Probs with PHP autoloader and class_exists()
2758
-
2759
- 1.53.0.TC021 (2006-07-01)
2760
- - HTML attributes with whitespaces are now supported (thanks to Nelson Benitez for his support)
2761
-
2762
- 1.53.0.TC020 (2006-06-23)
2763
- - code cleanup
2764
-
2765
- 1.53.0.TC019 (2006-05-21)
2766
- - fixed <strong> and <em> closing tags
2767
-
2768
- 1.53.0.TC018 (2006-05-18)
2769
- - fixed font names bug
2770
-
2771
- 1.53.0.TC017 (2006-05-18)
2772
- - the TTF2UFM utility to convert True Type fonts for TCPDF were included on fonts folder.
2773
- - new free unicode fonts were included on /fonts/freefont.
2774
- - test_unicode.php example were exended.
2775
- - parameter $fill were added on Write, writeHTML and writeHTMLCell functions.
2776
- - documentation were updated.
2777
-
2778
- 1.53.0.TC016 (2006-03-09)
2779
- - fixed closing <strong> tag on html parser.
2780
-
2781
- 1.53.0.TC016 (2005-08-28)
2782
- - fpdf.php and tcpdf.php files were joined in one single class (you can still extend TCPDF with your own class).
2783
- - fixed problem when mb_internal_encoding is set.
2784
-
2785
- 1.53.0.TC014 (2005-05-29)
2786
- - fixed WriteHTMLCell new page issue.
2787
-
2788
- 1.53.0.TC013 (2005-05-29)
2789
- - fixed WriteHTMLCell across pages.
2790
-
2791
- 1.53.0.TC012 (2005-05-29)
2792
- - font color attribute bug were fixed.
2793
-
2794
- 1.53.0.TC011 (2005-03-31)
2795
- - SetFont function were fixed (thank Sjaak Lauwers for bug notice).
2796
-
2797
- 1.53.0.TC010 (2005-03-22)
2798
- - the html functions were improved (thanks to Manfred Vervuert for bug reporting).
2799
-
2800
- 1.53.0.TC009 (2005-03-19)
2801
- - a wrong reference to convertColorHexToDec were fixed.
2802
-
2803
- 1.53.0.TC008 (2005-02-07)
2804
- - removed some extra bytes from PHP files.
2805
-
2806
- 1.53.0.TC007 (2005-01-08)
2807
- - fill attribute were removed from writeHTMLCell method.
2808
-
2809
- 1.53.0.TC006 (2005-01-08)
2810
- - the documentation were updated.
2811
-
2812
- 1.53.0.TC005 (2005-01-05)
2813
- - Steven Wittens's unicode methods were removed.
2814
- - All unicode methods were rewritten from scratch.
2815
- - TCPDF is now licensed as LGPL.
2816
-
2817
- 1.53.0.TC004 (2005-01-04)
2818
- - this changelog were added.
2819
- - removed commercial fonts for licensing issue.
2820
- - Bitstream Vera Fonts were added (http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html).
2821
- - Now the AddFont and SetFont functions returns the basic font if the styled version do not exist.
2822
-
2823
- EOF --------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 6.2.13 (2016-06-10)
2
+ - IMPORTANT: A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support. This version should be considered obsolete, new projects should use the new version as soon it will become stable.
3
+
4
+ 6.2.12 (2015-09-12)
5
+ - fix composer package name to tecnickcom/tcpdf
6
+
7
+ 6.2.11 (2015-08-02)
8
+ - Bug #1070 "PNG regression in 6.2.9 (they appear as their alpha channel)" was fixed.
9
+ - Bug #1069 "Encoded SRC URLs in <img> tags don't work anymore" was fixed.
10
+
11
+ 6.2.10 (2015-07-28)
12
+ - Minor mod to PNG parsing.
13
+ - Make dependency on mcrypt optional.
14
+
15
+ 6.2.8 (2015-04-29)
16
+ - Removed unwanted file.
17
+
18
+ 6.2.7 (2015-04-28)
19
+ - Merged PR 17: Avoid warning when iterating a non-array variable.
20
+ - Merged PR 16: Improve MuliCell param definition.
21
+ - Improved column check (PR 15).
22
+ - Merged PR 11: Use stream_is_local instead of limit to file://.
23
+ - Merged PR 10: ImageMagick link on README.txt.
24
+
25
+ 6.2.6 (2015-01-28)
26
+ - Bug #1008 "UTC offset sing breaks PDF/A-1b compliance" was fixed.
27
+
28
+ 6.2.5 (2015-01-24)
29
+ - Bug #1019 "$this in static context" was fixed.
30
+ - Bug #1015 "Infinite loop in getIndirectObject method of parser" was fixed.
31
+
32
+ 6.2.4 (2015-01-08)
33
+ - fix warning related to empty K_PATH_URL.
34
+ - fix error when a $table_colwidths key is not set.
35
+
36
+ 6.2.3 (2014-12-18)
37
+ - New comment.
38
+ - Moved the K_PATH_IMAGES definition in tcpdf_autoconfig.
39
+
40
+ 6.2.2 (2014-12-18)
41
+ - Fixed mispelled words.
42
+ - Fixed version number.
43
+
44
+ 6.2.1 (2014-12-18)
45
+ - The constant K_TCPDF_THROW_EXCEPTION_ERROR is now set to false in the default configuration file.
46
+ - An issue with the _destroy() method was fixed.
47
+
48
+ 6.2.0 (2014-12-10)
49
+ - Bug #1005 "Security Report, LFI posting internal files externally abusing default parameter" was fixed.
50
+ - Static methods serializeTCPDFtagParameters() and unserializeTCPDFtagParameters() were moved as non static to the main TCPDF class (see changes in example n. 49).
51
+ - Deprecated methods were removed, please use the equivalents defined in other classes (i.e. TCPDF_STATIC and TCPDF_FONTS).
52
+ - The constant K_TCPDF_CALLS_IN_HTML is now set by default to FALSE.
53
+ - DLE, DLX and DLP page format was added.
54
+ - Page format are now defined as a public property in TCPDF_STATIC.
55
+
56
+ 6.1.1 (2014-12-09)
57
+ - Fixed bug with the register_shutdown_function().
58
+
59
+ 6.1.0 (2014-12-07)
60
+ - The method TCPDF_STATIC::getRandomSeed() was improved.
61
+ - The disk caching feature was removed.
62
+ - Bug #1003 "Backslashes become duplicated in table, using WriteHTML" was fixed.
63
+ - Bug #1002 "SVG radialGradient within non-square Rect" was fixed.
64
+
65
+ 6.0.099 (2014-11-15)
66
+ - Added basic support for nested SVG images (adapted PR from SamMousa).
67
+ - A bug related to setGDImageTransparency() was fixed (thanks to Maarten Boerema).
68
+
69
+ 6.0.098 (2014-11-08)
70
+ - Bug item #996 "getCharBBox($char) returns incorrect results for TTF glyphs without outlines" was fixed.
71
+ - Bug item #991 "Text problem with SVG" was fixed (only the font style part).
72
+
73
+ 6.0.097 (2014-10-20)
74
+ - Bug item #988 "hyphenateText - charmin parameter not work" was fixed.
75
+ - New 1D barcode method to print pre-formatted IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200.
76
+
77
+ 6.0.096 (2014-10-06)
78
+ - Bug item #982 "Display style is not inherited in SVG" was fixed.
79
+ - Bug item #984 "Double quote url in CSS" was fixed.
80
+
81
+ 6.0.095 (2014-10-02)
82
+ - Bug item #979 "New Timezone option overwriting current timezone" was fixed.
83
+
84
+ 6.0.094 (2014-09-30)
85
+ - Bug item #978 "Variable Undefined: $cborder" was fixed.
86
+
87
+ 6.0.093 (2014-09-02)
88
+ - Security fix: some serialize/unserialize methods were replaced with json_encode/json_decode to avoid a potential object injection with user supplied content. Thanks to ownCloud Inc. for reporting this issue.
89
+ - K_TIMEZONE constant was added to the default configuration to suppress date-time warnings.
90
+
91
+ 6.0.092 (2014-09-01)
92
+ - Bug item #956 "Monospaced fonts are not alignd at the baseline" was fixed.
93
+ - Bug item #964 "Problem when changing font size" was fixed.
94
+ - Bug item #969 "ImageSVG with radialGradient problem" was fixed.
95
+ - sRGB.icc file was replaced with the one from the Debian package icc-profiles-free (2.0.1+dfsg-1)
96
+
97
+ 6.0.091 (2014-08-13)
98
+ - Issue #325"Division by zero when css fontsize equals 0" was fixed.
99
+
100
+ 6.0.090 (2014-08-08)
101
+ - Starting from this version TCPDF is also available in GitHub at https://github.com/tecnickcom/TCPDF
102
+ - Function getmypid() was removed for better compatibility with shared hosting environments.
103
+ - Support for pulling SVG stroke opacity value from RGBa color was mergeg [adf006].
104
+ - Bug item #951 "HTML Table within TCPDF columns doesnt flow correctly on page break ..." was fixed.
105
+
106
+ 6.0.089 (2014-07-16)
107
+ - Bug item #948 "bottom line of rowspan cell not work correctly" was fixed.
108
+
109
+ 6.0.088 (2014-07-09)
110
+ - Bug item #946 "Case sensitive type check causes broken match for SVG" was fixed.
111
+ - Bug item #945 "Imagick load doesn't account for passed data string " was fixed.
112
+
113
+ 6.0.087 (2014-06-25)
114
+ - A bug affecting fitcell option in Multicell was fixed.
115
+
116
+ 6.0.086 (2014-06-20)
117
+ - Bug item #938 "Hyphenation-dash extends outside of cell" was fixed (collateral effect).
118
+
119
+ 6.0.085 (2014-06-19)
120
+ - Some example images were replaced.
121
+ - A race condition bug was fixed.
122
+ - Bug item #938 "Hyphenation-dash extends outside of cell" was fixed.
123
+
124
+ 6.0.084 (2014-06-13)
125
+ - A bug related to MultiCell fitcell feature was fixed.
126
+ - Bug item #931 "Documentation error for setPageFormat()" was fixed.
127
+
128
+ 6.0.083 (2014-05-29)
129
+ - Bug item #928 "setHtmlVSpace with HR element" was fixed.
130
+
131
+ 6.0.082 (2014-05-23)
132
+ - Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed.
133
+ - Bug item #925 "924 transparent images bug" was fixed.
134
+
135
+ 6.0.081 (2014-05-22)
136
+ - Bug item #922 "writehtml tables thead repeating" was fixed.
137
+ - Patch #71 "External and internal links, local and remote" wa applied.
138
+
139
+ 6.0.080 (2014-05-20)
140
+ - Bug item #921 "Fatal error in hyphenateText() function" was fixed.
141
+ - Bug item #923 "Automatic Hyphenation error" was fixed.
142
+ - Patch #70 "Augument TCPDFBarcode classes with ability to return raw png image data" was applied.
143
+
144
+ 6.0.079 (2014-05-19)
145
+ - Patch item #69 "Named destinations, HTML internal and external links" was merged.
146
+ - Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed.
147
+ - Image method now trigs an error in case the cache is now writeable.
148
+ - Fixed issue with layer default status.
149
+
150
+ 6.0.078 (2014-05-12)
151
+ - A warning issue in addTTFfont() method was fixed.
152
+ - Fonts were updated to include cbbox metrics.
153
+
154
+ 6.0.077 (2014-05-06)
155
+ - A Datamatrix barcode bug was fixed.
156
+
157
+ 6.0.076 (2014-05-06)
158
+ - A bug in Datamatrix Base256 encoding was fixed.
159
+ - Merged fix for SVG use/clip-gradient.
160
+ - Now it is possible to prefix a page number in Link methods with the * character to avoid been changed when adding/deleting/moving pages (see example_045.php).
161
+
162
+ 6.0.075 (2014-05-05)
163
+ - Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
164
+
165
+ 6.0.074 (2014-05-03)
166
+ - Part of Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed.
167
+ - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
168
+
169
+ 6.0.073 (2014-04-29)
170
+ - Bug #913 "Possible bug with line-height" was fixed.
171
+ - Bug #914 "MultiCell and FitCell" was fixed.
172
+ - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed.
173
+
174
+ 6.0.072 (2014-04-27)
175
+ - Deprecated curly braces substring syntax was replaced with square braces.
176
+
177
+ 6.0.071 (2014-04-25)
178
+ - Bug #911 "error with buffered png pics" was fixed.
179
+
180
+ 6.0.070 (2014-04-24)
181
+ - Bug #910 "An SVG image is being cut off (with clipping mask) when you use align options" was fixed.
182
+
183
+ 6.0.069 (2014-04-24)
184
+ - Datamatrix Base256 encoding was fixed.
185
+
186
+ 6.0.068 (2014-04-22)
187
+ - Some Datamatrix barcode bugs were fixed.
188
+
189
+ 6.0.067 (2014-04-21)
190
+ - startLayer() method signature was changed to include a new "lock" parameter.
191
+
192
+ 6.0.066 (2014-04-20)
193
+ - Bug #908 "Linebreak is not considered when getting length of the next string" was fixed.
194
+
195
+ 6.0.065 (2014-04-10)
196
+ - Bug #905 "RGB percentage color bug in convertHTMLColorToDec()" was fixed.
197
+
198
+ 6.0.064 (2014-04-07)
199
+ - Header and Footer fonts are now set by default.
200
+ - Bug #904 "PDF corrupted" was fixed.
201
+
202
+ 6.0.063 (2014-04-03)
203
+ - Method TCPDF_IMAGES::_parsepng() was fixed to support transparency in Indexed images.
204
+
205
+ 6.0.062 (2014-03-02)
206
+ - The method startLayer() now accepts the NULL value for the $print parameter to not set the print layer option.
207
+
208
+ 6.0.061 (2014-02-18)
209
+ - Bug #893 "Parsing error on streamed xref for secured pdf" was fixed.
210
+
211
+ 6.0.060 (2014-02-16)
212
+ - Bug #891 "Error on parsing hexa fields" was fixed.
213
+ - Bug #892 "Parsing pdf with trailing space at start" was fixed.
214
+
215
+ 6.0.059 (2014-02-03)
216
+ - SVG 'use' support was imporved.
217
+
218
+ 6.0.058 (2014-01-31)
219
+ - Bug #886 "Bugs with SVG using <defs> and <use>" was fixed.
220
+
221
+ 6.0.057 (2014-01-26)
222
+ - Bug #883 "Parsing error" was fixed.
223
+
224
+ 6.0.056 (2014-01-25)
225
+ - The automatic cache folder selection now works also with some restricted hosting environments.
226
+ - CSS text-transform property is now supported (requires the multibyte string library for php) - see examle n. 061 (Thanks to Walter Ferraz).
227
+ - Bug #884 "Parsing error prev tag looking for" was fixed.
228
+
229
+ 6.0.055 (2014-01-15)
230
+ - Bug #880 "Error detecting hX tags (h1,h2..)" was fixed
231
+ - Bug #879 "Thead on the second page inherits style of previous tr" was fixed
232
+
233
+ 6.0.054 (2014-01-13)
234
+ - Bug #877 "Parenteses causing corrupt text" was fixed.
235
+
236
+ 6.0.053 (2014-01-03)
237
+ - Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed.
238
+ - Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied.
239
+
240
+ 6.0.052 (2013-12-12)
241
+ - Bug #871 "Datamatrix coding" was fixed.
242
+
243
+ 6.0.051 (2013-12-02)
244
+ - cbbox array values in addTTFfont() were converted to integers.
245
+
246
+ 6.0.050 (2013-12-01)
247
+ - The method getNumLines() was extended to support hyphenation.
248
+ - The CSS property line-height now supports non percentage values.
249
+
250
+ 6.0.050 (2013-11-27)
251
+ - A bug related to PNG images was fixed.
252
+
253
+ 6.0.048 (2013-11-24)
254
+ - SVG vars are now reset in ImageSVG() method.
255
+
256
+ 6.0.047 (2013-11-19)
257
+ - SVG support was extended to support some nested defs.
258
+
259
+ 6.0.046 (2013-11-17)
260
+ - preg_replace_callback functions were replaced to improve memory performances.
261
+
262
+ 6.0.045 (2013-11-17)
263
+ - Bug #862 "Parsing error on flate filter" was fixed.
264
+
265
+ 6.0.044 (2013-11-10)
266
+ - Bug #857 "Undefined offset error" was fixed.
267
+ - The uniord method now uses a static cache to improve performances (thanks to Mathieu Masseboeuf for the sugegstion).
268
+ - Two bugs in the TCPDF_FONTS class were fixed.
269
+
270
+ 6.0.043 (2013-10-29)
271
+ - Bug #854 "CSS instruction display" was fixed.
272
+
273
+ 6.0.042 (2013-10-25)
274
+ - Bug #852 "CMYK Colors Bug" was fixed.
275
+
276
+ 6.0.041 (2013-10-21)
277
+ - Bug #851 "Problem with images in PDF. PHP timing out" was fixed.
278
+
279
+ 6.0.040 (2013-10-20)
280
+ - Bug #849 "SVG import bug" was fixed.
281
+
282
+ 6.0.039 (2013-10-13)
283
+ - Bug #843 "Wrong call in parser" was fixed.
284
+ - Bug #844 "Wrong object type named" was fixed.
285
+ - Bug #845 "Parsing error on obj ref prefixed by '000000'" was fixed.
286
+
287
+ 6.0.038 (2013-10-06)
288
+ - Bug #841 "Division by zero warning at writeHTML a <li> tag" was fixed.
289
+
290
+ 6.0.037 (2013-09-30)
291
+ - Method getAllSpotColors() was added to return all spot colors.
292
+ - Method colorRegistrationBar() was extended to automatically print all spot colors and support individual spot colors.
293
+ - The method registrationMarkCMYK() was added to print a registration mark for CMYK colors.
294
+ - A bug related to page groups was fixed.
295
+ - Gradient() method now supports CMYK equivalents of spot colors.
296
+ - Example n. 56 was updated.
297
+
298
+ 6.0.036 (2013-09-29)
299
+ - Methods for registration bars and crop marks were extended to support registration color (see example n. 56).
300
+ - New default spot colors were added to tcpdf_colors.php, including the 'All' and 'None' special registration colors.
301
+
302
+ 6.0.035 (2013-09-25)
303
+ - TCPDF_PARSER class was improved.
304
+
305
+ 6.0.034 (2013-09-24)
306
+ - Bug #839 "Error in xref parsing in mixed newline chars" was fixed.
307
+
308
+ 6.0.033 (2013-09-23)
309
+ - Bug fix related to PNG image transparency using GD library.
310
+
311
+ 6.0.032 (2013-09-23)
312
+ - Bug #838 "Fatal error when imagick cannot handle the image, even though GD is available and can" was fixed.
313
+
314
+ 6.0.031 (2013-09-18)
315
+ - Bug #836 "Optional EOL marker before endstream" was fixed.
316
+ - Some additional controls were added to avoid "division by zero" error with badly formatted input.
317
+
318
+ 6.0.030 (2013-09-17)
319
+ - Bug #835 "PDF417 and Cyrilic simbols" was fixed.
320
+
321
+ 6.0.029 (2013-09-15)
322
+ - Constants K_TCPDF_PARSER_THROW_EXCEPTION_ERROR and K_TCPDF_PARSER_IGNORE_DECODING_ERRORS where removed in favor of a new configuration array in the TCPDF_PARSER class.
323
+ - The TCPDF_PARSER class can now be configured using the new $cfg parameter.
324
+
325
+ 6.0.028 (2013-09-15)
326
+ - A debug print_r was removed form tcpdf_parser.php.
327
+ - TCPDF_FILTERS class now throws an exception in case of error.
328
+ - TCPDF_PARSER class now throws an exception in case of error unless you define the constant K_TCPDF_PARSER_THROW_EXCEPTION_ERROR to false.
329
+ - The constant K_TCPDF_PARSER_IGNORE_DECODING_ERRORS can be set to tru eto ignore decoding errors on TCPDF_PARSER.
330
+
331
+ 6.0.027 (2013-09-14)
332
+ - A bug in tcpdf_parser wen parsing hexadecimal strings was fixed.
333
+ - A bug in tcpdf_parser wen looking for statxref was fixed.
334
+ - A bug on RC4 encryption was fixed.
335
+
336
+ 6.0.026 (2013-09-14)
337
+ - A bug in tcpdf_parser wen decoding streams was fixed.
338
+
339
+ 6.0.025 (2013-09-04)
340
+ - A pregSplit() bug was fixed.
341
+ - Improved content loading from URLs.
342
+ - Improved font path loading.
343
+
344
+ 6.0.024 (2013-09-02)
345
+ - Bug #826 "addEmptySignatureAppearance issue" was fixed.
346
+
347
+ 6.0.023 (2013-08-05)
348
+ - GNU Freefont fonts were updated.
349
+ - Licensing and copyright information about fonts were improved.
350
+ - PNG image support was improved.
351
+
352
+ 6.0.022 (2013-08-02)
353
+ - fixing initialization problem for signature_appearance property.
354
+
355
+ 6.0.021 (2013-07-18)
356
+ - The bug caused by the preg_split function on some PHP 5.2.x versions was fixed.
357
+
358
+ 6.0.020 (2013-06-04)
359
+ - The method addTTFfont() was fixed (Bug item #813 Undefined offset).
360
+
361
+ 6.0.019 (2013-06-04)
362
+ - The magic constant __DIR__ was replaced with dirname(__FILE__) for php 5.2 compatibility.
363
+ - The exceptions raised by file_exists() function were suppressed.
364
+
365
+ 6.0.018 (2013-05-19)
366
+ - The barcode examples were changed to automatically search for the barcode class path (in case the examples directory is not installed under the TCPDF root).
367
+
368
+ 6.0.017 (2013-05-16)
369
+ - The command line tool tcpdf_addfont.php was improved.
370
+ - The php logic was removed from configuration files that now contains only constant defines.
371
+ - The tcpdf_autoconfig.php file was added to automatically set missing configuration values.
372
+
373
+ 6.0.016 (2013-05-15)
374
+ - The tcpdf_addfont.php tool was improved (thanks to Remi Collet).
375
+ - Constant K_PATH_IMAGES is now automatically set in configuration file.
376
+
377
+ 6.0.015 (2013-05-14)
378
+ - Some unused vars were removed from AddFont() method.
379
+ - Some directories were moved inside the examples directory.
380
+ - All examples were updated to reflect the new default structure.
381
+ - Source code were clean-up up to be more compatible with system packaging.
382
+ - Files encodings and permissions were reset.
383
+ - The command line tool tcpdf_addfont.php was added on the tools directory.
384
+
385
+ 6.0.014 (2013-04-13)
386
+ - The signature of addTTFfont() method includes a new parameter to link existing fonts instead of copying and compressing them.
387
+
388
+ 6.0.013 (2013-04-10)
389
+ - Add support for SVG dx and dy text/tspan attributes.
390
+ - replace require() with require_once().
391
+ - fix some minor typos on documentation.
392
+ - fix a problem when deleting all pages.
393
+
394
+ 6.0.012 (2013-04-24)
395
+ - An error condition in addHtmlLink() method was fixed (bug #799).
396
+
397
+ 6.0.011 (2013-04-22)
398
+ - Minor documentation changes.
399
+
400
+ 6.0.010 (2013-04-03)
401
+ - The method Rect() was fixed to print borders correctly.
402
+
403
+ 6.0.009 (2013-04-02)
404
+ - Adding back some files that were not properly committed on the latest release.
405
+
406
+ 6.0.008 (2013-04-01)
407
+ - Duplicated encoding maps was removed from tcpdf_font_data.php.
408
+ - Fixing bug on AddTTFFont().
409
+
410
+ 6.0.007 (2013-03-29)
411
+ - HTML/CSS font size conversion were improved.
412
+
413
+ 6.0.006 (2013-03-27)
414
+ - Bug related to SVG and EPS files on xobjects were fixed.
415
+
416
+ 6.0.005 (2013-03-26)
417
+ - Default font path was fixed.
418
+
419
+ 6.0.004 (2013-03-21)
420
+ - Return value of addTTFfont() method was fixed.
421
+
422
+ 6.0.003 (2013-03-20)
423
+ - A bug related to non-unicode mode was fixed.
424
+
425
+ 6.0.002 (2013-03-18)
426
+ - _getFIXED call on tcpdf_fonts.php was fixed.
427
+
428
+ 6.0.001 (2013-03-18)
429
+ - Fixed $uni_type call on tcpdf.php.
430
+
431
+ 6.0.000 (2013-03-17)
432
+ - IMPORTANT: PHP4 support has been removed starting from this version.
433
+ - Several TCPDF methods and vars were moved to new class files: tcpdf_static.php, tcpdf_colors.php, tcpdf_images.php, tcpdf_font_data.php, tcpdf_fonts.php.
434
+ - Files htmlcolors.php, spotcolors.php, unicode_data.php and ecodings_maps.php were removed.
435
+ - Barcode classes were renamed and new barcode examples were added.
436
+ - Class TCPDF_PARSER was improved.
437
+
438
+ ********************************************************************************
439
+
440
+ 5.9.209 (2013-03-15)
441
+ - Image method was improved.
442
+
443
+ 5.9.208 (2013-03-15)
444
+ - objclone function was patched to support old imagick extensions.
445
+ - tcpdf_parser was improved to support Cross-Reference Streams and large streams.
446
+
447
+ 5.9.207 (2013-03-04)
448
+ - Datamatrix class was fixed (a debug echo was removed).
449
+
450
+ 5.9.206 (2013-02-22)
451
+ - Bug item #754 "PNG with alpha channel becomes gray scale" was fixed.
452
+ - Minor documentation fixes.
453
+
454
+ 5.9.205 (2013-02-06)
455
+ - The constant K_TCPDF_THROW_EXCEPTION_ERROR was added on configuration file to change the behavior of Error() method.
456
+ - PDF417 barcode bug was fixed.
457
+
458
+ 5.9.204 (2013-01-23)
459
+ - The method Bookmark() was extended to include named destinations, URLs, internal links or embedded files (see example n. 15).
460
+ - automatic path calculation on configuration file was fixed.
461
+ - Error() method was extended to throw new Exception if PHP > 5.
462
+
463
+ 5.9.203 (2013-01-22)
464
+ - Horizontal position of radiobuttons and checkboxes was adjusted.
465
+
466
+ 5.9.202 (2012-12-16)
467
+ - Vertical space problem after table was fixed.
468
+
469
+ 5.9.201 (2012-12-10)
470
+ - First 256 chars are now always included on font subset to overcome a problem reported on the forum.
471
+
472
+ 5.9.200 (2012-12-05)
473
+ - Bug item #768 "Rowspan with Pagebreak error" was fixed.
474
+ - Page regions now works also with limited MultiCell() cells.
475
+
476
+ 5.9.199 (2012-11-29)
477
+ - Internal setImageBuffer() method was improved.
478
+
479
+ 5.9.198 (2012-11-19)
480
+ - Datamatrix EDIFACT mode was fixed.
481
+
482
+ 5.9.197 (2012-11-06)
483
+ - Bug item #756 "TCPDF 5.9.196 shows line on top of all PDFs" was fixed.
484
+
485
+ 5.9.196 (2012-11-02)
486
+ - Several methods were improved to avoid output when the context is out of page.
487
+ - Bug item #755 "remove cached files before unsetting" was fixed.
488
+
489
+ 5.9.195 (2012-10-24)
490
+ - Method _putfonts() was improved.
491
+
492
+ 5.9.194 (2012-10-23)
493
+ - Text alignment on TextField() method was fixed.
494
+
495
+ 5.9.193 (2012-09-25)
496
+ - Support for named destinations on HTML links was added (i.e.: <a href="#destinationname">link to named destination</a>).
497
+
498
+ 5.9.192 (2012-09-24)
499
+ - A problem on the releasing process was fixed.
500
+
501
+ 5.9.191 (2012-09-24)
502
+ - SVG image naow support svg and eps images.
503
+
504
+ 5.9.190 (2012-09-23)
505
+ - "page" word translation is now set to empty if not defined.
506
+ - Tooltip feature was added on the radiobutton annotation.
507
+
508
+ 5.9.189 (2012-09-18)
509
+ - Bug item #3568969 "ini_get safe_mode error" was fixed.
510
+
511
+ 5.9.188 (2012-09-15)
512
+ - A datamatrix barcode bug was fixed.
513
+
514
+ 5.9.187 (2012-09-14)
515
+ - Subset feature was extended to include the first 256 characters.
516
+
517
+ 5.9.186 (2012-09-13)
518
+ - barcodes.php file was resynced.
519
+ - Methods SetAbsX, SetAbsY, SetAbsXY where added to set the absolute pointer coordinates.
520
+ - Method getCharBBox were added to get single character bounding box.
521
+ - Signature of addTTFfont method was changed ($addcbbox parameter was added).
522
+
523
+ 5.9.185 (2012-09-12)
524
+ - Method _putfontwidths() was fixed.
525
+
526
+ 5.9.184 (2012-09-11)
527
+ - A problem with EAN barcodes was fixed.
528
+
529
+ 5.9.183 (2012-09-07)
530
+ - A problem with font names normalization was fixed.
531
+
532
+ 5.9.182 (2012-09-05)
533
+ - Bug item #3564982 "Infinite loop in Write() method" was fixed.
534
+
535
+ 5.9.181 (2012-08-31)
536
+ - composer.json file was added.
537
+ - Bug item #3563369 "Cached images are not unlinked some time" was fixed.
538
+
539
+ 5.9.180 (2012-08-22)
540
+ - Bug item #3560493 "Problems with nested cells in HTML" was fixed.
541
+
542
+ 5.9.179 (2012-08-04)
543
+ - SVG 'use' tag was fixed for 'circle' and 'ellipse' shift problem.
544
+ - Alpha status is now correctly stored and restored by getGraphicVars() and SetGraphicVars() methods.
545
+
546
+ 5.9.178 (2012-08-02)
547
+ - SVG 'use' tag was fixed for 'circle' and 'ellipse'.
548
+
549
+ 5.9.177 (2012-08-02)
550
+ - An additional control on annotations was fixed.
551
+
552
+ 5.9.176 (2012-07-25)
553
+ - A bug related to stroke width was fixed.
554
+ - A problem related to font spacing in HTML was fixed.
555
+
556
+ 5.9.175 (2012-07-25)
557
+ - The problem of missing letter on hyphen break was fixed.
558
+
559
+ 5.9.174 (2012-07-25)
560
+ - The problem of wrong filename when downloading PDF from an Android device was fixed.
561
+ - The method setHeaderData() was extended to set text and line color for header (see example n. 1).
562
+ - The method setFooterData() was added to set text and line color for footer (see example n. 1).
563
+ - The methods setTextShadow() and getTextShadow() were added to set text shadows (see example n. 1).
564
+ - The GetCharWidth() method was fixed for negative character spacing.
565
+ - A 'none' border mode is now correctly recognized.
566
+ - Break on hyphen problem was fixed.
567
+
568
+ 5.9.173 (2012-07-23)
569
+ - Some additional control wher added on barcode methods.
570
+ - The option CURLOPT_FOLLOWLOCATION on Image method is now disabled if PHP safe_mode is on or open_basedir is set.
571
+ - Method Bookmark() was extended to include X parameter.
572
+ - Method setDestination() was extended to include X parameter.
573
+ - A problem with Thai language was fixed.
574
+
575
+ 5.9.172 (2012-07-02)
576
+ - A PNG color profile issue was fixed.
577
+
578
+ 5.9.171 (2012-07-01)
579
+ - Some SVG rendering problems were fixed.
580
+
581
+ 5.9.170 (2012-06-27)
582
+ - Bug #3538227 "Numerous errors inserting shared images" was fixed.
583
+
584
+ 5.9.169 (2012-06-25)
585
+ - Some SVG rendering problems were fixed.
586
+
587
+ 5.9.168 (2012-06-22)
588
+ - Thai language rendering was fixed.
589
+
590
+ 5.9.167 (2012-06-22)
591
+ - Thai language rendering was fixed and improved.
592
+ - Method isCharDefined() was improved.
593
+ - Protected method replaceChar() was added.
594
+ - Font "kerning" word was corrected to "tracking".
595
+
596
+ 5.9.166 (2012-06-21)
597
+ - Array to string conversion on file_id creation was fixed.
598
+ - Thai language rendering was fixed (thanks to Atsawin Chaowanakritsanakul).
599
+
600
+ 5.9.165 (2012-06-07)
601
+ - Some HTML form related bugs were fixed.
602
+
603
+ 5.9.164 (2012-06-06)
604
+ - A bug introduced on the latest release was fixed.
605
+
606
+ 5.9.163 (2012-06-05)
607
+ - Method getGDgamma() was changed.
608
+ - Rendering performances of PNG images with alpha channel were improved.
609
+
610
+ 5.9.162 (2012-05-11)
611
+ - A bug related to long text on TD cells was fixed.
612
+
613
+ 5.9.161 (2012-05-09)
614
+ - A bug on XREF table was fixed (Bug ID: 3525051).
615
+ - Deprecated Imagick:clone was replaced.
616
+ - Method objclone() was fixed for PHP4.
617
+
618
+ 5.9.160 (2012-05-03)
619
+ - A bug on tcpdf_parser.php was fixed.
620
+
621
+ 5.9.159 (2012-04-30)
622
+ - Barcode classes were updated to fix PNG export Bug (ID: 3522291).
623
+
624
+ 5.9.158 (2012-04-22)
625
+ - Some SVG-related bugs were fixed.
626
+
627
+ 5.9.157 (2012-04-16)
628
+ - Some SVG-related bugs were fixed.
629
+
630
+ 5.9.156 (2012-04-10)
631
+ - Bug item #3515885 "TOC and booklet: left and right page exchanged".
632
+ - SetAutoPageBreak(false) now works also in multicolumn mode.
633
+
634
+ 5.9.155 (2012-04-02)
635
+ - Bug item #3512596 "font import problems" was fixed.
636
+ - Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation).
637
+ - All fonts were updated.
638
+ - Bug item #3513867 "booklet and setHeaderTemplateAutoreset: header shifted left" was fixed.
639
+ - Bug item #3513749 "TCPDF Superscript/Subscript" was fixed.
640
+
641
+ 5.9.154 (2012-03-29)
642
+ - A debug echo was removed.
643
+
644
+ 5.9.153 (2012-03-28)
645
+ - A bug on font conversion was fixed.
646
+ - All fonts were updated.
647
+ - Method isCharDefined() was added to find if a character is defined on the selected font.
648
+ - Method replaceMissingChars() was added to automatically replace missing chars on selected font.
649
+ - SetFont() method was fixed.
650
+
651
+ 5.9.152 (2012-03-23)
652
+ - The following overprint methods were added: setOverprint(), getOverprint().
653
+ - Signature of setAlpha() method was changed and method getAlpha() was added.
654
+ - stroke-opacity support was added on SVG.
655
+ - The following date methods were added: setDocCreationTimestamp(), setDocModificationTimestamp(), getDocCreationTimestamp(), getDocModificationTimestamp(), getFormattedDate(), getTimestamp().
656
+ - Signature of _datestring() method was changed.
657
+ - Method getFontBBox() was added.
658
+ - Method setPageBoxTypes() was aded.
659
+
660
+ 5.9.151 (2012-03-22)
661
+ - Bug item #3509889 "Transform() distorts PDF" was fixed.
662
+ - Precision of real number were extended.
663
+ - ComboBox and ListBox methods were fixed.
664
+ - Bulgarian language file was added.
665
+ - addTOC() method was improved to include bookmark color and font style.
666
+
667
+ 5.9.150 (2012-03-16)
668
+ - A bug related to form fields in PDF/A mode was fixed.
669
+
670
+ 5.9.149 (2012-02-21)
671
+ - Bug item #3489933 "SVG Parser treats tspan like text" was fixed.
672
+
673
+ 5.9.148 (2012-02-17)
674
+ - Bug item #3488600 "Multiple radiobutton sets get first set value" was fixed.
675
+
676
+ 5.9.147 (2012-02-14)
677
+ - A problem with SVG gradients has been fixed.
678
+
679
+ 5.9.146 (2012-02-12)
680
+ - Bug item #3486880 "$filehash undefine error" was fixed.
681
+ - The default font is now the one specified at PDF_FONT_NAME_MAIN constant.
682
+
683
+ 5.9.145 (2012-01-28)
684
+ - Japanese language file was added.
685
+ - TCPDF license and README.TXT files were updated.
686
+
687
+ 5.9.144 (2012-01-12)
688
+ - HTML output on barcode classes was improved.
689
+
690
+ 5.9.143 (2012-01-08)
691
+ - Bug item #3471057 "setCreator() has no effect" was fixed.
692
+
693
+ 5.9.142 (2011-12-23)
694
+ - Source code documentation was updated.
695
+
696
+ 5.9.141 (2011-12-14)
697
+ - Some minor bugs were fixed.
698
+
699
+ 5.9.140 (2011-12-13)
700
+ - SVG now supports embedded images encoded as base64.
701
+
702
+ 5.9.139 (2011-12-11)
703
+ - Spot color methods were fixed.
704
+
705
+ 5.9.138 (2011-12-10)
706
+ - cropMark() method was improved (check source code documentation).
707
+ - Example n. 56 was updated.
708
+ - Bug item #3452390 "Check Box still not ticked when set to true" was fixed.
709
+
710
+ 5.9.137 (2011-12-01)
711
+ - Bug item #3447005 "Background color and border of Form Elements is printed" was fixed.
712
+ - Color support for Form elements was improved.
713
+
714
+ 5.9.136 (2011-11-27)
715
+ - Bug item #3443387 "SetMargins with keep option does not work for top margin" was fixed.
716
+
717
+ 5.9.135 (2011-11-04)
718
+ - Bug item #3433406 "Double keywords in description" was fixed.
719
+
720
+ 5.9.134 (2011-10-29)
721
+ - The default value for $defcol parameter on convertHTMLColorToDec() method was fixed.
722
+ - Deafult HTTP headers were changed to avoid browser caching.
723
+ - Some deprecated syntax were replaced.
724
+
725
+ 5.9.133 (2011-10-26)
726
+ - Bug item #3428446 "copyPage method not working when diskcache enabled" was fixed.
727
+
728
+ 5.9.132 (2011-10-20)
729
+ - Bug item #3426167 "bug in function convertHTMLColorToDec()" was fixed.
730
+
731
+ 5.9.131 (2011-10-13)
732
+ - An error message was added to ImagePngAlpha() method.
733
+
734
+ 5.9.130 (2011-10-12)
735
+ - Now you can set image data strings on HTML img tag by encoding the image binary data in this way: $imgsrc = '@'.base64_encode($imgdata);
736
+
737
+ 5.9.129 (2011-10-07)
738
+ - Core fonts metrics was fixed (replace all helvetica and times php files on fonts folder).
739
+ - Form fields support was improved and some problems were fixed (check the example n. 14).
740
+ - Bug item #3420249 "Issue with booklet and MultiCell" was fixed.
741
+
742
+ 5.9.128 (2011-10-06)
743
+ - Method addTTFfont() was improved (check the source code documentation).
744
+ - Method setExtraXMP() to set custom XMP data was added.
745
+
746
+ 5.9.127 (2011-10-04)
747
+ - Readonly mode option was activated for radiobuttons.
748
+
749
+ 5.9.126 (2011-10-03)
750
+ - Bug item #3417989 "Graphics State operator in form XObject fails to render" was fixed.
751
+ - Xobjects problems with transparency, gradients and spot colors were fixed.
752
+
753
+ 5.9.125 (2011-10-03)
754
+ - Support for 8-digit CMYK hexadecimal color representation was added (to be used with XHTML and SVG).
755
+ - Spot colors support was improved (check example n. 37).
756
+ - Color methods were improved.
757
+
758
+ 5.9.124 (2011-10-02)
759
+ - Core fonts were updated.
760
+
761
+ 5.9.123 (2011-10-02)
762
+ - The method addTTFfont() wad added to automatically convert TTF fonts (check the new fonts guide at http://www.tcpdf.org).
763
+ - Old font utils were removed.
764
+ - All fonts were updated and new arabic fonts were added (almohanad were removed and replaced by aefurat and aealarabiya).
765
+ - The file unicode_data.php was updated.
766
+ - The file encodings_maps.php was added.
767
+ - PDF/A files are now compressed to save space.
768
+ - XHTML input form fields now support text-alignment attribute.
769
+
770
+ 5.9.122 (2011-09-29)
771
+ - PDF/A-1b compliance was improved to pass some online testing.
772
+
773
+ 5.9.121 (2011-09-28)
774
+ - This version includes support for PDF/A-1b format (the class constructor signature was changed - see example n. 65).
775
+ - Method setSRGBmode() was added to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document (file sRGB.icc was added).
776
+ - 14 new fonts were added to allow embedding core fonts (for PDF/A compliance).
777
+ - Font utils were fixed.
778
+
779
+ 5.9.120 (2011-09-22)
780
+ - This version includes a fix for _getTrueTypeFontSubset() method.
781
+
782
+ 5.9.119 (2011-09-19)
783
+ - This version includes a fix for extra page numbering on TOC.
784
+
785
+ 5.9.118 (2011-09-17)
786
+ - This version includes some changes that allows you to add a bookmark for a page that do not exist.
787
+
788
+ 5.9.117 (2011-09-15)
789
+ - TCPDFBarcode and TCPDF2DBarcode classes were extended to include a method for exporting barcodes as PNG images.
790
+
791
+ 5.9.116 (2011-09-14)
792
+ - Datamatrix class was improved and documentation was fixed.
793
+
794
+ 5.9.115 (2011-09-13)
795
+ - Datamatrix ECC200 barcode support was added (a new datamatrix.php file was added) - check example n. 50.
796
+ - getBarcodeHTML() method was added on TCPDFBarcode and TCPDF2DBarcode classes to return an HTML representation of the barcode.
797
+ - cURL options on Image() method were improved.
798
+ - A bug on write2DBarcode() was fixed.
799
+
800
+ 5.9.114 (2011-09-04)
801
+ - A bug related to column position was fixed.
802
+
803
+ 5.9.113 (2011-08-24)
804
+ - This release include two new experimental files for parsing an existing PDF document (the integration with TCPDF is under development).
805
+
806
+ 5.9.112 (2011-08-18)
807
+ - A newline character was added after the 'trailer' keyword for compatibility with some parsers.
808
+ - Support for layers was improved.
809
+
810
+ 5.9.111 (2011-08-17)
811
+ - Barcode CODE 39 default gap was restored at 1.
812
+
813
+ 5.9.110 (2011-08-17)
814
+ - Barcode CODE 39 was fixed.
815
+
816
+ 5.9.109 (2011-08-12)
817
+ - Method getNumLines() was fixed.
818
+ - A bug related to page break in multi-column mode was fixed.
819
+
820
+ 5.9.108 (2011-08-09)
821
+ - A bug on PHP4 version was fixed.
822
+
823
+ 5.9.107 (2011-08-08)
824
+ - This version includes a minor bugfix.
825
+
826
+ 5.9.106 (2011-08-04)
827
+ - This version includes transparency groups: check the new parameter on startTemplate() method and example 62.
828
+
829
+ 5.9.105 (2011-08-04)
830
+ - Bug item #3386153 "Check Box not ticked when set to true" was fixed.
831
+
832
+ 5.9.104 (2011-08-01)
833
+ - Bug item #3383698 "imagemagick, resize and dpi" was fixed.
834
+
835
+ 5.9.103 (2011-07-16)
836
+ - Alignment of XHTML lines was improved.
837
+ - Spell of the "length" word was fixed.
838
+
839
+ 5.9.102 (2011-07-13)
840
+ - Methods startLayer() and endLayer() were added to support arbitrary PDF layers.
841
+ - Some improvements/fixes for images were added (thanks to Brendan Abbott).
842
+
843
+ 5.9.101 (2011-07-07)
844
+ - Support for JPEG and PNG ICC Color Profiles was added.
845
+ - Method addEmptySignatureAppearance() was added to add empty signature fields (see example n. 52).
846
+ - Bug item #3354332 "Strange line spacing with reduced font-size in writeHTML" was fixed.
847
+
848
+ 5.9.100 (2011-06-29)
849
+ - An SVG bug has been fixed.
850
+
851
+ 5.9.099 (2011-06-27)
852
+ - Bug item #3335045 "Font freesans seems somehow corrupted in footer" was fixed.
853
+
854
+ 5.9.098 (2011-06-23)
855
+ - The Named Destination feature was fixed.
856
+
857
+ 5.9.097 (2011-06-23)
858
+ - The method setHtmlVSpace() now can be used also for tags: div, li, br, dt and dd.
859
+ - The Named Destination feature was added (check the example n. 15) - thanks to Christian Deligant.
860
+
861
+ 5.9.096 (2011-06-19)
862
+ - Bug item #3322234 "Surrogate pairs codes in arrUTF8ToUTF16BE" was fixed.
863
+
864
+ 5.9.095 (2011-06-18)
865
+ - Numbers alignment for Table-Of-Content methods was improved and fixed.
866
+ - Font subsetting was fixed to include all parts of composite fonts.
867
+
868
+ 5.9.094 (2011-06-17)
869
+ - Bug item #3317898 "Page Group numbering broken in 5.9.093" was fixed.
870
+
871
+ 5.9.093 (2011-06-16)
872
+ - Method setStartingPageNumber() was added to set starting page number (for automatic page numbering).
873
+
874
+ 5.9.092 (2011-06-15)
875
+ - Method _putpages() was improved.
876
+ - Bug item #3316678 "Memory overflow when use Rotate and SetAutoPageBreak" was fixed.
877
+ - Right alignment of page numbers was improved.
878
+
879
+ 5.9.090 (2011-06-14)
880
+ - Methods AliasNbPages() and AliasNumPage() were re-added as deprecated for backward compatibility.
881
+
882
+ 5.9.089 (2011-06-13)
883
+ - Example n. 8 was updated.
884
+ - Method sendOutputData() was changed to remove default compression (it was incompatible with some server settings).
885
+ - Bugs related to page group numbers were fixed.
886
+ - Method copyPage() was fixed.
887
+ - Method Image() was improved to include support for alternative and external images.
888
+
889
+ 5.9.088 (2011-06-01)
890
+ - Method getAutoPageBreak() was added (see example n. 51).
891
+ - Example n. 51 (full page background) was updated.
892
+
893
+ 5.9.087 (2011-06-01)
894
+ - Method sendOutputData() was improved to include deflate encoding.
895
+ - Barcode classes on PHP 4 version were fixed.
896
+
897
+ 5.9.086 (2011-05-31)
898
+ - Font files were updated (the ones on the previous release were broken).
899
+ - The script fonts/utils/makeallttffonts.php was updated and fixed.
900
+ - Output() method was improved to use compression when available.
901
+
902
+ 5.9.085 (2011-05-31)
903
+ - TCPDFBarcode class (barcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode.
904
+ - TCPDF2DBarcode class (2dbarcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode.
905
+
906
+ 5.9.084 (2011-05-29)
907
+ - Font files were updated.
908
+ - The file fonts/utils/makeallttffonts.php was updated.
909
+ - Bug item# 3308774 "Problems with font subsetting" was fixed.
910
+
911
+ 5.9.083 (2011-05-24)
912
+ - Bug item #3308387 "line height & SetCellHeightRatio" was fixed.
913
+
914
+ 5.9.082 (2011-05-22)
915
+ - Bug item #3305592 "Setting fill color <> text color breaks text clipping" was fixed.
916
+
917
+ 5.9.081 (2011-05-18)
918
+ - Method resetHeaderTemplate() was added to reset the xobject template used by Header() method.
919
+ - Method setHeaderTemplateAutoreset() was added to automatically reset the xobject template used by Header() method at each page.
920
+
921
+ 5.9.080 (2011-05-17)
922
+ - A problem related to file path calculation for images was fixed.
923
+ - A problem related to unsuppressed getimagesize() error was fixed.
924
+
925
+ 5.9.079 (2011-05-16)
926
+ - Footer() method was changed to use C128 barcode as default (instead of the previous C128B).
927
+
928
+ 5.9.078 (2011-05-12)
929
+ - Bug item #3300878 "wrong rendering for html bullet list in some case" was fixed.
930
+ - Bug item #3301017 "Emphasized vs. font-weight" was fixed.
931
+ - Barcode Code 128 was improved to include AUTO mode (automatically switch between A, B and C modes).
932
+ - Examples n. 27 and 49 were updated.
933
+
934
+ 5.9.077 (2011-05-07)
935
+ - Bug item #3298591 "error code93" was fixed.
936
+ - SetLineStyle() function was improved.
937
+
938
+ 5.9.076 (2011-05-06)
939
+ - Bug item #3298264 "codebar 93 error" was fixed.
940
+
941
+ 5.9.075 (2011-05-02)
942
+ - Table header alignment when using WriteHTMLCell() or MultiCell() was fixed.
943
+
944
+ 5.9.074 (2011-04-28)
945
+ - Bug item #3294306 "CSS classes not work in <thead> table section" was fixed.
946
+
947
+ 5.9.073 (2011-04-27)
948
+ - A bug related to character entities on HTML cells was fixed.
949
+
950
+ 5.9.072 (2011-04-26)
951
+ - Method resetColumns() was added to remove multiple columns and reset page margins (example n. 10 was updated).
952
+
953
+ 5.9.071 (2011-04-19)
954
+ - Bug #3288574 "<br/> trouble" was fixed.
955
+
956
+ 5.9.069 (2011-04-19)
957
+ - Bug #3288763 "HTML-Table: non-breaking table rows: Bug" was fixed.
958
+
959
+ 5.9.068 (2011-04-15)
960
+ - Bookmark, addTOC and addHTMLTOC methods were improved to include font style and color (Examples 15, 49 and 59 were updated).
961
+ - Default $_SERVER['DOCUMENT_ROOT'] value on tcpdf_config.php file was changed.
962
+
963
+ 5.9.067 (2011-04-10)
964
+ - Performances were drastically improved (PDF documents are now created more quickly).
965
+
966
+ 5.9.066 (2011-04-09)
967
+ - A bug related to digital signature + encryption was fixed.
968
+ - A bug related to encryption + xobject templates was fixed.
969
+
970
+ 5.9.065 (2011-04-08)
971
+ - Bug item #3280512 "Text encoding iso-8859-2 crashes" was fixed.
972
+
973
+ 5.9.064 (2011-04-05)
974
+ - A bug related to character entities on HTML cells was fixed.
975
+
976
+ 5.9.063 (2011-04-01)
977
+ - Bug item #3267235 "WriteHTML() and image that doesn't fit on the page" was fixed.
978
+
979
+ 5.9.062 (2011-03-23)
980
+ - Bug item #3232650 "Using Write if there are pageRegions active creates error" was fixed.
981
+ - Bug item #3221891 "text input borders" was fixed.
982
+ - Bug item #3228958 "Adobe Reader 9.4.2 crash" was fixed.
983
+
984
+ 5.9.061 (2011-03-15)
985
+ - Bug item #3213488 "wrong function call in function Write" was fixed.
986
+ - Bug item #3203007 "list element with black background" was fixed.
987
+
988
+ 5.9.060 (2011-03-08)
989
+ - addTOC() method was fixed for text alignment problems.
990
+
991
+ 5.9.059 (2011-02-27)
992
+ - Default Header() method was improved to reduce document size.
993
+
994
+ 5.9.058 (2011-02-25)
995
+ - Image() method was improved to cache images with transparency layers (thanks to Korneliusz Jarzębski for reporting this problem).
996
+
997
+ 5.9.057 (2011-02-24)
998
+ - A problem with image caching system was fixed (thanks to Korneliusz Jarzębski for reporting this problem).
999
+
1000
+ 5.9.056 (2011-02-22)
1001
+ - A bug on fixHTMLCode() method was fixed.
1002
+ - Automatic line break for HTML was fixed.
1003
+
1004
+ 5.9.055 (2011-02-17)
1005
+ - Another bug related to HTML table page break was fixed.
1006
+
1007
+ 5.9.054 (2011-02-16)
1008
+ - A bug related to HTML table page break was fixed.
1009
+
1010
+ 5.9.053 (2011-02-16)
1011
+ - Support for HTML attribute display="none" was added.
1012
+
1013
+ 5.9.052 (2011-02-15)
1014
+ - A bug related to HTML automatic newlines was fixed.
1015
+
1016
+ 5.9.051 (2011-02-12)
1017
+ - "Commas at beginning of new lines" problem was fixed.
1018
+
1019
+ 5.9.050 (2011-02-11)
1020
+ - Bug #3177606 "SVG Bar chart error" was fixed.
1021
+
1022
+ 5.9.049 (2011-02-03)
1023
+ - Bug #3170777 "TCPDF creates a new page after a single line in writeHTML" was fixed.
1024
+
1025
+ 5.9.048 (2011-02-02)
1026
+ - No changes. Just released to override previous release that was not uploaded correctly.
1027
+
1028
+ 5.9.047 (2011-01-28)
1029
+ - Bug #3167115 "PDF error in <table> (example 48)" was fixed (was introduced in 5.8.046).
1030
+
1031
+ 5.9.046 (2011-01-18)
1032
+ - PDF view/print layers are now automatically turned off if not used (see setVisibility() method).
1033
+
1034
+ 5.9.045 (2011-01-17)
1035
+ - HTML list support were improved.
1036
+
1037
+ 5.9.044 (2011-01-15)
1038
+ - Bug #3158422 "writeHTMLCell Loop" was fixed.
1039
+ - Some HTML image alignment problems were fixed.
1040
+
1041
+ 5.9.043 (2011-01-14)
1042
+ - Bug #3158178 "PHP Notice" was fixed.
1043
+ - Bug #3158193 "Endless loop in writeHTML" was fixed.
1044
+ - Bug #3157764 "SVG Pie chart incorrectly rendered2".
1045
+
1046
+ 5.9.042 (2011-01-14)
1047
+ - Some problems of the PHP4 version were fixed.
1048
+
1049
+ 5.9.041 (2011-01-13)
1050
+ - A problem with SVG elliptical arc path was fixed (ref. bug #3156574).
1051
+ - A problem related to font weight on HTML table headers was fixed.
1052
+
1053
+ 5.9.040 (2011-01-12)
1054
+ - A bug related to empty pages after table was fixed.
1055
+
1056
+ 5.9.039 (2011-01-12)
1057
+ - Bug item #3155759 "openssl_random_pseudo_bytes() slow under Windows" was fixed.
1058
+
1059
+ 5.9.038 (2011-01-11)
1060
+ - Minor bugs were fixed.
1061
+
1062
+ 5.9.037 (2011-01-09)
1063
+ - An alignment problem for HTML texts was fixed.
1064
+
1065
+ 5.9.036 (2011-01-07)
1066
+ - A bug related to HTML tables on header was fixed.
1067
+
1068
+ 5.9.035 (2011-01-03)
1069
+ - A problem related to HTML table border alignment was fixed.
1070
+ - Bug #2996366 "FastCGI and Header Problems" was fixed.
1071
+
1072
+ 5.9.034 (2010-12-19)
1073
+ - DejaVu and GNU Free fonts were updated.
1074
+
1075
+ 5.9.033 (2010-12-18)
1076
+ - Source code documetnation was improved.
1077
+
1078
+ 5.9.032 (2010-12-18)
1079
+ - Default font stretching and spacing values are now inherited by HTML methods.
1080
+
1081
+ 5.9.031 (2010-12-16)
1082
+ - Source code documentation errors were fixed.
1083
+
1084
+ 5.9.030 (2010-12-16)
1085
+ - Several source code documentation errors were fixed.
1086
+ - Source code style was changed for Doxygen.
1087
+ - Source code documentation was moved online to http://www.tcpdf.org
1088
+
1089
+ 5.9.029 (2010-12-04)
1090
+ - The $fitbox parameter on Image() method was extended to specify image alignment inside the box (check the example n. 9).
1091
+
1092
+ 5.9.028 (2010-12-03)
1093
+ - Font utils makefont.php and makeallttffonts.php were updated.
1094
+
1095
+ 5.9.027 (2010-12-01)
1096
+ - Spot Colors are now better integrated with HTML mode.
1097
+ - Method SetDocInfoUnicode() was added to turn on/off Unicode mode for document information dictionary (meta tags) - check the example n. 19.
1098
+
1099
+ 5.9.026 (2010-12-01)
1100
+ - A problem with mixed text directions on HTML was fixed.
1101
+
1102
+ 5.9.025 (2010-12-01)
1103
+ - The AddSpotColor() now automatically fills the spotcolor array (defined on spotcolors.php file).
1104
+
1105
+ 5.9.024 (2010-11-30)
1106
+ - Bug item #3123612 "SVG not use gradientTransform in percentage mode" was fixed.
1107
+
1108
+ 5.9.023 (2010-11-25)
1109
+ - A potential bug on SVG transcoder was fixed.
1110
+
1111
+ 5.9.022 (2010-11-21)
1112
+ - Method ImageEPS includes support for EPS/AI Spot colors.
1113
+ - Method ImageEPS includes a new parameter $fixoutvals to remove values outside the bounding box.
1114
+
1115
+ 5.9.021 (2010-11-20)
1116
+ - Support for custom bullet points images was added (check the example n.6)
1117
+ - Examples n. 6 and 61 were update (check the comments inside).
1118
+
1119
+ 5.9.020 (2010-11-19)
1120
+ - A problem related to additional page when using multicolumn mode was fixed.
1121
+
1122
+ 5.9.019 (2010-11-19)
1123
+ - An SVG bug was fixed.
1124
+ - ImageSVG() and ImageEPS() methods now accepts image data streams (put the string on the $file parameter preceded by '@' character).
1125
+ - Option 'E' was added to the $dest parameter of Output() method to return the document as base64 mime multi-part email attachment (RFC 2045).
1126
+
1127
+ 5.9.018 (2010-11-19)
1128
+ - An SVG bug was fixed.
1129
+
1130
+ 5.9.017 (2010-11-16)
1131
+ - Tagline color was set to transparent.
1132
+ - The method fixHTMLCode() was added to automatically clean up HTML code (requires HTML Tidy).
1133
+
1134
+ 5.9.016 (2010-11-16)
1135
+ - Bug item #3109705 "list item page break hanging bullet" was fixed.
1136
+
1137
+ 5.9.015 (2010-11-16)
1138
+ - Bug item affecting QRCode was fixed.
1139
+ - Some bugs affecting HTML lists were fixed.
1140
+ - ImageSVG() and fitBlock() methods were improved to handle some SVG problems.
1141
+ - Some problems with PHP4 compatibility were fixed.
1142
+
1143
+ 5.9.014 (2010-11-15)
1144
+ - Bug item #3109464 "QRCode error" was fixed.
1145
+
1146
+ 5.9.013 (2010-11-15)
1147
+ - Bug item #3109257 "Problem with interlaced GIFs and PNGs" was fixed.
1148
+ - Image function now accepts image data streams (check example n. 9).
1149
+
1150
+ 5.9.012 (2010-11-12)
1151
+ - Method getTCPDFVersion() was added.
1152
+ - PDF_PRODUCER constant was removed.
1153
+ - Method convertHTMLColorToDec() was improved.
1154
+ - HTML colors now support spot color names defined on the new spotcolors.php file.
1155
+ - The default method Header() was improved to support SVG and EPS/AI images.
1156
+ - A bug on SVG importer was fixed.
1157
+
1158
+ 5.9.011 (2010-11-02)
1159
+ - Bug item #3101486 "Bug Fix for image loading" was fixed.
1160
+
1161
+ 5.9.010 (2010-10-27)
1162
+ - Support for CSS properties 'border-spacing' and 'padding' for tables were added.
1163
+ - Several language files were added.
1164
+
1165
+ 5.9.009 (2010-10-21)
1166
+ - HTML text alignment was improved to include the case of RTL text on LTR direction and LTR text on RTL direction.
1167
+
1168
+ 5.9.008 (2010-10-21)
1169
+ - Bug item #3091502 "Bookmark oddity" was fixed.
1170
+ - HTML internal links now accepts page number and Y position.
1171
+ - The method write1DBarcode() was improved to accept separate horizontal and vertical padding (see example n. 27).
1172
+
1173
+ 5.9.007 (2010-10-20)
1174
+ - Method adjustCellPadding() was fixed to handle bad input.
1175
+
1176
+ 5.9.006 (2010-10-19)
1177
+ - Support for AES 256 bit encryption was added (see example n. 16).
1178
+ - Method getNumLines() was fixed for the empty string case.
1179
+
1180
+ 5.9.005 (2010-10-18)
1181
+ - Method addPageRegion() was changed to accept regions starting exactly from the top of the page.
1182
+
1183
+ 5.9.004 (2010-10-18)
1184
+ - A bug related to annotations was fixed.
1185
+ - The file unicode_data.php was canged to encapsulate all data in a class.
1186
+ - The file htmlcolors.php was changed to remove the global variable.
1187
+
1188
+ 5.9.003 (2010-10-15)
1189
+ - Support for no-write page regions was added. Check the example n. 64 and new methods setPageRegions(), addPageRegion(), getPageRegions(), removePageRegion().
1190
+ - A bug on Right-To-Left alignment was fixed.
1191
+
1192
+ 5.9.002 (2010-10-08)
1193
+ - Cell method was improved to preserve the font stretching and spacing values when using the $stretch parameter (see example n. 4).
1194
+
1195
+ 5.9.001 (2010-10-07)
1196
+ - The problem of blank page for nobr table higher than a single page was fixed.
1197
+
1198
+ 5.9.000 (2010-10-06)
1199
+ - Support for text stretching and spacing (tracking) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing().
1200
+ - Support for CSS properties 'font-stretch' and 'letter-spacing' was added (see example n. 63).
1201
+ - The cMargin state was replaced by cell_padding array that can be set/get using setCellPadding() and getCellPadding() methods.
1202
+ - Methods getCellPaddings() and setCellPaddings() were added to fine tune cell paddings (see example n. 5).
1203
+ - Methods getCellMargins() and setCellMargins() were added to fine tune cell margins (see example n. 5).
1204
+ - Method write1DBarcode() was improved to permit custom labels (see example n. 27).
1205
+ - Method ImagePngAlpha() now includes support for ImageMagick to improve performances.
1206
+ - XObject Template support was extended to support Multicell(), writeHTML() and writeHTMLCell() methods.
1207
+ - The signature of getNumLines() and getStringHeight() methods is changed.
1208
+ - Example n. 57 was updated.
1209
+
1210
+ // -------------------------------------------------------------------
1211
+
1212
+ 5.8.034 (2010-09-27)
1213
+ - A bug related to SetFont on XObject templates was fixed.
1214
+
1215
+ 5.8.033 (2010-09-25)
1216
+ - A problem with Footer() and multiple columns was fixed.
1217
+
1218
+ 5.8.032 (2010-09-22)
1219
+ - Bug #3073165 "Issues with changes to addHTMLVertSpace()" was fixed.
1220
+
1221
+ 5.8.031 (2010-09-20)
1222
+ - Bug #3071961 "Spaces in HTML" was fixed.
1223
+
1224
+ 5.8.030 (2010-09-17)
1225
+ - SVG support was improved and some bugs were fixed.
1226
+
1227
+ 5.8.029 (2010-09-16)
1228
+ - A problem with HTML borders was fixed.
1229
+
1230
+ 5.8.028 (2010-09-13)
1231
+ - Bug #3065224 "mcrypt_create_iv error on TCPDF 5.8.027 on PHP 5.3.2" was fixed.
1232
+
1233
+ 5.8.027 (2010-09-13)
1234
+ - Bug #3065118 "mcrypt_decrypt error on TCPDF 5.8.026 on PHP 5.3.2" was fixed.
1235
+
1236
+ 5.8.026 (2010-09-13)
1237
+ - A bug on addHTMLTOC() method was fixed. Note: be sure that the #TOC_PAGE_NUMBER# template has enough width to be printed correctly.
1238
+
1239
+ 5.8.025 (2010-09-09)
1240
+ - Bug #3062692 "Textarea inside a table" was fixed.
1241
+
1242
+ 5.8.024 (2010-09-08)
1243
+ - Bug #3062005 "Undefined variable: ann_obj_id" was fixed.
1244
+
1245
+ 5.8.023 (2010-08-31)
1246
+ - Forms bug added on version 5.8.019 was fixed.
1247
+
1248
+ 5.8.022 (2010-08-31)
1249
+ - Bug #3056632 "SVG rendered vertically flipped" was fixed.
1250
+
1251
+ 5.8.021 (2010-08-30)
1252
+ - A new CID-0 'chinese' font was added for traditional Chinese.
1253
+ - Bug #3054287 'Inner tags are ignored due to "align" attribute' was fixed.
1254
+
1255
+ 5.8.020 (2010-08-26)
1256
+ - CSS "catch-all" class selector is now supported.
1257
+
1258
+ 5.8.019 (2010-08-26)
1259
+ - XObject Templates now includes support for links and annotations.
1260
+ - A problem related to link alignment on cell was fixed.
1261
+ - A problem related to SVG styles was fixed.
1262
+
1263
+ 5.8.018 (2010-08-25)
1264
+ - Method getNumberOfColumns() was added.
1265
+ - A problem related to table header was fixed.
1266
+ - Method getSVGTransformMatrix() was fixed to apply SVG transformations in the correct order.
1267
+ - SVG support was improved and several bugs were fixed.
1268
+
1269
+ 5.8.017 (2010-08-25)
1270
+ - This version includes support for XObject Templates (see the new example n. 62).
1271
+ - Methods starttemplate(), endTemplate() and printTemplate() were added (see the new example n. 62).
1272
+
1273
+ 5.8.016 (2010-08-24)
1274
+ - Alignment problem on write2DBarcode was fixed.
1275
+
1276
+ 5.8.015 (2010-08-24)
1277
+ - A problem arose with the latest bugfix was fixed.
1278
+
1279
+ 5.8.014 (2010-08-23)
1280
+ - Method _getxobjectdict() was added for better compatibility with external extensions.
1281
+ - A bug related to radiobuttons was fixed.
1282
+ - Bug #3051509 "new line after punctuation marks" was fixed (partially).
1283
+
1284
+ 5.8.013 (2010-08-23)
1285
+ - SVG support for 'direction' property was added.
1286
+ - A problem on default width calculation for linear barcodes was fixed.
1287
+ - New option was added to write1DBarcode() method to improve alignments (see example n. 27).
1288
+ - Bug #3050896 "Nested HTML tables: styles are not applied" was fixed.
1289
+ - Method _putresourcedict() was improved to include external XObject templates.
1290
+
1291
+ 5.8.012 (2010-08-22)
1292
+ - Support for SVG 'text-anchor' property was added.
1293
+
1294
+ 5.8.011 (2010-08-21)
1295
+ - Method write1DBarcode() was improved to be backward compatible (check the new example n. 27).
1296
+ - Support for CSS width and height properties on images were added.
1297
+
1298
+ 5.8.010 (2010-08-20)
1299
+ - Documentation of unhtmlentities() was fixed.
1300
+ - The 'fitwidth' option was added and border color problem was fixed on write1DBarcode() method (check the example n. 27).
1301
+
1302
+ 5.8.009 (2010-08-20)
1303
+ - Internal object numbering was improved.
1304
+ - Some errors in object encryption were fixed.
1305
+
1306
+ 5.8.008 (2010-08-19)
1307
+ - Method write1DBarcode() was changed, check the example n. 27.
1308
+ - Method Footer() was changed to account for barcode changes.
1309
+ - Automatic calculation of K_PATH_URL constant was fixed on configuration file.
1310
+ - Method setEqualColumns() was fixed for $width=0 case.
1311
+ - Method AddTOC() was fixed for multipage and multicolumn modes.
1312
+ - Better support for SVG "font-family" property.
1313
+ - A problem on default Page Zoom mode was fixed.
1314
+ - Several Annotation bugs were fixed.
1315
+
1316
+ 5.8.007 (2010-08-18)
1317
+ - A bug affecting HTML tables was fixed.
1318
+ - Bug #3047500 "SVG not rendering paths properly" was fixed.
1319
+
1320
+ 5.8.006 (2010-08-17)
1321
+ - A bug affecting HTML table nesting was fixed.
1322
+
1323
+ 5.8.005 (2010-08-17)
1324
+ - A bug affecting the HTML 'select' tag in certain conditions was fixed.
1325
+
1326
+ 5.8.004 (2010-08-17)
1327
+ - Better support for HTML "font-family" property.
1328
+ - A bug related to HTML multicolumn was fixed.
1329
+
1330
+ 5.8.003 (2010-08-16)
1331
+ - Better support for HTML "font-family" property.
1332
+
1333
+ 5.8.002 (2010-08-14)
1334
+ - HTML alignments were improved
1335
+ - IMPORTANT: Default regular expression to find spaces has been changed to exclude the non-breaking-space (160 DEC- A0 HEX). If you are using setSpacesRE() method, please read the new documentation.
1336
+ - Example n. 1 was updated.
1337
+
1338
+ 5.8.001 (2010-08-12)
1339
+ - Bug #3043650 "subsetchars incorrectly cached" was fixed.
1340
+
1341
+ 5.8.000 (2010-08-11)
1342
+ - A control to avoid bookmarking page 0 was added.
1343
+ - addTOC() method now includes support for multicolumn mode.
1344
+ - Support for tables in multicolumn mode was improved.
1345
+ - Example n.10 was updated.
1346
+ - All trimming functions were replaced with stringLeftTrim(), stringRightTrim() and stringTrim().
1347
+ - HTML alignments were improved.
1348
+
1349
+ ------------------------------------------------------------
1350
+
1351
+ 5.7.003 (2010-08-08)
1352
+ - Bug #3041263 "php source ending is bad" was fixed (all PHP files were updated, including fonts).
1353
+
1354
+ 5.7.002 (2010-08-06)
1355
+ - Methods copyPage(), movePage() and deletePage() were changed to account for internal markings.
1356
+
1357
+ 5.7.001 (2010-08-05)
1358
+ - Bug #3040105 "Broken PDF when using TOC (example 45)" was fixed.
1359
+
1360
+ 5.7.000 (2010-08-03)
1361
+ - CSS borders are now supported for HTML tables and other block tags (see example n. 61);
1362
+ - Cell borders were improved (see example n. 57);
1363
+ - Minor bugs were fixed.
1364
+
1365
+ ------------------------------------------------------------
1366
+
1367
+ 5.6.000 (2010-07-31)
1368
+ - A bug with object IDs was fixes.
1369
+ - Performances were improved.
1370
+
1371
+ ------------------------------------------------------------
1372
+
1373
+ 5.5.015 (2010-07-29)
1374
+ - Automatic fix for unclosed self-closing tag.
1375
+ - Support for deprecated 's' and 'strike' tags was added.
1376
+ - Empty list items problem was fixed.
1377
+
1378
+ 5.5.014 (2010-07-15)
1379
+ - Support for external images was improved.
1380
+
1381
+ 5.5.013 (2010-07-14)
1382
+ - Bug #3029338 "FI and FO output destination filename bug" was fixed (previous fix was wrong).
1383
+
1384
+ 5.5.012 (2010-07-14)
1385
+ - Bug #3029310 "Font baseline inconsistencies with line-height and font-size" was fixed.
1386
+ - Bug #3029338 "FI and FO output destination filename bug" was fixed.
1387
+
1388
+ 5.5.011 (2010-07-09)
1389
+ - Support for multiple CSS classes was added.
1390
+ - The method getColumn() was added to return the current column number.
1391
+ - Some regular Expressions were fixed to be more compatible with UTF-8.
1392
+
1393
+ 5.5.010 (2010-07-06)
1394
+ - Bug item #3025772 "Borders in all image functions are still flawed" was fixed.
1395
+
1396
+ 5.5.009 (2010-07-05)
1397
+ - A problem related to last page footer was fixed.
1398
+ - Image alignments and fit-on-page features were improved.
1399
+
1400
+ 5.5.008 (2010-07-02)
1401
+ - A problem on table header alignment in booklet mode was fixed.
1402
+ - Default graphic vars are now applied for setHeader();
1403
+
1404
+ 5.5.007 (2010-07-02)
1405
+ - Attribute "readonly" was added to input and textarea form fields.
1406
+ - Vertical alignment feature was added on MultiCell() method only for simple text mode (see example n. 5).
1407
+ - Text-Fit feature was added on MultiCell() method only for simple text mode (see example n. 5).
1408
+
1409
+ 5.5.006 (2010-06-29)
1410
+ - getStringHeight() and getNumLines() methods were fixed.
1411
+
1412
+ 5.5.005 (2010-06-28)
1413
+ - Bug #3022170 "getFontDescent() does not return correct descent value" was fixed.
1414
+ - Some problems with multicolumn mode were fixed.
1415
+
1416
+ 5.5.004 (2010-06-27)
1417
+ - Bug #3021803 "SVG Border" was fixed.
1418
+
1419
+ 5.5.003 (2010-06-26)
1420
+ - On Write() method, blank lines at the beginning of a page or column are now automatically removed.
1421
+
1422
+ 5.5.002 (2010-06-24)
1423
+ - ToUnicode Identity-H name was replaced with a full CMap (to avoid preflight syntax error).
1424
+ - Bug #3020638 "str_split() not available in php4" was fixed.
1425
+ - Bug #3020665 "file_get_contents() too many parameters for php4" was fixed.
1426
+
1427
+ 5.5.001 (2010-06-23)
1428
+ - A problem on image streams was fixed.
1429
+
1430
+ 5.5.000 (2010-06-22)
1431
+ - Several PDF syntax errors (and related bugs) were fixed.
1432
+ - Bug #3019090 "/Length values are wrong if AES encryption is used" was fixed.
1433
+
1434
+ ------------------------------------------------------------
1435
+
1436
+ 5.4.003 (2010-06-19)
1437
+ - A problem related to page boxes was fixed.
1438
+ - Bug #3016920 "Font subsetting issues when editing pdf" was partially fixed (Note that flattening transparency layers is currently incompatible with TrueTypeUnicode fonts).
1439
+
1440
+ 5.4.002 (2010-06-18)
1441
+ - A problem related with setProtection() method was fixed.
1442
+
1443
+ 5.4.001 (2010-06-18)
1444
+ - A problem related with setProtection() method was fixed.
1445
+
1446
+ 5.4.000 (2010-06-18)
1447
+ - The method setSignatureAppearance() was added, check the example n. 52.
1448
+ - Several problems related to font subsetting were fixed.
1449
+
1450
+ ------------------------------------------------------------
1451
+
1452
+ 5.3.010 (2010-06-15)
1453
+ - Previous release was corrupted.
1454
+
1455
+ 5.3.009 (2010-06-15)
1456
+ - Bug #3015934 "Bullets don't display correctly" was fixed.
1457
+
1458
+ 5.3.008 (2010-06-13)
1459
+ - This version fixes some problems of SVG rasterization.
1460
+
1461
+ 5.3.007 (2010-06-13)
1462
+ - This version improves SVG support.
1463
+
1464
+ 5.3.006 (2010-06-10)
1465
+ - This version includes a change in uniqid calls for backward compatibility with PHP4.
1466
+
1467
+ 5.3.005 (2010-06-09)
1468
+ - The method getPageSizeFromFormat() was changed to include all standard page formats (includes 281 page formats + variation).
1469
+
1470
+ 5.3.004 (2010-06-08)
1471
+ - Bug #3013291 "HTML table cell width" was fixed.
1472
+ - Bug #3013294 "HTML table cell alignment" was fixed.
1473
+ - The columns widths of HTML tables are now inherited from the first row.
1474
+
1475
+ 5.3.003 (2010-06-08)
1476
+ - Bug #3013102 "HTML table header misaligned after page break" was fixed.
1477
+
1478
+ 5.3.002 (2010-06-07)
1479
+ - The methods setFontSubsetting() and setFontSubsetting() were added to control the default font subsetting mode (see example n. 1).
1480
+ - Bug #3012596 "Whitespace should not appeared after use Thai top characters" was fixed.
1481
+ - Examples n. 1, 14, and 54 were updated.
1482
+
1483
+ 5.3.001 (2010-06-06)
1484
+ - Barcode PDF417 was improved to support Macro Code Blocks (see example n. 50).
1485
+
1486
+ 5.3.000 (2010-06-05)
1487
+ - License was changed to GNU-LGPLv3 (see the updated LICENSE.TXT file).
1488
+ - PDF417 barcode support was added (check the example n. 50).
1489
+ - The method write2DBarcode() was improved (some parameters were added and other changed - check example n. 50).
1490
+
1491
+ ------------------------------------------------------------
1492
+
1493
+ 5.2.000 (2010-06-02)
1494
+ - IMPORTANT: Support for font subsetting was added by default to reduce the size of documents using large unicode font files.
1495
+ If you embed the whole font in the PDF, the person on the other end can make changes to it even if he didn't have your font.
1496
+ If you subset the font, file size of the PDF will be smaller but the person who receives your PDF would need to have your same font in order to make changes to your PDF.
1497
+ - The signature of the SetFont() and AddFont() methods were changed to include the font subsetting option (subsetting is applied by default).
1498
+ - Examples 14 and 54 were updated.
1499
+
1500
+ ------------------------------------------------------------
1501
+
1502
+ 5.1.002 (2010-05-27)
1503
+ - Bug #3007818 "SetAutoPageBreak fails with MultiCell" was fixed.
1504
+ - A bug related to MultiCell() minimun height was fixed.
1505
+
1506
+ 5.1.001 (2010-05-26)
1507
+ - The problem of blank page after table was fixed.
1508
+
1509
+ 5.1.000 (2010-05-25)
1510
+ - This version includes support for CSS (Cascading Style Sheets) (see example n. 61).
1511
+ - The convertHTMLColorToDec() method was improved.
1512
+
1513
+ ------------------------------------------------------------
1514
+
1515
+ 5.0.014 (2010-05-21)
1516
+ - A problem on color and style of HTML links was fixed.
1517
+ - A bug relative to gradients was fixed.
1518
+ - The getStringHeight() method was added and getNumLines() method was improved.
1519
+ - All examples were updated.
1520
+
1521
+ 5.0.013 (2010-05-19)
1522
+ - A bug related to page-breaks and table cells was fixed.
1523
+
1524
+ 5.0.012 (2010-05-19)
1525
+ - Page orientation bug was fixed.
1526
+ - The access to method setPageFormat() was changed to 'protected' because it is not intended to be directly called.
1527
+
1528
+ 5.0.011 (2010-05-19)
1529
+ - Page orientation bug was fixed.
1530
+ - Bug #3003966 "Multiple columns and nested lists" was fixed.
1531
+
1532
+ 5.0.010 (2010-05-17)
1533
+ - The methods setPageFormat(), setPageOrientation() and related methods were extended to include page boxes, page rotations and page transitions.
1534
+ - The method setPageBoxes() was added to set page boundaries (MediaBox, CropBox, BleedBox, TrimBox, ArtBox);
1535
+ - A bug relative to underline, overline and linethrough was fixed.
1536
+
1537
+ 5.0.009 (2010-05-16)
1538
+ - Bug #3002381 "Multiple columns and nested lists" was fixed.
1539
+
1540
+ 5.0.008 (2010-05-15)
1541
+ - Bug "Columns WriteHTML and Justification" was fixed.
1542
+
1543
+ 5.0.007 (2010-05-14)
1544
+ - Bug #3001347 "Bug when using WriteHTML with setEqualColumns()" was fixed.
1545
+ - Bug #3001505 "problem with sup and sub tags at the beginning of a line" was fixed.
1546
+
1547
+ 5.0.006 (2010-05-13)
1548
+ - Length of hr tag was fixed.
1549
+ - An error on 2d barcode method was fixed.
1550
+
1551
+ 5.0.005 (2010-05-12)
1552
+ - WARNING: The logic of permissions on the SetProtection() method has been inverted and extended (see example 16). Now you have to specify the features you want to block.
1553
+ - SetProtection() method was extended to support RSA and AES 128 encryption and public-keys (see example 16).
1554
+ - Bug #2999489 "setEqualColumns() and TOC uses wrong columns" was fixed (see the example 10).
1555
+
1556
+ 5.0.004 (2010-05-10)
1557
+ - HTML line alignment when using sub and sup tags was fixed.
1558
+
1559
+ 5.0.003 (2010-05-07)
1560
+ - Horizontal alignment was fixed for images and barcodes. Now the X coordinate is always relative to the left margin. Use GetAbsX() instead of GetX() to get the X relative to left margin.
1561
+ - Header() method was changed to account for new image alignment rules.
1562
+
1563
+ 5.0.002 (2010-05-06)
1564
+ - Bookmark() and related methods were fixed to accept HTML code.
1565
+ - A problem on HTML links was fixed.
1566
+
1567
+ 5.0.001 (2010-05-06)
1568
+ - Protected method _putstream was re-added for backward compatibility.
1569
+ - The following method were added to display HTML Table Of Content (see example n. 59):
1570
+ addTOCPage(), endTOCPage(), addHTMLTOC().
1571
+
1572
+ 5.0.000 (2010-05-05)
1573
+ - Method ImageSVG() was added to embedd SVG images (see example n. 58). Note that not all SVG images are supported.
1574
+ - Method setRasterizeVectorImages() was added to enable/disable rasterization for vector images via ImageMagick library.
1575
+ - Method RoundedRectXY() was added.
1576
+ - Method PieSectorXY() was added.
1577
+ - Gradient() method is now public and support new features.
1578
+ - Shading to transparency is now supported.
1579
+ - Image alignments were fixed.
1580
+ - Support for dynamic images were improved.
1581
+ - PDF_IMAGE_SCALE_RATIO has been changed to 1.25 for better compatibility with SVG.
1582
+ - RAW and RAW2 modes were added to 2D Barcodes (see example n. 50).
1583
+ - Automatic padding feature was added on barcodes (see examples n. 27 and 50).
1584
+ - Bug #2995003 "Reproduced thead bug" was fixed.
1585
+ - The Output() method now accepts FI and FD destinations to save the document on server before sending it to the client.
1586
+ - Ellipse() method was improved and fixed (see page 2 of example n. 12).
1587
+
1588
+ ------------------------------------------------------------
1589
+
1590
+ 4.9.018 (2010-04-21)
1591
+ - Bug item #2990356 "Current font size not respected with more than two HTML <p>" was fixed.
1592
+
1593
+ 4.9.017 (2010-04-21)
1594
+ - Bug item #2990224 "Different behaviour for equivalent HTML strings" was fixed.
1595
+ - Bug item #2990314 "Dash is not appearing with SHY character" was fixed.
1596
+
1597
+ 4.9.016 (2010-04-20)
1598
+ - An error on htmlcolors.php was fixed.
1599
+ - getImageFileType() method was improved.
1600
+ - GIF images with transparency are now better supported.
1601
+ - Automatic page orientation was improved.
1602
+
1603
+ 4.9.015 (2010-04-20)
1604
+ - A new method copyPage() was added to clone pages (see example n. 44).
1605
+ - Support for text overline was added.
1606
+ - Underline and linethrough methods were fixed.
1607
+ - Bug #2989058 "SHY character causes unnecessary word-wrapping" was fixed.
1608
+
1609
+ 4.9.014 (2010-04-18)
1610
+ - Bug item #2988845 was fixed.
1611
+
1612
+ 4.9.013 (2010-04-15)
1613
+ - Image() and ImageEPS() methods were fixed and improved; $fitonpage parameter was added.
1614
+
1615
+ 4.9.012 (2010-04-12)
1616
+ - The hyphenateText() method was added to automatically hyphenate text (see example n. 46).
1617
+
1618
+ 4.9.011 (2010-04-07)
1619
+ - Vertical alignments for Cell() method were improved (see example n. 57).
1620
+
1621
+ 4.9.010 (2010-04-06)
1622
+ - Signature of Cell() method now includes new parameters for vertical alignment (see example n. 57).
1623
+ - Text() method was extended to include all Cell() parameters.
1624
+ - HTML line alignment procedure was changed to fix some bugs.
1625
+
1626
+ 4.9.009 (2010-04-05)
1627
+ - Text() method was fixed for backward compatibility.
1628
+
1629
+ 4.9.008 (2010-04-03)
1630
+ - Additional line space after table header was removed.
1631
+ - Support for HTML lists in multicolumn mode was added.
1632
+ - The method setTextRenderingMode() was added to set text rendering modes (see the example n. 26).
1633
+ - The following HTML attributes were added to set text rendering modes (see the example n. 26): stroke, strokecolor, fill.
1634
+
1635
+ 4.9.007 (2010-04-03)
1636
+ - Font Descent computation was fixed (patch #2981441).
1637
+
1638
+ 4.9.006 (2010-04-02)
1639
+ - The constant K_TCPDF_CALLS_IN_HTML was added on configuration file to enable/disable the ability to call TCPDF methods in HTML.
1640
+ - The usage of tcpdf tag in HTML mode was changed to remove the possible security flaw offered by the eval() function (thanks to Matthias Hecker for spotting this security problem). See the new example n. 49 for further information.
1641
+
1642
+ 4.9.005 (2010-04-01)
1643
+ - Bug# 2980354 "Wrong File attachment description with security" was fixed.
1644
+ - Several problems with HTML line alignment were fixed.
1645
+ - The constant K_THAI_TOPCHAR was added on configuration file to enable/disable the special procedure used to avoid the overlappind of symbols on Thai language.
1646
+ - A problem with font name directory was fixed.
1647
+ - A bug on _destroy() method was fixed.
1648
+
1649
+ 4.9.004 (2010-03-31)
1650
+ - Patch #979681 "GetCharWidth - default character width" was applied (bugfix).
1651
+
1652
+ 4.9.003 (2010-03-30)
1653
+ - Problem of first <br /> on multiple columns was fixed.
1654
+ - HTML line alignment was fixed.
1655
+ - A QR-code bug was fixed.
1656
+
1657
+ 4.9.002 (2010-03-29)
1658
+ - Patch #2978349 "$ignore_min_height is ignored in function Cell()" was applied.
1659
+ - Bug #2978607 "2D Barcodes are wrong" was fixed.
1660
+ - A problem with HTML block tags was fixed.
1661
+ - Artificial italic for CID-0 fonts was added.
1662
+ - Several multicolumn bugs were fixed.
1663
+ - Support for HTML tables on multicolumn was added.
1664
+
1665
+ 4.9.001 (2010-03-28)
1666
+ - QR Code minor bug was fixed.
1667
+ - Multicolumn mode was added (see the new example n. 10).
1668
+ - The following methods were added: setEqualColumns(), setColumnsArray(), selectColumn().
1669
+ - Thai diacritics support were changed (note that this is incompatible with html justification).
1670
+
1671
+ 4.9.000 (2010-03-27)
1672
+ - QR Code (2D barcode) support was added (see example n. 50).
1673
+ - The following methods were added to print crop and registration marks (see example n. 56): colorRegistrationBar(), cropMark(), registrationMark().
1674
+ - Limited support for CSS line-height property was added.
1675
+ - Gradient method now supports Gray, RGB and CMYK space color.
1676
+ - Example n. 51 was updated.
1677
+ - Vertical alignment of font inside cell was fixed.
1678
+ - Support for multiple Thai diacritics was added.
1679
+ - Bug item #2974929 "Duplicate case values" was fixed.
1680
+ - Bug item #2976729 "File attachment not working with security" was fixed.
1681
+
1682
+ ------------------------------------------------------------
1683
+
1684
+ 4.8.039 (2010-03-20)
1685
+ - Problems related to custom locale settings were fixed.
1686
+ - Problems related to HTML on Header and Footer were fixed.
1687
+
1688
+ 4.8.038 (2010-03-13)
1689
+ - Various bugs related to page-break in HTML mode were fixed.
1690
+ - Bug item #2968974 "Another <thead> pagebreak problem" was fixed.
1691
+ - Bug item #2969276 "justification problem" was fixed.
1692
+ - Bug item #2969289 "bug when using justified text and custom headers" was fixed.
1693
+ - Images are now automatically resized to be contained on the page.
1694
+ - Some HTML line alignments were fixed.
1695
+ - Signature of AddPage() and SetMargins() methods were changed to include an option to set default page margins.
1696
+
1697
+ 4.8.037 (2010-03-03)
1698
+ - Bug item #2962068 was fixed.
1699
+ - Bug item #2967017 "Problems with <thead> and pagebreaks" was fixed.
1700
+ - Bug item #2967023 "table header lost with pagebreak" was fixed.
1701
+ - Bug item #2967032 "Header lost with nested tables" was fixed.
1702
+
1703
+ 4.8.036 (2010-02-24)
1704
+ - Automatic page break for HTML images was improved.
1705
+ - Example 10 was updated.
1706
+ - Japanese was removed from example 8 because the freeserif font doesn't contain japanese (you can display it using arialunicid0 font).
1707
+
1708
+ 4.8.035 (2010-02-23)
1709
+ - Automatic page break for HTML images was added.
1710
+ - Support for multicolumn HTML was added (example 10 was updated).
1711
+
1712
+ 4.8.034 (2010-02-17)
1713
+ - Language files were updated.
1714
+
1715
+ 4.8.033 (2010-02-12)
1716
+ - A bug related to protection mode with links was fixed.
1717
+
1718
+ 4.8.032 (2010-02-04)
1719
+ - A bug related to $maxh parameter on Write() and MultiCell() was fixed.
1720
+ - Support for body tag was added.
1721
+
1722
+ 4.8.031 (2010-01-30)
1723
+ - Bug item #2941589 "paragraph justify not working on some non-C locales" was fixed.
1724
+
1725
+ 4.8.030 (2010-01-27)
1726
+ - Some text alignment cases were fixed.
1727
+
1728
+ 4.8.029 (2010-01-27)
1729
+ - Bug item #2941057 "TOC Error in PDF File Output" was fixed.
1730
+ - Some text alignment cases were fixed.
1731
+
1732
+ 4.8.028 (2010-01-26)
1733
+ - Text alignment for RTL mode was fixed.
1734
+
1735
+ 4.8.027 (2010-01-25)
1736
+ - Bug item #2938412 "Table related problems - thead, nobr, table width" was fixed.
1737
+
1738
+ 4.8.026 (2010-01-19)
1739
+ - The misspelled word "length" was replaced with "length" in some variables and comments.
1740
+
1741
+ 4.8.025 (2010-01-18)
1742
+ - addExtGState() method was improved to reuse existing ExtGState objects.
1743
+
1744
+ 4.8.024 (2010-01-15)
1745
+ - Justification mode for HTML was fixed (Bug item #2932470).
1746
+
1747
+ 4.8.023 (2010-01-15)
1748
+ - Bug item #2932470 "Some HTML entities breaks justification" was fixed.
1749
+
1750
+ 4.8.022 (2010-01-14)
1751
+ - Source code documentation was fixed.
1752
+
1753
+ 4.8.021 (2010-01-03)
1754
+ - A Bug relative to Table Of Content index was fixed.
1755
+
1756
+ 4.8.020 (2009-12-21)
1757
+ - Bug item #2918545 "Display problem of the first row of a table with larger font" was fixed.
1758
+ - A Bug relative to table rowspan mode was fixed.
1759
+
1760
+ 4.8.019 (2009-12-16)
1761
+ - Bug item #2915684 "Image size" was fixed.
1762
+ - Bug item #2914995 "Image jpeg quality" was fixed.
1763
+ - The signature of the Image() method was changed (check the documentation for the $resize parameter).
1764
+
1765
+ 4.8.018 (2009-12-15)
1766
+ - Bug item #2914352 "write error" was fixed.
1767
+
1768
+ 4.8.017 (2009-11-27)
1769
+ - THEAD problem when table is used on header/footer was fixed.
1770
+ - A first line alignment on HTML justification was fixed.
1771
+ - Method getImageFileType() was added.
1772
+ - Images with unknown extension and type are now supported via ImageMagick PHP extension.
1773
+
1774
+ 4.8.016 (2009-11-21)
1775
+ - Document Information Dictionary was fixed.
1776
+ - CSS attributes 'page-break-before', 'page-break-after' and 'page-break-inside' are now supported.
1777
+ - Problem of unclosed last page was fixed.
1778
+ - Problem of 'thead' unnecessarily repeated on the next page was fixed.
1779
+
1780
+ 4.8.015 (2009-11-20)
1781
+ - A problem with some PNG transparency images was fixed.
1782
+ - Bug #2900762 "Sort issues in Bookmarks" was fixed.
1783
+ - Text justification was fixed for various modes: underline, strikeout and background.
1784
+
1785
+ 4.8.014 (2009-11-04)
1786
+ - Bug item #2891316 "writeHTML, underlining replacing spaces" was fixed.
1787
+ - The handling of temporary RTL text direction mode was fixed.
1788
+
1789
+ 4.8.013 (2009-10-26)
1790
+ - Bug item #2884729 "Problem with word-wrap and hyphen" was fixed.
1791
+
1792
+ 4.8.012 (2009-10-23)
1793
+ - Table cell alignments for RTL booklet mode were fixed.
1794
+ - Images and barcode alignments for booklet mode were fixed.
1795
+
1796
+ 4.8.011 (2009-10-22)
1797
+ - DejaVu fonts were updated to latest version.
1798
+
1799
+ 4.8.010 (2009-10-21)
1800
+ - Bookmark for TOC page was added.
1801
+ - Signature of addTOC() method is changed.
1802
+ - Bookmarks are now automatically sorted by page and Y position.
1803
+ - Example n. 45 was updated.
1804
+ - Example n. 55 was added to display all charactes available on core fonts.
1805
+
1806
+ 4.8.009 (2009-09-30)
1807
+ - Compatibility with PHP 5.3 was improved.
1808
+ - All examples were updated.
1809
+ - Index file for examples was added.
1810
+
1811
+ 4.8.008 (2009-09-29)
1812
+ - Example 49 was updated.
1813
+ - Underline and linethrough now works with cell stretching mode.
1814
+
1815
+ 4.8.007 (2009-09-23)
1816
+ - Infinite loop problem caused by nobr attribute was fixed.
1817
+
1818
+ 4.8.006 (2009-09-23)
1819
+ - Bug item #2864522 "No images if DOCUMENT_ROOT=='/'" was fixed.
1820
+ - Support for text-indent CSS attribute was added.
1821
+ - Method rollbackTransaction() was changed to support self-reassignment of previous object (check source code documentation).
1822
+ - Support for the HTML "nobr" attribute was added to avoid splitting a table or a table row on two pages (i.e.: <tr nobr="true">...</tr>).
1823
+
1824
+ 4.8.005 (2009-09-17)
1825
+ - A bug relative to multiple transformations and annotations was fixed.
1826
+
1827
+ 4.8.004 (2009-09-16)
1828
+ - A bug on _putannotsrefs() method was fixed.
1829
+
1830
+ 4.8.003 (2009-09-15)
1831
+ - Bug item #2858754 "Division by zero" was fixed.
1832
+ - A bug relative to HTML list items was fixed.
1833
+ - A bug relative to form fields on multiple pages was fixed.
1834
+ - PolyLine() method was added (see example n. 12).
1835
+ - Signature of Polygon() method was changed.
1836
+
1837
+ 4.8.002 (2009-09-12)
1838
+ - A problem related to CID-0 fonts offset was fixed: if the $cw[1] entry on the CID-0 font file is not defined, then a CID keys offset is introduced.
1839
+
1840
+ 4.8.001 (2009-09-09)
1841
+ - The appearance streams (AP) for anotations form fields was fixed (see examples n. 14 and 54).
1842
+ - Radiobuttons were fixed.
1843
+
1844
+ 4.8.000 (2009-09-07)
1845
+ - This version includes some support for Forms fields (see example n. 14) and XHTML forms (see example n. 54).
1846
+ - The following methods were changed to work without JavaScript: TextField(), RadioButton(), ListBox(), ComboBox(), CheckBox(), Button().
1847
+ - Support for Widget annotations was improved.
1848
+ - Alignment of annotation objects was fixed (examples 36 and 41 were updated).
1849
+ - addJavascriptObject() method was added.
1850
+ - Signature of Image() method was changed.
1851
+ - htmlcolors.php file was updated.
1852
+
1853
+ ------------------------------------------------------------
1854
+
1855
+ 4.7.003 (2009-09-03)
1856
+ - Support for TCPDF methods on HTML was improved (see example n. 49).
1857
+
1858
+ 4.7.002 (2009-09-02)
1859
+ - Bug item #2848892 "writeHTML + table: Gaps between rows" was fixed.
1860
+ - JavaScript support was fixed (see example n. 53).
1861
+
1862
+ 4.7.001 (2009-08-30)
1863
+ - The Polygon() and Arrow() methods were fixed and improved (see example n. 12).
1864
+
1865
+ 4.7.000 (2009-08-29)
1866
+ - This is a major release.
1867
+ - Some procedures were internally optimized.
1868
+ - The problem of mixed signature and annotations was fixed (example n. 52).
1869
+
1870
+ 4.6.030 (2009-08-29)
1871
+ - IMPORTANT: percentages on table cell widths are now relative to the full table width (as in standard HTML).
1872
+ - Various minor bugs were fixed.
1873
+ - Example n. 52 (digital signature) was updated.
1874
+
1875
+ 4.6.029 (2009-08-26)
1876
+ - PHP4 version was fixed.
1877
+
1878
+ 4.6.028 (2009-08-25)
1879
+ - Signature algorithm was finally fixed (see example n. 52).
1880
+
1881
+ 4.6.027 (2009-08-24)
1882
+ - TCPDF now supports unembedded TrueTypeUnicode Fonts (just comment the $file entry on the fonts' php file.
1883
+
1884
+ 4.6.026 (2009-08-21)
1885
+ - Bug #2841693 "Problem with MultiCell and ishtml and justification" was fixed.
1886
+ - Signature functions were improved but not yet fixed (tcpdf.crt and example n. 52 were updated).
1887
+
1888
+ 4.6.025 (2009-08-17)
1889
+ - Carriage returns (\r) were removed from source code.
1890
+ - Problem related to set_magic_quotes_runtime() depracated was fixed.
1891
+
1892
+ 4.6.024 (2009-08-07)
1893
+ - Bug item #2833556 "justification using other units than mm" was fixed.
1894
+ - Documentation was fixed/updated.
1895
+
1896
+ 4.6.023 (2009-08-02)
1897
+ - Bug item #2830537 "MirrorH can show mask for transparent PNGs" was fixed.
1898
+
1899
+ 4.6.022 (2009-07-24)
1900
+ - A bug relative to single line printing when using WriteHTMLCell() was fixed.
1901
+ - Signature support were improved but is still experimental.
1902
+ - Fonts Free and Dejavu were updated to latest versions.
1903
+
1904
+ 4.6.021 (2009-07-20)
1905
+ - Bug item #2824015 "XHTML Ampersand &amp; in hyperlink bug" was fixed.
1906
+ - Bug item #2824036 "Image as hyperlink in table, text displaced at page break" was fixed.
1907
+ - Links alignment on justified text was fixed.
1908
+ - Unicode "\u" modifier was added to re_spaces variable by default.
1909
+
1910
+ 4.6.020 (2009-07-16)
1911
+ - Bug item #2821921 "issue in example 18" was fixed.
1912
+ - Signature of SetRTL() method was changed.
1913
+
1914
+ 4.6.019 (2009-07-13)
1915
+ - Bug item #2820703 "xref table broken" was fixed.
1916
+
1917
+ 4.6.018 (2009-07-10)
1918
+ - Bug item #2819319 "Text over text" was fixed.
1919
+ - Method Arrow() was added to print graphic arrows (example 12 was updated).
1920
+
1921
+ 4.6.017 (2009-07-05)
1922
+ - Bug item #2816079 "Example 48 not working" was fixed.
1923
+ - The signature of the checkPageBreak() was changed. The parameter $addpage was added to turn off the automatic page creation.
1924
+
1925
+ 4.6.016 (2009-06-16)
1926
+ - Method setSpacesRE() was added to set the regular expression used for detecting withespaces or word separators. If you are using chinese, try: setSpacesRE('/[\s\p{Z}\p{Lo}]/');, otherwise you can use setSpacesRE('/[\s\p{Z}]/');
1927
+ - The method _putinfo() now automatically fills the metadata with '?' in case of empty string.
1928
+
1929
+ 4.6.015 (2009-06-11)
1930
+ - Bug #2804667 "word wrap bug" was fixed.
1931
+
1932
+ 4.6.014 (2009-06-04)
1933
+ - Bug #2800931 "Table thead tag bug" was fixed.
1934
+ - A bug related to <pre> tag was fixed.
1935
+
1936
+ 4.6.013 (2009-05-28)
1937
+ - List bullets position was fixed for RTL languages.
1938
+
1939
+ 4.6.012 (2009-05-23)
1940
+ - setUserRights() method doesn't work anymore unless you call the setSignature() method with the Adobe private key!
1941
+
1942
+ 4.6.011 (2009-05-18)
1943
+ - Signature of the Image() method was changed to include the new $fitbox parameter (see source code documentation).
1944
+
1945
+ 4.6.010 (2009-05-17)
1946
+ - Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null.
1947
+ - <tcpdf> tag indent problem was fixed.
1948
+ - $y parameter was added to checkPageBreak() method.
1949
+ - Bug n. 2791773 "writeHTML" was fixed.
1950
+
1951
+ 4.6.009 (2009-05-13)
1952
+ - xref table for embedded files was fixed.
1953
+
1954
+ 4.6.008 (2009-05-07)
1955
+ - setSignature() method was improved (but is still experimental).
1956
+ - Example n. 52 was added.
1957
+
1958
+ 4.6.007 (2009-05-05)
1959
+ - Bug #2786685 "writeHtmlCell and <br /> in custom footer" was fixed.
1960
+ - Table header repeating bug was fixed.
1961
+ - Some newlines and tabs are now automatically removed from HTML strings.
1962
+
1963
+ 4.6.006 (2009-04-28)
1964
+ - Support for "<a name="...">...</a>" was added.
1965
+ - By default TCPDF requires PCRE Unicode support turned on but now works also without it (with limited ability to detect some Unicode blank spaces).
1966
+
1967
+ 4.6.005 (2009-04-25)
1968
+ - Points (pt) conversion in getHTMLUnitToUnits() was fixed.
1969
+ - Default tcpdf.pem certificate file was added.
1970
+ - Experimental support for signing document was added but it is not yet completed (some help is needed - I think that the calculation of the ByteRange is OK and the problem is on the signature calculation).
1971
+
1972
+ 4.6.004 (2009-04-23)
1973
+ - Method deletePage() was added to delete pages (see example n. 44).
1974
+
1975
+ 4.6.003 (2009-04-21)
1976
+ - The caching mechanism of the UTF8StringToArray() method was fixed.
1977
+
1978
+ 4.6.002 (2009-04-20)
1979
+ - Documentation of rollbackTransaction() method was fixed.
1980
+ - The setImageScale() and getImageScale() methods now set and get the adjusting parameter used by pixelsToUnits() method.
1981
+ - HTML images now support other units of measure than pixels (getHTMLUnitToUnits() is now used instead of pixelsToUnits()).
1982
+ - WARNING: PDF_IMAGE_SCALE_RATIO has been changed by default to 1.
1983
+
1984
+ 4.6.001 (2009-04-17)
1985
+ - Spaces between HTML block tags are now automatically removed.
1986
+ - The bug related to cMargin changes between tables was fixed.
1987
+
1988
+ 4.6.000 (2009-04-16)
1989
+ - WARNING: THIS VERSION CHANGES THE BEHAVIOUR OF $x and $y parameters for several TCPDF methods:
1990
+ zero coordinates for $x and $y are now valid coordinates;
1991
+ set $x and $y as empty strings to get the current value.
1992
+ - Some error caused by 'empty' function were fixed.
1993
+ - Default color for convertHTMLColorToDec() method was changed to white and the return value for invalid color is false.
1994
+ - HTML on footer bug was fixed.
1995
+ - The following examples were fixed: 5,7,10,17,19,20,21,33,42,43.
1996
+
1997
+ 4.5.043 (2009-04-15)
1998
+ - Barcode class (barcode.php) was extended to include new linear barcode types (see example n. 27):
1999
+ C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9
2000
+ C39+ : CODE 39 with checksum
2001
+ C39E : CODE 39 EXTENDED
2002
+ C39E+ : CODE 39 EXTENDED + CHECKSUM
2003
+ C93 : CODE 93 - USS-93
2004
+ S25 : Standard 2 of 5
2005
+ S25+ : Standard 2 of 5 + CHECKSUM
2006
+ I25 : Interleaved 2 of 5
2007
+ I25+ : Interleaved 2 of 5 + CHECKSUM
2008
+ C128A : CODE 128 A
2009
+ C128B : CODE 128 B
2010
+ C128C : CODE 128 C
2011
+ EAN2 : 2-Digits UPC-Based Extension
2012
+ EAN5 : 5-Digits UPC-Based Extension
2013
+ EAN8 : EAN 8
2014
+ EAN13 : EAN 13
2015
+ UPCA : UPC-A
2016
+ UPCE : UPC-E
2017
+ MSI : MSI (Variation of Plessey code)
2018
+ MSI+ : MSI + CHECKSUM (modulo 11)
2019
+ POSTNET : POSTNET
2020
+ PLANET : PLANET
2021
+ RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
2022
+ KIX : KIX (Klant index - Customer index)
2023
+ IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200 (NOTE: requires BCMath PHP extension)
2024
+ CODABAR : CODABAR
2025
+ CODE11 : CODE 11
2026
+ PHARMA : PHARMACODE
2027
+ PHARMA2T : PHARMACODE TWO-TRACKS
2028
+
2029
+ 4.5.042 (2009-04-15)
2030
+ - Method Write() was fixed for the strings containing only zero value.
2031
+
2032
+ 4.5.041 (2009-04-14)
2033
+ - Barcode methods were fixed.
2034
+
2035
+ 4.5.040 (2009-04-14)
2036
+ - Method Write() was fixed to handle empty strings.
2037
+
2038
+ 4.5.039 (2009-04-11)
2039
+ - Support for linear barcodes was extended (see example n. 27 and barcodes.php documentation).
2040
+
2041
+ 4.5.038 (2009-04-10)
2042
+ - Write() method was improved to support separators for Japanese, Korean, Chinese Traditional and Chinese Simplified.
2043
+
2044
+ 4.5.037 (2009-04-09)
2045
+ - General performances were improved.
2046
+ - The signature of the method utf8Bidi() was changed.
2047
+ - The method UniArrSubString() was added.
2048
+ - Experimental support for 2D barcodes were added (see example n. 50 and 2dbarcodes.php class).
2049
+
2050
+ 4.5.036 (2009-04-03)
2051
+ - TCPDF methods can be called inside the HTML code (see example n. 49).
2052
+ - All tag attributes, such as <p align="center"> must be enclosed within double quotes.
2053
+
2054
+ 4.5.035 (2009-03-28)
2055
+ - Bug #2717436 "writeHTML rowspan problem (continued)" was fixed.
2056
+ - Bug #2719090 "writeHTML fix follow up" was fixed.
2057
+ - The method _putuserrights() was changed to avoid Adobe Reader 9.1 crash. This broken the 'trick' that was used to display forms in Acrobat Reader.
2058
+
2059
+ 4.5.034 (2009-03-27)
2060
+ - Bug #2716914 "Bug writeHTML of a table in body and footer related with pb" was fixed.
2061
+ - Bug #2717056 ] "writeHTML problem when setting tr style" was fixed.
2062
+ - The signature of the Cell() method was changed.
2063
+
2064
+ 4.5.033 (2009-03-27)
2065
+ - The support for rowspan/colspan on HTML tables was improved (see example n. 48).
2066
+
2067
+ 4.5.032 (2009-03-23)
2068
+ - setPrintFooter(false) bug was fixed.
2069
+
2070
+ 4.5.031 (2009-03-20)
2071
+ - Table header support was extended to multiple pages.
2072
+
2073
+ 4.5.030 (2009-03-20)
2074
+ - thead tag is now supported on HTML tables (header rows are repeated after page breaks).
2075
+ - The startTransaction() was improved to autocommit.
2076
+ - List bullets now uses the foreground color (putHtmlListBullet()).
2077
+
2078
+ 4.5.029 (2009-03-19)
2079
+ - The following methods were added to UNDO commands (see example 47): startTransaction(), commitTransaction(), rollbackTransaction().
2080
+ - All examples were updated.
2081
+
2082
+ 4.5.028 (2009-03-18)
2083
+ - Bug #2690945 "List Bugs" was fixed.
2084
+ - HTML text alignment on lists was fixed.
2085
+ - The constant PDF_FONT_MONOSPACED was added to the configuration file to define the default monospaced font.
2086
+ - The following methods were fixed: getPageWidth(), getPageHeight(), getBreakMargin().
2087
+ - All examples were updated.
2088
+
2089
+ 4.5.027 (2009-03-16)
2090
+ - Method getPageDimensions() was added to get page dimensions.
2091
+ - The signature of the following methos were changed: getPageWidth(), getPageHeight(), getBreakMargin().
2092
+ - _parsepng() method was fixed for PNG URL images (fread bug).
2093
+
2094
+ 4.5.026 (2009-03-11)
2095
+ - Bug #2681793 affecting URL images with spaces was fixed.
2096
+
2097
+ 4.5.025 (2009-03-10)
2098
+ - A small bug affecting hyphenation support was fixed.
2099
+ - The method SetDefaultMonospacedFont() was added to define the default monospaced font.
2100
+
2101
+ 4.5.024 (2009-03-07)
2102
+ - The bug #2666493 was fixed "Footer corrupts document".
2103
+
2104
+ 4.5.023 (2009-03-06)
2105
+ - The bug #2666688 was fixed "Rowspan in tables".
2106
+
2107
+ 4.5.022 (2009-03-05)
2108
+ - The bug #2659676 was fixed "refer to #2157099 test 4 < BR > problem still not fixed".
2109
+ - addTOC() function bug was fixed.
2110
+
2111
+ 4.5.020 (2009-03-03)
2112
+ - The following bug was fixed: "function removeSHY corrupts unicode".
2113
+
2114
+ 4.5.019 (2009-02-28)
2115
+ - The problem of decimal separator using different locale was fixed.
2116
+ - The text hyphenation is now supported (see example n. 46).
2117
+
2118
+ 4.5.018 (2009-02-26)
2119
+ - The _destroy() method was added to unset all class variables and frees memory.
2120
+ - Now it's possible to call Output() method multiple times.
2121
+
2122
+ 4.5.017 (2009-02-24)
2123
+ - A minor bug that raises a PHP warning was fixed.
2124
+
2125
+ 4.5.016 (2009-02-24)
2126
+ - Bug item #2631200 "getNumLines() counts wrong" was fixed.
2127
+ - Multiple attachments bug was fixed.
2128
+ - All class variables are now cleared on Output() for memory otpimization.
2129
+
2130
+ 4.5.015 (2009-02-18)
2131
+ - Bug item #2612553 "function Write() must not break a line on &nbsp; character" was fixed.
2132
+
2133
+ 4.5.014 (2009-02-13)
2134
+ - Bug item #2595015 "POSTNET Barcode Checksum Error" was fixed (on barcode.php).
2135
+ - Pagebreak bug for barcode was fixed.
2136
+
2137
+ 4.5.013 (2009-02-12)
2138
+ - border attribute is now supported on HTML images (only accepts the same values accepted by Cell()).
2139
+
2140
+ 4.5.012 (2009-02-12)
2141
+ - An error on image border feature was fixed.
2142
+
2143
+ 4.5.011 (2009-02-12)
2144
+ - HTML links for images are now supported.
2145
+ - height attribute is now supported on HTML cells.
2146
+ - $border parameter was added to Image() and ImageEps() methods.
2147
+ - The method getNumLines() was added to estimate the number of lines required for the specified text.
2148
+
2149
+ 4.5.010 (2009-01-29)
2150
+ - Bug n. 2546108 "BarCode Y position" was fixed.
2151
+
2152
+ 4.5.009 (2009-01-26)
2153
+ - Bug n. 2538094 "Empty pdf file created" was fixed.
2154
+
2155
+ 4.5.008 (2009-01-26)
2156
+ - setPage() method was fixed to correctly restore graphic states.
2157
+ - Source code was cleaned up for performances.
2158
+
2159
+ 4.5.007 (2009-01-24)
2160
+ - checkPageBreak() and write1DBarcode() methods were fixed.
2161
+ - Source code was cleaned up for performances.
2162
+ - barcodes.php was updated.
2163
+
2164
+ 4.5.006 (2009-01-23)
2165
+ - getHTMLUnitToPoints() method was replaced by getHTMLUnitToUnits() to fix HTML units bugs.
2166
+
2167
+ 4.5.005 (2009-01-23)
2168
+ - Page closing bug was fixed.
2169
+
2170
+ 4.5.004 (2009-01-21)
2171
+ - The access of convertHTMLColorToDec() method was changed to public
2172
+ - Fixed bug on UL tag.
2173
+
2174
+ 4.5.003 (2009-01-19)
2175
+ - Fonts on different folders are now supported.
2176
+
2177
+ 4.5.002 (2009-01-07)
2178
+ - addTOC() function was improved (see example n. 45).
2179
+
2180
+ 4.5.001 (2009-01-04)
2181
+ - The signature of startPageGroup() function was changed.
2182
+ - Method Footer() was improved to automatically print page or page-group number (see example n. 23).
2183
+ - Protected method formatTOCPageNumber() was added to customize the format of page numbers on the Table Of Content.
2184
+ - The signature of addTOC() was changed to include the font used for page numbers.
2185
+
2186
+ 4.5.000 (2009-01-03)
2187
+ - A new $diskcache parameter was added to class constructor to enable disk caching and reduce RAM memory usage (see example n. 43).
2188
+ - The method movePageTo() was added to move pages to previous positions (see example n. 44).
2189
+ - The methods getAliasNumPage() and getPageNumGroupAlias() were added to get the alias for page number (needed when using movepageTo()).
2190
+ - The methods addTOC() was added to print a Table Of Content (see example n. 45).
2191
+ - Imagick class constant was removed for better compatibility with PHP4.
2192
+ - All existing examples were updated and new examples were added.
2193
+
2194
+ 4.4.009 (2008-12-29)
2195
+ - Examples 1 and 35 were fixed.
2196
+
2197
+ 4.4.008 (2008-12-28)
2198
+ - Bug #2472169 "Unordered bullet size not adjusted for unit type" was fixed.
2199
+
2200
+ 4.4.007 (2008-12-23)
2201
+ - Bug #2459935 "no unit conversion for header line" was fixed.
2202
+ - Example n. 42 for image alpha channel was added.
2203
+ - All examples were updated.
2204
+
2205
+ 4.4.006 (2008-12-11)
2206
+ - Method setLIsymbol() was changed to reflect latest changes in HTML list handling.
2207
+
2208
+ 4.4.005 (2008-12-10)
2209
+ - Bug item #2413870 "ordered list override value" was fixed.
2210
+
2211
+ 4.4.004 (2008-12-10)
2212
+ - The protected method getHTMLUnitToPoints() was added to accept various HTML units of measure (em, ex, px, in, cm, mm, pt, pc, %).
2213
+ - The method intToRoman() was added to convert integer number to Roman representation.
2214
+ - Support fot HTML lists was improved: the CSS property list-style-type is now supported.
2215
+
2216
+ 4.4.003 (2008-12-09)
2217
+ - Bug item #2412147 "Warning on line 3367" was fixed.
2218
+ - Method setHtmlLinksStyle() was added to set default HTML link colors and font style.
2219
+ - Method addHtmlLink() was changed to use color and style defined on the inline CSS.
2220
+
2221
+ 4.4.002 (2008-12-09)
2222
+ - Borders on Multicell() were fixed.
2223
+ - Problem of Multicell() on Header function (Bug item #2407579) was fixed.
2224
+ - Problem on graphics tranformations applied to Multicell() was fixed.
2225
+ - Support for ImageMagick was added.
2226
+ - Width calculation for nested tables was fixed.
2227
+
2228
+ 4.4.001 (2008-12-08)
2229
+ - Some missing core fonts were added on fonts directory.
2230
+ - CID0 fonts rendering was fixed.
2231
+ - HTML support was improved (<pre> and <tt> tags are now supported).
2232
+ - Bug item #2406022 "Left padding bug in MultiCell with maxh" was fixed.
2233
+
2234
+ 4.4.000 (2008-12-07)
2235
+ - File attachments are now supported (see example n. 41).
2236
+ - Font functions were optimized to reduce document size.
2237
+ - makefont.php was updated.
2238
+ - Linux binaries were added on /fonts/utils
2239
+ - All fonts were updated.
2240
+ - $autopadding parameter was added to Multicell() to disable automatic padding features.
2241
+ - $maxh parameter was added to Multicell() and Write() to set a maximum height.
2242
+
2243
+ 4.3.009 (2008-12-05)
2244
+ - Bug item #2392989 (Custom header + setlinewidth + cell border bug) was fixed.
2245
+
2246
+ 4.3.008 (2008-12-05)
2247
+ - Bug item #2390566 "rect bug" was fixed.
2248
+ - File path was fixed for font embedded files.
2249
+ - SetFont() method signature was changed to include the font filename.
2250
+ - Some font-related methods were improved.
2251
+ - Methods getFontFamily() and getFontStyle() were added.
2252
+
2253
+ 4.3.007 (2008-12-03)
2254
+ - PNG alpha channel is now supported (GD library is required).
2255
+ - AddFont() function now support custom font file path on $file parameter.
2256
+ - The default width variable ($dw) is now always defined for any font.
2257
+ - The 'Style' attribute on CID-0 fonts was removed because of protection bug.
2258
+
2259
+ 4.3.006 (2008-12-01)
2260
+ - A regular expression on getHtmlDomArray() to find HTML tags was fixed.
2261
+
2262
+ 4.3.005 (2008-11-25)
2263
+ - makefont.php was fixed.
2264
+ - Bug item #2339877 was fixed (false loop condition detected on WriteHTML()).
2265
+ - Bug item #2336733 was fixed (lasth value update on Multicell() when border and fill are disabled).
2266
+ - Bug item #2342303 was fixed (automatic page-break on Image() and ImageEPS()).
2267
+
2268
+ 4.3.004 (2008-11-19)
2269
+ - Function _textstring() was fixed (bug 2309051).
2270
+ - All examples were updated.
2271
+
2272
+ 4.3.003 (2008-11-18)
2273
+ - CID-0 font bug was fixed.
2274
+ - Some functions were optimized.
2275
+ - Function getGroupPageNoFormatted() was added.
2276
+ - Example n. 23 was updated.
2277
+
2278
+ 4.3.002 (2008-11-17)
2279
+ - Bug item #2305518 "CID-0 font don't work with encryption" was fixed.
2280
+
2281
+ 4.3.001 (2008-11-17)
2282
+ - Bug item #2300007 "download mimetype pdf" was fixed.
2283
+ - Double quotes were replaced by single quotes to improve PHP performances.
2284
+ - A bug relative to HTML cell borders was fixed.
2285
+
2286
+ 4.3.000 (2008-11-14)
2287
+ - The function setOpenCell() was added to set the top/bottom cell sides to be open or closed when the cell cross the page.
2288
+ - A bug relative to list items indentation was fixed.
2289
+ - A bug relative to borders on HTML tables and Multicell was fixed.
2290
+ - A bug relative to rowspanned cells was fixed.
2291
+ - A bug relative to html images across pages was fixed.
2292
+
2293
+ 4.2.009 (2008-11-13)
2294
+ - Spaces between li tags are now automatically removed.
2295
+
2296
+ 4.2.008 (2008-11-12)
2297
+ - A bug relative to fill color on next page was fixed.
2298
+
2299
+ 4.2.007 (2008-11-12)
2300
+ - The function setListIndentWidth() was added to set custom indentation widht for HTML lists.
2301
+
2302
+ 4.2.006 (2008-11-06)
2303
+ - A bug relative to HTML justification was fixed.
2304
+
2305
+ 4.2.005 (2008-11-06)
2306
+ - A bug relative to HTML justification was fixed.
2307
+ - The methods formatPageNumber() and PageNoFormatted() were added to format page numbers.
2308
+ - Default Footer() method was changed to use PageNoFormatted() instead of PageNo().
2309
+ - Example 6 was updated.
2310
+
2311
+ 4.2.004 (2008-11-04)
2312
+ - Bug item n. 2217039 "filename handling improvement" was fixed.
2313
+
2314
+ 4.2.003 (2008-10-31)
2315
+ - Font style bug was fixed.
2316
+
2317
+ 4.2.002 (2008-10-31)
2318
+ - Bug item #2210922 (htm element br not work) was fixed.
2319
+ - Write() function was improved to support margin changes.
2320
+
2321
+ 4.2.001 (2008-10-30)
2322
+ - setHtmlVSpace($tagvs) function was added to set custom vertical spaces for HTML tags.
2323
+ - writeHTML() function now support margin changes during execution.
2324
+ - Signature of addHTMLVertSpace() function is changed.
2325
+
2326
+ 4.2.000 (2008-10-29)
2327
+ - htmlcolors.php was changed to support class-loaders.
2328
+ - ImageEps() function was improved in performances.
2329
+ - Signature of Link() And Annotation() functions were changed.
2330
+ - (Bug item #2198926) Links and Annotations alignment were fixed (support for geometric tranformations was added).
2331
+ - rowspan mode for HTML table cells was improved and fixed.
2332
+ - Booklet mode for double-sided pages was added; see SetBooklet() function and example n. 40.
2333
+ - lastPage() signature is changed.
2334
+ - Signature of Write() function is changed.
2335
+ - Some HTML justification problems were fixed.
2336
+ - Some functions were fixed to better support RTL mode.
2337
+ - Example n. 10 was changed to support RTL mode.
2338
+ - All examples were updated.
2339
+
2340
+ 4.1.004 (2008-10-23)
2341
+ - unicode_data.php was changed to support class-loaders.
2342
+ - Bug item #2186040/2 (writeHTML margin problem) was fixed.
2343
+
2344
+ 4.1.003 (2008-10-22)
2345
+ - Bug item #2185399 was fixed (rowspan and page break).
2346
+ - Bugs item #2186040 was fixed (writeHTML margin problem).
2347
+ - Newline after table was removed.
2348
+
2349
+ 4.1.002 (2008-10-21)
2350
+ - Bug item #2184525 was fixed (rowspan on HTML cell).
2351
+
2352
+ 4.1.001 (2008-10-21)
2353
+ - Support for "start" attribute was added to HTML ordered list.
2354
+ - unicode_data.php file was changed to include UTF-8 to ASCII table.
2355
+ - Some functions were modified to better support UTF-8 extensions to core fonts.
2356
+ - Support for images on HTML lists was improved.
2357
+ - Examples n. 1 and 6 were updated.
2358
+
2359
+ 4.1.000 (2008-10-18)
2360
+ - Page-break bug using HTML content was fixed.
2361
+ - The "false" parameter was reintroduced to class_exists function on PHP5 version to avoid autoload.
2362
+ - addHtmlLink() function was improved to support internal links (i.e.: <a href="#23">link to page 23</a>).
2363
+ - Justification alignment is now supported on HTML (see example n. 39).
2364
+ - example_006.php was updated.
2365
+
2366
+ 4.0.033 (2008-10-13)
2367
+ - Bug n. 2157099 was fixed.
2368
+ - SetX() and SetY() functions were improved.
2369
+ - SetY() includes a new parameter to avoid the X reset.
2370
+
2371
+ 4.0.032 (2008-10-10)
2372
+ - Bug n. 2156926 was fixed (bold, italic, underlined, linethrough).
2373
+ - setStyle() method was removed.
2374
+ - Configuration file was changed to use helvetica (non-unicode) font by default.
2375
+ - The use of mixed font types was improved.
2376
+ - All examples were updated.
2377
+
2378
+ 4.0.031 (2008-10-09)
2379
+ - _putannots() and _putbookmarks() links alignments were fixed.
2380
+
2381
+ 4.0.030 (2008-10-07)
2382
+ - _putbookmarks() function was fixed.
2383
+ - _putannots() was fixed to include internal links.
2384
+
2385
+ 4.0.029 (2008-09-27)
2386
+ - Infinite loop bug was fixed [Bug item #130309].
2387
+ - Multicell() problem on Header() was fixed.
2388
+
2389
+ 4.0.028 (2008-09-26)
2390
+ - setLIsymbol() was added to set the LI symbol used on UL lists.
2391
+ - Missing $padding and $encryption_key variables declarations were added [Bug item #2129058].
2392
+
2393
+ 4.0.027 (2008-09-19)
2394
+ - Bug #2118588 "Undefined offset in tcpdf.php on line 9581" was fixed.
2395
+ - arailunicid0.php font was updated.
2396
+ - The problem of javascript form fields duplication after saving was fixed.
2397
+
2398
+ 4.0.026 (2008-09-17)
2399
+ - convertHTMLColorToDec() function was improved to support rgb(RR,GG,BB) notation.
2400
+ - The following inline CSS attributes are now supported: text-decoration, color, background-color and font-size names: xx-small, x-small, small, medium, large, x-large, xx-large
2401
+ - Example n. 6 was updated.
2402
+
2403
+ 4.0.025 (2008-09-15)
2404
+ - _putcidfont0 function was improved to include CJK fonts (Chinese, Japanese, Korean, CJK, Asian fonts) without embedding.
2405
+ - arialunicid0 font was added (see the new example n. 38).
2406
+ - The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php.
2407
+
2408
+ 4.0.024 (2008-09-12)
2409
+ - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4.
2410
+ - support for Spot Colors were added. Check the new example n. 37 and the following new functions:
2411
+ AddSpotColor()
2412
+ SetDrawSpotColor()
2413
+ SetFillSpotColor()
2414
+ SetTextSpotColor()
2415
+ _putspotcolors()
2416
+ - Bookmark() function was improved to fix wrong levels.
2417
+ - $lasth changes after header/footer calls were fixed.
2418
+
2419
+ 4.0.023 (2008-09-05)
2420
+ - Some HTML related problems were fixed.
2421
+ - Image alignment on HTML was changed, now it always defaults to the normal mode (see example_006.php).
2422
+
2423
+ 4.0.022 (2008-08-28)
2424
+ - Line height on HTML was fixed.
2425
+ - Image inside an HTML cell problem was fixed.
2426
+ - A new "zarbold" persian font was added.
2427
+
2428
+ 4.0.021 (2008-08-24)
2429
+ - HTTP headers were fixed on Output function().
2430
+ - getAliasNbPages() and getPageGroupAlias() functions were changed to support non-unicode fonts on unicode documents.
2431
+ - Function Write() was fixed.
2432
+ - The problem of additional vertical spaces on HTML was fixed.
2433
+ - The problem of frame around HTML links was fixed.
2434
+
2435
+ 4.0.020 (2008-08-15)
2436
+ - "[2052259] WriteHTML <u> & <b>" bug was fixed.
2437
+
2438
+ 4.0.019 (2008-08-13)
2439
+ - "Rowspan on first cell" bug was fixed.
2440
+
2441
+ 4.0.018 (2008-08-08)
2442
+ - Default cellpadding for HTML tables was fixed.
2443
+ - Annotation() function was added to support some PDF annotations (see example_036.php and section 8.4 of PDF reference 1.7).
2444
+ - HTML links are now correclty shifted during line alignments.
2445
+ - function getAliasNbPages() was added and Footer() was updated.
2446
+ - RowSpan mode for HTML tables was fixed.
2447
+ - Bugs item #2043610 "Multiple sizes vertical align wrong" was fixed.
2448
+ - ImageEPS() function was improved and RTL alignment was fixed (see example_032.php).
2449
+
2450
+ 4.0.017 (2008-08-05)
2451
+ - Missing CNZ and CEO style modes were added to Rect() function.
2452
+ - Fonts utils were updated to include support for OpenType fonts.
2453
+ - getLastH() function was added.
2454
+
2455
+ 4.0.016 (2008-07-30)
2456
+ - setPageMark() function was added. This function must be called after calling Image() function for a background image.
2457
+
2458
+ 4.0.015 (2008-07-29)
2459
+ - Some functions were changed to support different page formats (see example_028.php).
2460
+ - The signature of setPage() function is changed.
2461
+
2462
+ 4.0.014 (2008-07-29)
2463
+ - K_PATH_MAIN calculation on tcpdf_config.php was fixed.
2464
+ - HTML support for EPS/AI images was added (see example_006.php).
2465
+ - Bugs item #2030807 "Truncated text on multipage html fields" was fixed.
2466
+ - PDF header bug was fixed.
2467
+ - helvetica was added as default font family.
2468
+ - Stroke mode was fixed on Text function.
2469
+ - several minor bugs were fixed.
2470
+
2471
+ 4.0.013 (2008-07-27)
2472
+ - Bugs item #2027799 " Big spaces between lines after page break" was fixed.
2473
+ - K_PATH_MAIN calculation on tcpdf_config.php was changed.
2474
+ - Function setVisibility() was fixed to avoid the "Incorrect PDEObject type" error message.
2475
+
2476
+ 4.0.012 (2008-07-24)
2477
+ - Addpage(), Header() and Footer() functions were changed to simplify the implementation of external header/footer functions.
2478
+ - The following functions were added:
2479
+ setHeader()
2480
+ setFooter()
2481
+ getImageRBX()
2482
+ getImageRBY()
2483
+ getCellHeightRatio()
2484
+ getHeaderFont()
2485
+ getFooterFont()
2486
+ getRTL()
2487
+ getBarcode()
2488
+ getHeaderData()
2489
+ getHeaderMargin()
2490
+ getFooterMargin()
2491
+
2492
+ 4.0.011 (2008-07-23)
2493
+ - Font support was improved.
2494
+ - The folder /fonts/utils contains new utilities and instructions for embedd font files.
2495
+ - Documentation was updated.
2496
+
2497
+ 4.0.010 (2008-07-22)
2498
+ - HTML tables were fixed to work across pages.
2499
+ - Header() and Footer() functions were updated to preserve previous settings.
2500
+ - example_035.php was added.
2501
+
2502
+ 4.0.009 (2008-07-21)
2503
+ - UTF8StringToArray() function was fixed for non-unicode mode.
2504
+
2505
+ 4.0.008 (2008-07-21)
2506
+ - Barcodes alignment was fixed (see example_027.php).
2507
+ - unicode_data.php was updated.
2508
+ - Arabic shaping for "Zero-Width Non-Joiner" character (U+200C) was fixed.
2509
+
2510
+ 4.0.007 (2008-07-18)
2511
+ - str_split was replaced by preg_split for compatibility with PHP4 version.
2512
+ - Clipping mode was added to all graphic functions by using parameter $style = "CNZ" or "CEO" (see example_034.php).
2513
+
2514
+ 4.0.006 (2008-07-16)
2515
+ - HTML rowspan bug was fixed.
2516
+ - Line style for MultiCell() was fixed.
2517
+ - WriteHTML() function was improved.
2518
+ - CODE128C barcode was fixed (barcodes.php).
2519
+
2520
+ 4.0.005 (2008-07-11)
2521
+ - Bug [2015715] "PHP Error/Warning" was fixed.
2522
+
2523
+ 4.0.004 (2008-07-09)
2524
+ - HTML cell internal padding was fixed.
2525
+
2526
+ 4.0.003 (2008-07-08)
2527
+ - Removed URL encoding when F option is selected on Output() function.
2528
+ - fixed some minor bugs in html tables.
2529
+
2530
+ 4.0.002 (2008-07-07)
2531
+ - Bug [2000861] was still unfixed and has been fixed.
2532
+
2533
+ 4.0.001 (2008-07-05)
2534
+ - Bug [2000861] was fixed.
2535
+
2536
+ 4.0.000 (2008-07-03)
2537
+ - THIS IS A MAIN RELEASE THAT INCLUDES SEVERAL NEW FEATURES AND BUGFIXES
2538
+ - Signature fo SetTextColor() and SetFillColor() functions was changed (parameter $storeprev was removed).
2539
+ - HTML support was completely rewritten and improved (see example 6).
2540
+ - Alignments parameters were fixed.
2541
+ - Functions GetArrStringWidth() and GetStringWidth() now include font parameters.
2542
+ - Fonts support was improved.
2543
+ - All core fonts were replaced and moved to fonts/ directory.
2544
+ - The following functions were added: getMargins(), getFontSize(), getFontSizePt().
2545
+ - File config/tcpdf_config_old.php was renamed tcpdf_config_alt.php and updated.
2546
+ - Multicell and WriteHTMLCell fill function was fixed.
2547
+ - Several minor bugs were fixed.
2548
+ - barcodes.php was updated.
2549
+ - All examples were updated.
2550
+
2551
+ ------------------------------------------------------------
2552
+
2553
+ 3.1.001 (2008-06-13)
2554
+ - Bug [1992515] "K_PATH_FONTS default value wrong" was fixed.
2555
+ - Vera font was removed, DejaVu font and Free fonts were updated.
2556
+ - Image handling was improved.
2557
+ - All examples were updated.
2558
+
2559
+ 3.1.000 (2008-06-11)
2560
+ - setPDFVersion() was added to change the default PDF version (currently 1.7).
2561
+ - setViewerPreferences() was added to control the way the document is to be presented on the screen or printed (see example 29).
2562
+ - SetDisplayMode() signature was changed (new options were added).
2563
+ - LinearGradient(), RadialGradient(), CoonsPatchMesh() functions were added to print various color gradients (see example 30).
2564
+ - PieSector() function was added to render render pie charts (see example 31).
2565
+ - ImageEps() was added to display EPS and AI images with limited support (see example 32).
2566
+ - writeBarcode() function is now depracated, a new write1DBarcode() function was added. The barcode directory was removed and a new barcodes.php file was added.
2567
+ - The new write1DBarcode() function support more barcodes and do not need the GD library (see example 027). All barcodes are directly written to PDF using graphic functions.
2568
+ - HTML lists were improved and could be nested (you may now represent trees).
2569
+ - AddFont() bug was fixed.
2570
+ - _putfonts() bug was fixed.
2571
+ - graphics functions were fixed.
2572
+ - unicode_data.php file was updated (fixed).
2573
+ - almohanad font was updated.
2574
+ - example 18 was updated (Farsi and Arabic languages).
2575
+ - source code cleanup.
2576
+ - All examples were updated and new examples were added.
2577
+
2578
+ 3.0.015 (2008-06-06)
2579
+ - AddPage() function signature is changed to include page format.
2580
+ - example 28 was added to show page format changes.
2581
+ - setPageUnit() function was added to change the page units of measure.
2582
+ - setPageFormat() function was added to change the page format and orientation between pages.
2583
+ - setPageOrientation() function was added to change the page orientation.
2584
+ - Arabic font shaping was fixed for laa letter and square boxes (see the example 18).
2585
+
2586
+ 3.0.014 (2008-06-04)
2587
+ - Arabic font shaping was fixed.
2588
+ - setDefaultTableColumns() function was added.
2589
+ - $cell_height_ratio variable was added.
2590
+ - setCellHeightRatio() function was added to define the default height of cell repect font height.
2591
+
2592
+ 3.0.013 (2008-06-03)
2593
+ - Multicell height parameter was fixed.
2594
+ - Arabic font shaping was improved.
2595
+ - unicode_data.php was updated.
2596
+
2597
+ 3.0.012 (2008-05-30)
2598
+ - K_PATH_MAIN and K_PATH_URL constants are now automatically set on config file.
2599
+ - DOCUMENT_ROOT constant was fixed for IIS Webserver (config file was updated).
2600
+ - Arabic font shaping was improved.
2601
+ - TranslateY() function was fixed (bug [1977962]).
2602
+ - setVisibility() function was fixed.
2603
+ - writeBarcode() function was fixed to scale using $xref parameter.
2604
+ - All examples were updated.
2605
+
2606
+ 3.0.011 (2008-05-23)
2607
+ - CMYK color support was added to all graphic functions.
2608
+ - HTML table support was improved:
2609
+ -- now it's possible to include additional html tags inside a cell;
2610
+ -- colspan attribute was added.
2611
+ - example 006 was updated.
2612
+
2613
+ 3.0.010 (2008-05-21)
2614
+ - fixed $laa_array inclusion on utf8Bidi() function.
2615
+
2616
+ 3.0.009 (2008-05-20)
2617
+ - unicode_data.php was updated.
2618
+ - Arabic laa letter problem was fixed.
2619
+
2620
+ 3.0.008 (2008-05-12)
2621
+ - Arabic support was fixed and improved (unicode_data.php was updated).
2622
+ - Polycurve() function was added to draw a poly-Bezier curve.
2623
+ - list items alignment was fixed.
2624
+ - example 6 was updated.
2625
+
2626
+ 3.0.007 (2008-05-06)
2627
+ - Arabic support was fixed and improved.
2628
+ - AlMohanad (arabic) font was added.
2629
+ - C128 barcode bugs were fixed.
2630
+
2631
+ 3.0.006 (2008-04-21)
2632
+ - Condition to check negative width values was added.
2633
+
2634
+ 3.0.005 (2008-04-18)
2635
+ - back-Slash character escape was fixed on writeHTML() function.
2636
+ - Exampe 6 was updated.
2637
+
2638
+ 3.0.004 (2008-04-11)
2639
+ - Bug [1939304] (Right to Left Issue) was fixed.
2640
+
2641
+ 3.0.003 (2008-04-07)
2642
+ - Bug [1934523](Words between HTML tags in cell not kept on one line) was fixed.
2643
+ - "face" attribute of "font" tag is now fully supported.
2644
+
2645
+ 3.0.002 (2008-04-01)
2646
+ - Write() functions now return the number of cells and not the number of lines.
2647
+ - TCPDF is released under LGPL 2.1, or any later version.
2648
+
2649
+ 3.0.001 (2008-05-28)
2650
+ - _legacyparsejpeg() and _legacyparsepng() were renamed _parsejpeg() and _parsepng().
2651
+ - function writeBarcode() was fixed.
2652
+ - all examples were updated.
2653
+ - example 27 was added to show various barcodes.
2654
+
2655
+ 3.0.000 (2008-03-27)
2656
+ - private function pixelsToMillimeters() was changed to public function pixelsToUnits() to fix html image size bug.
2657
+ - Image-related functions were rewritten.
2658
+ - resize parameter was added to Image() signature to reduce the image size and fit width and height (see example 9).
2659
+ - TCPDF now supports all images supported by GD library: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM.
2660
+ - CMYK support was added to SetDrawColor(), SetFillColor(), SetTextColor() (see example 22).
2661
+ - Page Groups were added (see example 23).
2662
+ - setVisibility() function was added to restrict the rendering of some elements to screen or printout (see example 24).
2663
+ - All private variables and functions were changed to protected.
2664
+ - setAlpha() function was added to give transparency support for all objects (see example 25).
2665
+ - Clipping and stroke modes were added to Text() function (see example 26).
2666
+ - All examples were moved to "examples" directory.
2667
+ - function setJPEGQuality() was added to set the JPEG image comrpession (see example 9).
2668
+
2669
+ 2.9.000 (2008-03-26)
2670
+ - htmlcolors.php file was added to include html colors.
2671
+ - Support for HTML color names and three-digit hexadecimal color codes was added.
2672
+ - private function convertColorHexToDec() was renamed convertHTMLColorToDec().
2673
+ - color and bgcolor attributes are now supported on all HTML tags (color nesting is also supported).
2674
+ - Write() function were fixed.
2675
+ - example_006.php was updated.
2676
+ - private function setUserRights() was added to release user rights on Acrobat Reader (this allows to display forms, see example 14)
2677
+
2678
+ 2.8.000 (2008-03-20)
2679
+ - Private variables were changed to protected.
2680
+ - Function Write() was fixed and improved.
2681
+ - Support for dl, dt, dd, del HTML tags was introduced.
2682
+ - Line-trought mode was added for HTML and text.
2683
+ - Text vertical alignment on cells were fixed.
2684
+ - Examples were updated to reflect changes.
2685
+
2686
+ 2.7.002 (2008-03-13)
2687
+ - Bug "[1912142] Encrypted PDF created/modified date" was fixed.
2688
+
2689
+ 2.7.001 (2008-03-10)
2690
+ - Cell justification was fixed for non-unicode mode.
2691
+
2692
+ 2.7.000 (2008-03-09)
2693
+ - Cell() stretching mode 4 (forced character spacing) was fixed.
2694
+ - writeHTMLCell() now uses Multicell() to write.
2695
+ - Multicell() has a new parameter $ishtml to act as writeHTMLCell().
2696
+ - Write() speed was improved for non-arabic strings.
2697
+ - Example n. 20 was changed.
2698
+
2699
+ 2.6.000 (2008-03-07)
2700
+ - various alignments bugs were fixed.
2701
+
2702
+ 2.5.000 (2008-03-07)
2703
+ - Several bugs were fixed.
2704
+ - example_019.php was added to test non-unicode mode using old fonts.
2705
+
2706
+ 2.4.000 (2008-03-06)
2707
+ - RTL support was deeply improved.
2708
+ - GetStringWidth() was fixed to support RTL languages.
2709
+ - Text() RTL alignment was fixed.
2710
+ - Some functions were added: GetArrStringWidth(), GetCharWidth(), uniord(), utf8Bidi().
2711
+ - example_018.php was added and test_unicode.php was removed.
2712
+
2713
+ 2.3.000 (2008-03-05)
2714
+ - MultiCell() signature is changed. Now support multiple columns across pages (see example_017).
2715
+ - Write() signature is changed. Now support the cell mode to be used with MultiCell.
2716
+ - Header() and Footer() were changed.
2717
+ - The following functions were added: UTF8ArrSubString() and unichr().
2718
+ - Examples were updated to reflect last changes.
2719
+
2720
+ 2.2.004 (2008-03-04)
2721
+ - Several examples were added.
2722
+ - AddPage() Header() and Footer() were fixed.
2723
+ - Documentation is now available on http://www.tcpdf.org
2724
+
2725
+ 2.2.003 (2008-03-03)
2726
+ - [1894853] Performance of MultiCell() was improved.
2727
+ - RadioButton and ListBox functions were added.
2728
+ - javascript form functions were rewritten and properties names are changed. The properties function supported by form fields are listed on Possible values are listed on http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf.
2729
+
2730
+ 2.2.002 (2008-02-28)
2731
+ - [1900495] html images path was fixed.
2732
+ - Legacy image functions were reintroduced to allow PNG and JPEG support without GD library.
2733
+
2734
+ 2.2.001 (2008-02-16)
2735
+ - The bug "[1894700] bug with replace relative path" was fixed
2736
+ - Justification was fixed
2737
+
2738
+ 2.2.000 (2008-02-12)
2739
+ - fixed javascript bug introduced with latest release
2740
+
2741
+ 2.1.002 (2008-02-12)
2742
+ - Justify function was fixed on PHP4 version.
2743
+ - Bookmank function was added ([1578250] Table of contents).
2744
+ - Javascript and Form fields support was added ([1796359] Form fields).
2745
+
2746
+ 2.1.001 (2008-02-10)
2747
+ - The bug "[1885776] Race Condition in function justitfy" was fixed.
2748
+ - The bug "[1890217] xpdf complains that pdf is incorrect" was fixed.
2749
+
2750
+ 2.1.000 (2008-01-07)
2751
+ - FPDF_FONTPATH constant was changed to K_PATH_FONTS on config file
2752
+ - Bidirectional Algorithm to correctly reverse bidirectional languages was added.
2753
+ - SetLeftMargin, SetTopMargin, SetRightMargin functions were fixed.
2754
+ - SetCellPadding function was added.
2755
+ - writeHTML was updated with new parameters.
2756
+ - Text function was fixed.
2757
+ - MultiCell function was fixed, now works also across multiple pages.
2758
+ - Line width was fixed on Header and Footer functions and <hr> tag.
2759
+ - "GetImageSize" was renamed "getimagesize".
2760
+ - Document version was changed from 1.3 to 1.5.
2761
+ - _begindoc() function was fixed.
2762
+ - ChangeDate was fixed and ModDate was added.
2763
+ - The following functions were added:
2764
+ setPage() : Move pointer to the specified document page.
2765
+ getPage() : Get current document page number.
2766
+ lastpage() : Reset pointer to the last document page.
2767
+ getNumPages() : Get the total number of inserted pages.
2768
+ GetNumChars() : count the number of (UTF-8) characters in a string.
2769
+ - $stretch parameter was added to Cell() function to fit text on cell:
2770
+ 0 = disabled
2771
+ 1 = horizontal scaling only if necessary
2772
+ 2 = forced horizontal scaling
2773
+ 3 = character spacing only if necessary
2774
+ 4 = forced character spacing
2775
+ - Line function was fixed for RTL.
2776
+ - Graphic transformation functions were added [1811158]:
2777
+ StartTransform()
2778
+ StopTransform()
2779
+ ScaleX()
2780
+ ScaleY()
2781
+ ScaleXY()
2782
+ Scale()
2783
+ MirrorH()
2784
+ MirrorV()
2785
+ MirrorP()
2786
+ MirrorL()
2787
+ TranslateX()
2788
+ TranslateY()
2789
+ Translate()
2790
+ Rotate()
2791
+ SkewX()
2792
+ SkewY()
2793
+ Skew()
2794
+ - Graphic function were added/updated [1688549]:
2795
+ SetLineStyle()
2796
+ _outPoint()
2797
+ _outLine()
2798
+ _outRect()
2799
+ _outCurve()
2800
+ Line()
2801
+ Rect()
2802
+ Curve
2803
+ Ellipse
2804
+ Circle
2805
+ Polygon
2806
+ RegularPolygon
2807
+
2808
+ 2.0.000 (2008-01-04)
2809
+ - RTL (Right-To-Left) languages support was added. Language direction is set using the $l['a_meta_dir'] setting on /configure/language/xxx.php language files.
2810
+ - setRTL($enable) method was added to manually enable/disable the RTL text direction.
2811
+ - The attribute "dir" was added to support custom text direction on HTML tags. Possible values are: ltr - for Left-To-Right and RTL for Right-To-Left.
2812
+ - RC4 40bit encryption was added. Check the SetProtection method.
2813
+ - [1815213] Improved image support for GIF, JPEG, PNG formats.
2814
+ - [1800094] Attribute "value" was added to ordered list items <li>.
2815
+ - Image function now has a new "align" parameter that indicates the alignment of the pointer next to image insertion and relative to image height. The value can be:
2816
+ T: top-right for LTR or top-left for RTL
2817
+ M: middle-right for LTR or middle-left for RTL
2818
+ B: bottom-right for LTR or bottom-left for RTL
2819
+ N: next line
2820
+ - Attribute "align" was added to <img> html tag to set the above image "align" parameter. Possible values are:
2821
+ top: top-right for LTR or top-left for RTL
2822
+ middle: middle-right for LTR or middle-left for RTL
2823
+ bottom: bottom-right for LTR or bottom-left for RTL
2824
+ - [1798103] newline was added after </ul>, </ol> and </p> tages.
2825
+ - [1816393] Documentation was updated.
2826
+ - 'ln' parameter was fixed on writeHTMLCell. Now it's possible to print two or more columns across several pages;
2827
+ - The method lastPage() was added to move the pointer on the last page;
2828
+
2829
+ ------------------------------------------------------------
2830
+
2831
+ 1.53.0.TC034 (2007-07-30)
2832
+ - fixed htmlentities conversion.
2833
+ - MultiCell() function returns the number of cells.
2834
+
2835
+ 1.53.0.TC033 (2007-07-30)
2836
+ - fixed bug 1762550: case sensitive for font files
2837
+ - NOTE: all fonts files names must be in lowercase!
2838
+
2839
+ 1.53.0.TC032 (2007-07-27)
2840
+ - setLastH method was added to resolve bug 1689071.
2841
+ - all fonts names were converted in lowercase (bug 1713005).
2842
+ - bug 1740954 was fixed.
2843
+ - justification was added as Cell option.
2844
+
2845
+ 1.53.0.TC031 (2007-03-20)
2846
+ - ToUnicode CMap were added on _puttruetypeunicode function. Now you may search and copy unicode text.
2847
+
2848
+ 1.53.0.TC030 (2007-03-06)
2849
+ - fixed bug on PHP4 version.
2850
+
2851
+ 1.53.0.TC029 (2007-03-06)
2852
+ - DejaVu Fonts were added.
2853
+
2854
+ 1.53.0.TC028 (2007-03-03)
2855
+ - MultiCell function signature were changed: the $ln parameter were added. Check documentation for further information.
2856
+ - Greek language were added on example sentences.
2857
+ - setPrintHeader() and setPrintFooter() functions were added to enable or disable page header and footer.
2858
+
2859
+ 1.53.0.TC027 (2006-12-14)
2860
+ - $attr['face'] bug were fixed.
2861
+ - K_TCPDF_EXTERNAL_CONFIG control where introduced on /config/tcpdf_config.php to use external configuration files.
2862
+
2863
+ 1.53.0.TC026 (2006-10-28)
2864
+ - writeHTML function call were fixed on examples.
2865
+
2866
+ 1.53.0.TC025 (2006-10-27)
2867
+ - Bugs item #1421290 were fixed (0D - 0A substitution in some characters)
2868
+ - Bugs item #1573174 were fixed (MultiCell documentation)
2869
+
2870
+ 1.53.0.TC024 (2006-09-26)
2871
+ - getPageHeight() function were fixed (bug 1543476).
2872
+ - fixed missing breaks on closedHTMLTagHandler function (bug 1535263).
2873
+ - fixed extra spaces on Write function (bug 1535262).
2874
+
2875
+ 1.53.0.TC023 (2006-08-04)
2876
+ - paths to barcode directory were fixed.
2877
+ - documentation were updated.
2878
+
2879
+ 1.53.0.TC022 (2006-07-16)
2880
+ - fixed bug: [ 1516858 ] Probs with PHP autoloader and class_exists()
2881
+
2882
+ 1.53.0.TC021 (2006-07-01)
2883
+ - HTML attributes with whitespaces are now supported (thanks to Nelson Benitez for his support)
2884
+
2885
+ 1.53.0.TC020 (2006-06-23)
2886
+ - code cleanup
2887
+
2888
+ 1.53.0.TC019 (2006-05-21)
2889
+ - fixed <strong> and <em> closing tags
2890
+
2891
+ 1.53.0.TC018 (2006-05-18)
2892
+ - fixed font names bug
2893
+
2894
+ 1.53.0.TC017 (2006-05-18)
2895
+ - the TTF2UFM utility to convert True Type fonts for TCPDF were included on fonts folder.
2896
+ - new free unicode fonts were included on /fonts/freefont.
2897
+ - test_unicode.php example were exended.
2898
+ - parameter $fill were added on Write, writeHTML and writeHTMLCell functions.
2899
+ - documentation were updated.
2900
+
2901
+ 1.53.0.TC016 (2006-03-09)
2902
+ - fixed closing <strong> tag on html parser.
2903
+
2904
+ 1.53.0.TC016 (2005-08-28)
2905
+ - fpdf.php and tcpdf.php files were joined in one single class (you can still extend TCPDF with your own class).
2906
+ - fixed problem when mb_internal_encoding is set.
2907
+
2908
+ 1.53.0.TC014 (2005-05-29)
2909
+ - fixed WriteHTMLCell new page issue.
2910
+
2911
+ 1.53.0.TC013 (2005-05-29)
2912
+ - fixed WriteHTMLCell across pages.
2913
+
2914
+ 1.53.0.TC012 (2005-05-29)
2915
+ - font color attribute bug were fixed.
2916
+
2917
+ 1.53.0.TC011 (2005-03-31)
2918
+ - SetFont function were fixed (thank Sjaak Lauwers for bug notice).
2919
+
2920
+ 1.53.0.TC010 (2005-03-22)
2921
+ - the html functions were improved (thanks to Manfred Vervuert for bug reporting).
2922
+
2923
+ 1.53.0.TC009 (2005-03-19)
2924
+ - a wrong reference to convertColorHexToDec were fixed.
2925
+
2926
+ 1.53.0.TC008 (2005-02-07)
2927
+ - removed some extra bytes from PHP files.
2928
+
2929
+ 1.53.0.TC007 (2005-01-08)
2930
+ - fill attribute were removed from writeHTMLCell method.
2931
+
2932
+ 1.53.0.TC006 (2005-01-08)
2933
+ - the documentation were updated.
2934
+
2935
+ 1.53.0.TC005 (2005-01-05)
2936
+ - Steven Wittens's unicode methods were removed.
2937
+ - All unicode methods were rewritten from scratch.
2938
+ - TCPDF is now licensed as LGPL.
2939
+
2940
+ 1.53.0.TC004 (2005-01-04)
2941
+ - this changelog were added.
2942
+ - removed commercial fonts for licensing issue.
2943
+ - Bitstream Vera Fonts were added (http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html).
2944
+ - Now the AddFont and SetFont functions returns the basic font if the styled version do not exist.
2945
+
2946
+ EOF --------------------------------------------------------
includes/lib/{tcpdf_min → tcpdf}/LICENSE.TXT RENAMED
@@ -1,858 +1,858 @@
1
- **********************************************************************
2
- * TCPDF LICENSE
3
- **********************************************************************
4
-
5
- TCPDF is free software: you can redistribute it and/or modify it
6
- under the terms of the GNU Lesser General Public License as
7
- published by the Free Software Foundation, either version 3 of the
8
- License, or (at your option) any later version.
9
-
10
- **********************************************************************
11
- **********************************************************************
12
-
13
- GNU LESSER GENERAL PUBLIC LICENSE
14
- Version 3, 29 June 2007
15
-
16
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
17
- Everyone is permitted to copy and distribute verbatim copies
18
- of this license document, but changing it is not allowed.
19
-
20
-
21
- This version of the GNU Lesser General Public License incorporates
22
- the terms and conditions of version 3 of the GNU General Public
23
- License, supplemented by the additional permissions listed below.
24
-
25
- 0. Additional Definitions.
26
-
27
- As used herein, "this License" refers to version 3 of the GNU Lesser
28
- General Public License, and the "GNU GPL" refers to version 3 of the GNU
29
- General Public License.
30
-
31
- "The Library" refers to a covered work governed by this License,
32
- other than an Application or a Combined Work as defined below.
33
-
34
- An "Application" is any work that makes use of an interface provided
35
- by the Library, but which is not otherwise based on the Library.
36
- Defining a subclass of a class defined by the Library is deemed a mode
37
- of using an interface provided by the Library.
38
-
39
- A "Combined Work" is a work produced by combining or linking an
40
- Application with the Library. The particular version of the Library
41
- with which the Combined Work was made is also called the "Linked
42
- Version".
43
-
44
- The "Minimal Corresponding Source" for a Combined Work means the
45
- Corresponding Source for the Combined Work, excluding any source code
46
- for portions of the Combined Work that, considered in isolation, are
47
- based on the Application, and not on the Linked Version.
48
-
49
- The "Corresponding Application Code" for a Combined Work means the
50
- object code and/or source code for the Application, including any data
51
- and utility programs needed for reproducing the Combined Work from the
52
- Application, but excluding the System Libraries of the Combined Work.
53
-
54
- 1. Exception to Section 3 of the GNU GPL.
55
-
56
- You may convey a covered work under sections 3 and 4 of this License
57
- without being bound by section 3 of the GNU GPL.
58
-
59
- 2. Conveying Modified Versions.
60
-
61
- If you modify a copy of the Library, and, in your modifications, a
62
- facility refers to a function or data to be supplied by an Application
63
- that uses the facility (other than as an argument passed when the
64
- facility is invoked), then you may convey a copy of the modified
65
- version:
66
-
67
- a) under this License, provided that you make a good faith effort to
68
- ensure that, in the event an Application does not supply the
69
- function or data, the facility still operates, and performs
70
- whatever part of its purpose remains meaningful, or
71
-
72
- b) under the GNU GPL, with none of the additional permissions of
73
- this License applicable to that copy.
74
-
75
- 3. Object Code Incorporating Material from Library Header Files.
76
-
77
- The object code form of an Application may incorporate material from
78
- a header file that is part of the Library. You may convey such object
79
- code under terms of your choice, provided that, if the incorporated
80
- material is not limited to numerical parameters, data structure
81
- layouts and accessors, or small macros, inline functions and templates
82
- (ten or fewer lines in length), you do both of the following:
83
-
84
- a) Give prominent notice with each copy of the object code that the
85
- Library is used in it and that the Library and its use are
86
- covered by this License.
87
-
88
- b) Accompany the object code with a copy of the GNU GPL and this license
89
- document.
90
-
91
- 4. Combined Works.
92
-
93
- You may convey a Combined Work under terms of your choice that,
94
- taken together, effectively do not restrict modification of the
95
- portions of the Library contained in the Combined Work and reverse
96
- engineering for debugging such modifications, if you also do each of
97
- the following:
98
-
99
- a) Give prominent notice with each copy of the Combined Work that
100
- the Library is used in it and that the Library and its use are
101
- covered by this License.
102
-
103
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
104
- document.
105
-
106
- c) For a Combined Work that displays copyright notices during
107
- execution, include the copyright notice for the Library among
108
- these notices, as well as a reference directing the user to the
109
- copies of the GNU GPL and this license document.
110
-
111
- d) Do one of the following:
112
-
113
- 0) Convey the Minimal Corresponding Source under the terms of this
114
- License, and the Corresponding Application Code in a form
115
- suitable for, and under terms that permit, the user to
116
- recombine or relink the Application with a modified version of
117
- the Linked Version to produce a modified Combined Work, in the
118
- manner specified by section 6 of the GNU GPL for conveying
119
- Corresponding Source.
120
-
121
- 1) Use a suitable shared library mechanism for linking with the
122
- Library. A suitable mechanism is one that (a) uses at run time
123
- a copy of the Library already present on the user's computer
124
- system, and (b) will operate properly with a modified version
125
- of the Library that is interface-compatible with the Linked
126
- Version.
127
-
128
- e) Provide Installation Information, but only if you would otherwise
129
- be required to provide such information under section 6 of the
130
- GNU GPL, and only to the extent that such information is
131
- necessary to install and execute a modified version of the
132
- Combined Work produced by recombining or relinking the
133
- Application with a modified version of the Linked Version. (If
134
- you use option 4d0, the Installation Information must accompany
135
- the Minimal Corresponding Source and Corresponding Application
136
- Code. If you use option 4d1, you must provide the Installation
137
- Information in the manner specified by section 6 of the GNU GPL
138
- for conveying Corresponding Source.)
139
-
140
- 5. Combined Libraries.
141
-
142
- You may place library facilities that are a work based on the
143
- Library side by side in a single library together with other library
144
- facilities that are not Applications and are not covered by this
145
- License, and convey such a combined library under terms of your
146
- choice, if you do both of the following:
147
-
148
- a) Accompany the combined library with a copy of the same work based
149
- on the Library, uncombined with any other library facilities,
150
- conveyed under the terms of this License.
151
-
152
- b) Give prominent notice with the combined library that part of it
153
- is a work based on the Library, and explaining where to find the
154
- accompanying uncombined form of the same work.
155
-
156
- 6. Revised Versions of the GNU Lesser General Public License.
157
-
158
- The Free Software Foundation may publish revised and/or new versions
159
- of the GNU Lesser General Public License from time to time. Such new
160
- versions will be similar in spirit to the present version, but may
161
- differ in detail to address new problems or concerns.
162
-
163
- Each version is given a distinguishing version number. If the
164
- Library as you received it specifies that a certain numbered version
165
- of the GNU Lesser General Public License "or any later version"
166
- applies to it, you have the option of following the terms and
167
- conditions either of that published version or of any later version
168
- published by the Free Software Foundation. If the Library as you
169
- received it does not specify a version number of the GNU Lesser
170
- General Public License, you may choose any version of the GNU Lesser
171
- General Public License ever published by the Free Software Foundation.
172
-
173
- If the Library as you received it specifies that a proxy can decide
174
- whether future versions of the GNU Lesser General Public License shall
175
- apply, that proxy's public statement of acceptance of any version is
176
- permanent authorization for you to choose that version for the
177
- Library.
178
-
179
- **********************************************************************
180
- **********************************************************************
181
-
182
- GNU GENERAL PUBLIC LICENSE
183
- Version 3, 29 June 2007
184
-
185
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
186
- Everyone is permitted to copy and distribute verbatim copies
187
- of this license document, but changing it is not allowed.
188
-
189
- Preamble
190
-
191
- The GNU General Public License is a free, copyleft license for
192
- software and other kinds of works.
193
-
194
- The licenses for most software and other practical works are designed
195
- to take away your freedom to share and change the works. By contrast,
196
- the GNU General Public License is intended to guarantee your freedom to
197
- share and change all versions of a program--to make sure it remains free
198
- software for all its users. We, the Free Software Foundation, use the
199
- GNU General Public License for most of our software; it applies also to
200
- any other work released this way by its authors. You can apply it to
201
- your programs, too.
202
-
203
- When we speak of free software, we are referring to freedom, not
204
- price. Our General Public Licenses are designed to make sure that you
205
- have the freedom to distribute copies of free software (and charge for
206
- them if you wish), that you receive source code or can get it if you
207
- want it, that you can change the software or use pieces of it in new
208
- free programs, and that you know you can do these things.
209
-
210
- To protect your rights, we need to prevent others from denying you
211
- these rights or asking you to surrender the rights. Therefore, you have
212
- certain responsibilities if you distribute copies of the software, or if
213
- you modify it: responsibilities to respect the freedom of others.
214
-
215
- For example, if you distribute copies of such a program, whether
216
- gratis or for a fee, you must pass on to the recipients the same
217
- freedoms that you received. You must make sure that they, too, receive
218
- or can get the source code. And you must show them these terms so they
219
- know their rights.
220
-
221
- Developers that use the GNU GPL protect your rights with two steps:
222
- (1) assert copyright on the software, and (2) offer you this License
223
- giving you legal permission to copy, distribute and/or modify it.
224
-
225
- For the developers' and authors' protection, the GPL clearly explains
226
- that there is no warranty for this free software. For both users' and
227
- authors' sake, the GPL requires that modified versions be marked as
228
- changed, so that their problems will not be attributed erroneously to
229
- authors of previous versions.
230
-
231
- Some devices are designed to deny users access to install or run
232
- modified versions of the software inside them, although the manufacturer
233
- can do so. This is fundamentally incompatible with the aim of
234
- protecting users' freedom to change the software. The systematic
235
- pattern of such abuse occurs in the area of products for individuals to
236
- use, which is precisely where it is most unacceptable. Therefore, we
237
- have designed this version of the GPL to prohibit the practice for those
238
- products. If such problems arise substantially in other domains, we
239
- stand ready to extend this provision to those domains in future versions
240
- of the GPL, as needed to protect the freedom of users.
241
-
242
- Finally, every program is threatened constantly by software patents.
243
- States should not allow patents to restrict development and use of
244
- software on general-purpose computers, but in those that do, we wish to
245
- avoid the special danger that patents applied to a free program could
246
- make it effectively proprietary. To prevent this, the GPL assures that
247
- patents cannot be used to render the program non-free.
248
-
249
- The precise terms and conditions for copying, distribution and
250
- modification follow.
251
-
252
- TERMS AND CONDITIONS
253
-
254
- 0. Definitions.
255
-
256
- "This License" refers to version 3 of the GNU General Public License.
257
-
258
- "Copyright" also means copyright-like laws that apply to other kinds of
259
- works, such as semiconductor masks.
260
-
261
- "The Program" refers to any copyrightable work licensed under this
262
- License. Each licensee is addressed as "you". "Licensees" and
263
- "recipients" may be individuals or organizations.
264
-
265
- To "modify" a work means to copy from or adapt all or part of the work
266
- in a fashion requiring copyright permission, other than the making of an
267
- exact copy. The resulting work is called a "modified version" of the
268
- earlier work or a work "based on" the earlier work.
269
-
270
- A "covered work" means either the unmodified Program or a work based
271
- on the Program.
272
-
273
- To "propagate" a work means to do anything with it that, without
274
- permission, would make you directly or secondarily liable for
275
- infringement under applicable copyright law, except executing it on a
276
- computer or modifying a private copy. Propagation includes copying,
277
- distribution (with or without modification), making available to the
278
- public, and in some countries other activities as well.
279
-
280
- To "convey" a work means any kind of propagation that enables other
281
- parties to make or receive copies. Mere interaction with a user through
282
- a computer network, with no transfer of a copy, is not conveying.
283
-
284
- An interactive user interface displays "Appropriate Legal Notices"
285
- to the extent that it includes a convenient and prominently visible
286
- feature that (1) displays an appropriate copyright notice, and (2)
287
- tells the user that there is no warranty for the work (except to the
288
- extent that warranties are provided), that licensees may convey the
289
- work under this License, and how to view a copy of this License. If
290
- the interface presents a list of user commands or options, such as a
291
- menu, a prominent item in the list meets this criterion.
292
-
293
- 1. Source Code.
294
-
295
- The "source code" for a work means the preferred form of the work
296
- for making modifications to it. "Object code" means any non-source
297
- form of a work.
298
-
299
- A "Standard Interface" means an interface that either is an official
300
- standard defined by a recognized standards body, or, in the case of
301
- interfaces specified for a particular programming language, one that
302
- is widely used among developers working in that language.
303
-
304
- The "System Libraries" of an executable work include anything, other
305
- than the work as a whole, that (a) is included in the normal form of
306
- packaging a Major Component, but which is not part of that Major
307
- Component, and (b) serves only to enable use of the work with that
308
- Major Component, or to implement a Standard Interface for which an
309
- implementation is available to the public in source code form. A
310
- "Major Component", in this context, means a major essential component
311
- (kernel, window system, and so on) of the specific operating system
312
- (if any) on which the executable work runs, or a compiler used to
313
- produce the work, or an object code interpreter used to run it.
314
-
315
- The "Corresponding Source" for a work in object code form means all
316
- the source code needed to generate, install, and (for an executable
317
- work) run the object code and to modify the work, including scripts to
318
- control those activities. However, it does not include the work's
319
- System Libraries, or general-purpose tools or generally available free
320
- programs which are used unmodified in performing those activities but
321
- which are not part of the work. For example, Corresponding Source
322
- includes interface definition files associated with source files for
323
- the work, and the source code for shared libraries and dynamically
324
- linked subprograms that the work is specifically designed to require,
325
- such as by intimate data communication or control flow between those
326
- subprograms and other parts of the work.
327
-
328
- The Corresponding Source need not include anything that users
329
- can regenerate automatically from other parts of the Corresponding
330
- Source.
331
-
332
- The Corresponding Source for a work in source code form is that
333
- same work.
334
-
335
- 2. Basic Permissions.
336
-
337
- All rights granted under this License are granted for the term of
338
- copyright on the Program, and are irrevocable provided the stated
339
- conditions are met. This License explicitly affirms your unlimited
340
- permission to run the unmodified Program. The output from running a
341
- covered work is covered by this License only if the output, given its
342
- content, constitutes a covered work. This License acknowledges your
343
- rights of fair use or other equivalent, as provided by copyright law.
344
-
345
- You may make, run and propagate covered works that you do not
346
- convey, without conditions so long as your license otherwise remains
347
- in force. You may convey covered works to others for the sole purpose
348
- of having them make modifications exclusively for you, or provide you
349
- with facilities for running those works, provided that you comply with
350
- the terms of this License in conveying all material for which you do
351
- not control copyright. Those thus making or running the covered works
352
- for you must do so exclusively on your behalf, under your direction
353
- and control, on terms that prohibit them from making any copies of
354
- your copyrighted material outside their relationship with you.
355
-
356
- Conveying under any other circumstances is permitted solely under
357
- the conditions stated below. Sublicensing is not allowed; section 10
358
- makes it unnecessary.
359
-
360
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
361
-
362
- No covered work shall be deemed part of an effective technological
363
- measure under any applicable law fulfilling obligations under article
364
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
365
- similar laws prohibiting or restricting circumvention of such
366
- measures.
367
-
368
- When you convey a covered work, you waive any legal power to forbid
369
- circumvention of technological measures to the extent such circumvention
370
- is effected by exercising rights under this License with respect to
371
- the covered work, and you disclaim any intention to limit operation or
372
- modification of the work as a means of enforcing, against the work's
373
- users, your or third parties' legal rights to forbid circumvention of
374
- technological measures.
375
-
376
- 4. Conveying Verbatim Copies.
377
-
378
- You may convey verbatim copies of the Program's source code as you
379
- receive it, in any medium, provided that you conspicuously and
380
- appropriately publish on each copy an appropriate copyright notice;
381
- keep intact all notices stating that this License and any
382
- non-permissive terms added in accord with section 7 apply to the code;
383
- keep intact all notices of the absence of any warranty; and give all
384
- recipients a copy of this License along with the Program.
385
-
386
- You may charge any price or no price for each copy that you convey,
387
- and you may offer support or warranty protection for a fee.
388
-
389
- 5. Conveying Modified Source Versions.
390
-
391
- You may convey a work based on the Program, or the modifications to
392
- produce it from the Program, in the form of source code under the
393
- terms of section 4, provided that you also meet all of these conditions:
394
-
395
- a) The work must carry prominent notices stating that you modified
396
- it, and giving a relevant date.
397
-
398
- b) The work must carry prominent notices stating that it is
399
- released under this License and any conditions added under section
400
- 7. This requirement modifies the requirement in section 4 to
401
- "keep intact all notices".
402
-
403
- c) You must license the entire work, as a whole, under this
404
- License to anyone who comes into possession of a copy. This
405
- License will therefore apply, along with any applicable section 7
406
- additional terms, to the whole of the work, and all its parts,
407
- regardless of how they are packaged. This License gives no
408
- permission to license the work in any other way, but it does not
409
- invalidate such permission if you have separately received it.
410
-
411
- d) If the work has interactive user interfaces, each must display
412
- Appropriate Legal Notices; however, if the Program has interactive
413
- interfaces that do not display Appropriate Legal Notices, your
414
- work need not make them do so.
415
-
416
- A compilation of a covered work with other separate and independent
417
- works, which are not by their nature extensions of the covered work,
418
- and which are not combined with it such as to form a larger program,
419
- in or on a volume of a storage or distribution medium, is called an
420
- "aggregate" if the compilation and its resulting copyright are not
421
- used to limit the access or legal rights of the compilation's users
422
- beyond what the individual works permit. Inclusion of a covered work
423
- in an aggregate does not cause this License to apply to the other
424
- parts of the aggregate.
425
-
426
- 6. Conveying Non-Source Forms.
427
-
428
- You may convey a covered work in object code form under the terms
429
- of sections 4 and 5, provided that you also convey the
430
- machine-readable Corresponding Source under the terms of this License,
431
- in one of these ways:
432
-
433
- a) Convey the object code in, or embodied in, a physical product
434
- (including a physical distribution medium), accompanied by the
435
- Corresponding Source fixed on a durable physical medium
436
- customarily used for software interchange.
437
-
438
- b) Convey the object code in, or embodied in, a physical product
439
- (including a physical distribution medium), accompanied by a
440
- written offer, valid for at least three years and valid for as
441
- long as you offer spare parts or customer support for that product
442
- model, to give anyone who possesses the object code either (1) a
443
- copy of the Corresponding Source for all the software in the
444
- product that is covered by this License, on a durable physical
445
- medium customarily used for software interchange, for a price no
446
- more than your reasonable cost of physically performing this
447
- conveying of source, or (2) access to copy the
448
- Corresponding Source from a network server at no charge.
449
-
450
- c) Convey individual copies of the object code with a copy of the
451
- written offer to provide the Corresponding Source. This
452
- alternative is allowed only occasionally and noncommercially, and
453
- only if you received the object code with such an offer, in accord
454
- with subsection 6b.
455
-
456
- d) Convey the object code by offering access from a designated
457
- place (gratis or for a charge), and offer equivalent access to the
458
- Corresponding Source in the same way through the same place at no
459
- further charge. You need not require recipients to copy the
460
- Corresponding Source along with the object code. If the place to
461
- copy the object code is a network server, the Corresponding Source
462
- may be on a different server (operated by you or a third party)
463
- that supports equivalent copying facilities, provided you maintain
464
- clear directions next to the object code saying where to find the
465
- Corresponding Source. Regardless of what server hosts the
466
- Corresponding Source, you remain obligated to ensure that it is
467
- available for as long as needed to satisfy these requirements.
468
-
469
- e) Convey the object code using peer-to-peer transmission, provided
470
- you inform other peers where the object code and Corresponding
471
- Source of the work are being offered to the general public at no
472
- charge under subsection 6d.
473
-
474
- A separable portion of the object code, whose source code is excluded
475
- from the Corresponding Source as a System Library, need not be
476
- included in conveying the object code work.
477
-
478
- A "User Product" is either (1) a "consumer product", which means any
479
- tangible personal property which is normally used for personal, family,
480
- or household purposes, or (2) anything designed or sold for incorporation
481
- into a dwelling. In determining whether a product is a consumer product,
482
- doubtful cases shall be resolved in favor of coverage. For a particular
483
- product received by a particular user, "normally used" refers to a
484
- typical or common use of that class of product, regardless of the status
485
- of the particular user or of the way in which the particular user
486
- actually uses, or expects or is expected to use, the product. A product
487
- is a consumer product regardless of whether the product has substantial
488
- commercial, industrial or non-consumer uses, unless such uses represent
489
- the only significant mode of use of the product.
490
-
491
- "Installation Information" for a User Product means any methods,
492
- procedures, authorization keys, or other information required to install
493
- and execute modified versions of a covered work in that User Product from
494
- a modified version of its Corresponding Source. The information must
495
- suffice to ensure that the continued functioning of the modified object
496
- code is in no case prevented or interfered with solely because
497
- modification has been made.
498
-
499
- If you convey an object code work under this section in, or with, or
500
- specifically for use in, a User Product, and the conveying occurs as
501
- part of a transaction in which the right of possession and use of the
502
- User Product is transferred to the recipient in perpetuity or for a
503
- fixed term (regardless of how the transaction is characterized), the
504
- Corresponding Source conveyed under this section must be accompanied
505
- by the Installation Information. But this requirement does not apply
506
- if neither you nor any third party retains the ability to install
507
- modified object code on the User Product (for example, the work has
508
- been installed in ROM).
509
-
510
- The requirement to provide Installation Information does not include a
511
- requirement to continue to provide support service, warranty, or updates
512
- for a work that has been modified or installed by the recipient, or for
513
- the User Product in which it has been modified or installed. Access to a
514
- network may be denied when the modification itself materially and
515
- adversely affects the operation of the network or violates the rules and
516
- protocols for communication across the network.
517
-
518
- Corresponding Source conveyed, and Installation Information provided,
519
- in accord with this section must be in a format that is publicly
520
- documented (and with an implementation available to the public in
521
- source code form), and must require no special password or key for
522
- unpacking, reading or copying.
523
-
524
- 7. Additional Terms.
525
-
526
- "Additional permissions" are terms that supplement the terms of this
527
- License by making exceptions from one or more of its conditions.
528
- Additional permissions that are applicable to the entire Program shall
529
- be treated as though they were included in this License, to the extent
530
- that they are valid under applicable law. If additional permissions
531
- apply only to part of the Program, that part may be used separately
532
- under those permissions, but the entire Program remains governed by
533
- this License without regard to the additional permissions.
534
-
535
- When you convey a copy of a covered work, you may at your option
536
- remove any additional permissions from that copy, or from any part of
537
- it. (Additional permissions may be written to require their own
538
- removal in certain cases when you modify the work.) You may place
539
- additional permissions on material, added by you to a covered work,
540
- for which you have or can give appropriate copyright permission.
541
-
542
- Notwithstanding any other provision of this License, for material you
543
- add to a covered work, you may (if authorized by the copyright holders of
544
- that material) supplement the terms of this License with terms:
545
-
546
- a) Disclaiming warranty or limiting liability differently from the
547
- terms of sections 15 and 16 of this License; or
548
-
549
- b) Requiring preservation of specified reasonable legal notices or
550
- author attributions in that material or in the Appropriate Legal
551
- Notices displayed by works containing it; or
552
-
553
- c) Prohibiting misrepresentation of the origin of that material, or
554
- requiring that modified versions of such material be marked in
555
- reasonable ways as different from the original version; or
556
-
557
- d) Limiting the use for publicity purposes of names of licensors or
558
- authors of the material; or
559
-
560
- e) Declining to grant rights under trademark law for use of some
561
- trade names, trademarks, or service marks; or
562
-
563
- f) Requiring indemnification of licensors and authors of that
564
- material by anyone who conveys the material (or modified versions of
565
- it) with contractual assumptions of liability to the recipient, for
566
- any liability that these contractual assumptions directly impose on
567
- those licensors and authors.
568
-
569
- All other non-permissive additional terms are considered "further
570
- restrictions" within the meaning of section 10. If the Program as you
571
- received it, or any part of it, contains a notice stating that it is
572
- governed by this License along with a term that is a further
573
- restriction, you may remove that term. If a license document contains
574
- a further restriction but permits relicensing or conveying under this
575
- License, you may add to a covered work material governed by the terms
576
- of that license document, provided that the further restriction does
577
- not survive such relicensing or conveying.
578
-
579
- If you add terms to a covered work in accord with this section, you
580
- must place, in the relevant source files, a statement of the
581
- additional terms that apply to those files, or a notice indicating
582
- where to find the applicable terms.
583
-
584
- Additional terms, permissive or non-permissive, may be stated in the
585
- form of a separately written license, or stated as exceptions;
586
- the above requirements apply either way.
587
-
588
- 8. Termination.
589
-
590
- You may not propagate or modify a covered work except as expressly
591
- provided under this License. Any attempt otherwise to propagate or
592
- modify it is void, and will automatically terminate your rights under
593
- this License (including any patent licenses granted under the third
594
- paragraph of section 11).
595
-
596
- However, if you cease all violation of this License, then your
597
- license from a particular copyright holder is reinstated (a)
598
- provisionally, unless and until the copyright holder explicitly and
599
- finally terminates your license, and (b) permanently, if the copyright
600
- holder fails to notify you of the violation by some reasonable means
601
- prior to 60 days after the cessation.
602
-
603
- Moreover, your license from a particular copyright holder is
604
- reinstated permanently if the copyright holder notifies you of the
605
- violation by some reasonable means, this is the first time you have
606
- received notice of violation of this License (for any work) from that
607
- copyright holder, and you cure the violation prior to 30 days after
608
- your receipt of the notice.
609
-
610
- Termination of your rights under this section does not terminate the
611
- licenses of parties who have received copies or rights from you under
612
- this License. If your rights have been terminated and not permanently
613
- reinstated, you do not qualify to receive new licenses for the same
614
- material under section 10.
615
-
616
- 9. Acceptance Not Required for Having Copies.
617
-
618
- You are not required to accept this License in order to receive or
619
- run a copy of the Program. Ancillary propagation of a covered work
620
- occurring solely as a consequence of using peer-to-peer transmission
621
- to receive a copy likewise does not require acceptance. However,
622
- nothing other than this License grants you permission to propagate or
623
- modify any covered work. These actions infringe copyright if you do
624
- not accept this License. Therefore, by modifying or propagating a
625
- covered work, you indicate your acceptance of this License to do so.
626
-
627
- 10. Automatic Licensing of Downstream Recipients.
628
-
629
- Each time you convey a covered work, the recipient automatically
630
- receives a license from the original licensors, to run, modify and
631
- propagate that work, subject to this License. You are not responsible
632
- for enforcing compliance by third parties with this License.
633
-
634
- An "entity transaction" is a transaction transferring control of an
635
- organization, or substantially all assets of one, or subdividing an
636
- organization, or merging organizations. If propagation of a covered
637
- work results from an entity transaction, each party to that
638
- transaction who receives a copy of the work also receives whatever
639
- licenses to the work the party's predecessor in interest had or could
640
- give under the previous paragraph, plus a right to possession of the
641
- Corresponding Source of the work from the predecessor in interest, if
642
- the predecessor has it or can get it with reasonable efforts.
643
-
644
- You may not impose any further restrictions on the exercise of the
645
- rights granted or affirmed under this License. For example, you may
646
- not impose a license fee, royalty, or other charge for exercise of
647
- rights granted under this License, and you may not initiate litigation
648
- (including a cross-claim or counterclaim in a lawsuit) alleging that
649
- any patent claim is infringed by making, using, selling, offering for
650
- sale, or importing the Program or any portion of it.
651
-
652
- 11. Patents.
653
-
654
- A "contributor" is a copyright holder who authorizes use under this
655
- License of the Program or a work on which the Program is based. The
656
- work thus licensed is called the contributor's "contributor version".
657
-
658
- A contributor's "essential patent claims" are all patent claims
659
- owned or controlled by the contributor, whether already acquired or
660
- hereafter acquired, that would be infringed by some manner, permitted
661
- by this License, of making, using, or selling its contributor version,
662
- but do not include claims that would be infringed only as a
663
- consequence of further modification of the contributor version. For
664
- purposes of this definition, "control" includes the right to grant
665
- patent sublicenses in a manner consistent with the requirements of
666
- this License.
667
-
668
- Each contributor grants you a non-exclusive, worldwide, royalty-free
669
- patent license under the contributor's essential patent claims, to
670
- make, use, sell, offer for sale, import and otherwise run, modify and
671
- propagate the contents of its contributor version.
672
-
673
- In the following three paragraphs, a "patent license" is any express
674
- agreement or commitment, however denominated, not to enforce a patent
675
- (such as an express permission to practice a patent or covenant not to
676
- sue for patent infringement). To "grant" such a patent license to a
677
- party means to make such an agreement or commitment not to enforce a
678
- patent against the party.
679
-
680
- If you convey a covered work, knowingly relying on a patent license,
681
- and the Corresponding Source of the work is not available for anyone
682
- to copy, free of charge and under the terms of this License, through a
683
- publicly available network server or other readily accessible means,
684
- then you must either (1) cause the Corresponding Source to be so
685
- available, or (2) arrange to deprive yourself of the benefit of the
686
- patent license for this particular work, or (3) arrange, in a manner
687
- consistent with the requirements of this License, to extend the patent
688
- license to downstream recipients. "Knowingly relying" means you have
689
- actual knowledge that, but for the patent license, your conveying the
690
- covered work in a country, or your recipient's use of the covered work
691
- in a country, would infringe one or more identifiable patents in that
692
- country that you have reason to believe are valid.
693
-
694
- If, pursuant to or in connection with a single transaction or
695
- arrangement, you convey, or propagate by procuring conveyance of, a
696
- covered work, and grant a patent license to some of the parties
697
- receiving the covered work authorizing them to use, propagate, modify
698
- or convey a specific copy of the covered work, then the patent license
699
- you grant is automatically extended to all recipients of the covered
700
- work and works based on it.
701
-
702
- A patent license is "discriminatory" if it does not include within
703
- the scope of its coverage, prohibits the exercise of, or is
704
- conditioned on the non-exercise of one or more of the rights that are
705
- specifically granted under this License. You may not convey a covered
706
- work if you are a party to an arrangement with a third party that is
707
- in the business of distributing software, under which you make payment
708
- to the third party based on the extent of your activity of conveying
709
- the work, and under which the third party grants, to any of the
710
- parties who would receive the covered work from you, a discriminatory
711
- patent license (a) in connection with copies of the covered work
712
- conveyed by you (or copies made from those copies), or (b) primarily
713
- for and in connection with specific products or compilations that
714
- contain the covered work, unless you entered into that arrangement,
715
- or that patent license was granted, prior to 28 March 2007.
716
-
717
- Nothing in this License shall be construed as excluding or limiting
718
- any implied license or other defenses to infringement that may
719
- otherwise be available to you under applicable patent law.
720
-
721
- 12. No Surrender of Others' Freedom.
722
-
723
- If conditions are imposed on you (whether by court order, agreement or
724
- otherwise) that contradict the conditions of this License, they do not
725
- excuse you from the conditions of this License. If you cannot convey a
726
- covered work so as to satisfy simultaneously your obligations under this
727
- License and any other pertinent obligations, then as a consequence you may
728
- not convey it at all. For example, if you agree to terms that obligate you
729
- to collect a royalty for further conveying from those to whom you convey
730
- the Program, the only way you could satisfy both those terms and this
731
- License would be to refrain entirely from conveying the Program.
732
-
733
- 13. Use with the GNU Affero General Public License.
734
-
735
- Notwithstanding any other provision of this License, you have
736
- permission to link or combine any covered work with a work licensed
737
- under version 3 of the GNU Affero General Public License into a single
738
- combined work, and to convey the resulting work. The terms of this
739
- License will continue to apply to the part which is the covered work,
740
- but the special requirements of the GNU Affero General Public License,
741
- section 13, concerning interaction through a network will apply to the
742
- combination as such.
743
-
744
- 14. Revised Versions of this License.
745
-
746
- The Free Software Foundation may publish revised and/or new versions of
747
- the GNU General Public License from time to time. Such new versions will
748
- be similar in spirit to the present version, but may differ in detail to
749
- address new problems or concerns.
750
-
751
- Each version is given a distinguishing version number. If the
752
- Program specifies that a certain numbered version of the GNU General
753
- Public License "or any later version" applies to it, you have the
754
- option of following the terms and conditions either of that numbered
755
- version or of any later version published by the Free Software
756
- Foundation. If the Program does not specify a version number of the
757
- GNU General Public License, you may choose any version ever published
758
- by the Free Software Foundation.
759
-
760
- If the Program specifies that a proxy can decide which future
761
- versions of the GNU General Public License can be used, that proxy's
762
- public statement of acceptance of a version permanently authorizes you
763
- to choose that version for the Program.
764
-
765
- Later license versions may give you additional or different
766
- permissions. However, no additional obligations are imposed on any
767
- author or copyright holder as a result of your choosing to follow a
768
- later version.
769
-
770
- 15. Disclaimer of Warranty.
771
-
772
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
773
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
774
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
775
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
776
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
777
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
778
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
779
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
780
-
781
- 16. Limitation of Liability.
782
-
783
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
784
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
785
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
786
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
787
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
788
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
789
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
790
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
791
- SUCH DAMAGES.
792
-
793
- 17. Interpretation of Sections 15 and 16.
794
-
795
- If the disclaimer of warranty and limitation of liability provided
796
- above cannot be given local legal effect according to their terms,
797
- reviewing courts shall apply local law that most closely approximates
798
- an absolute waiver of all civil liability in connection with the
799
- Program, unless a warranty or assumption of liability accompanies a
800
- copy of the Program in return for a fee.
801
-
802
- END OF TERMS AND CONDITIONS
803
-
804
- How to Apply These Terms to Your New Programs
805
-
806
- If you develop a new program, and you want it to be of the greatest
807
- possible use to the public, the best way to achieve this is to make it
808
- free software which everyone can redistribute and change under these terms.
809
-
810
- To do so, attach the following notices to the program. It is safest
811
- to attach them to the start of each source file to most effectively
812
- state the exclusion of warranty; and each file should have at least
813
- the "copyright" line and a pointer to where the full notice is found.
814
-
815
- <one line to give the program's name and a brief idea of what it does.>
816
- Copyright (C) <year> <name of author>
817
-
818
- This program is free software: you can redistribute it and/or modify
819
- it under the terms of the GNU General Public License as published by
820
- the Free Software Foundation, either version 3 of the License, or
821
- (at your option) any later version.
822
-
823
- This program is distributed in the hope that it will be useful,
824
- but WITHOUT ANY WARRANTY; without even the implied warranty of
825
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
826
- GNU General Public License for more details.
827
-
828
- You should have received a copy of the GNU General Public License
829
- along with this program. If not, see <http://www.gnu.org/licenses/>.
830
-
831
- Also add information on how to contact you by electronic and paper mail.
832
-
833
- If the program does terminal interaction, make it output a short
834
- notice like this when it starts in an interactive mode:
835
-
836
- <program> Copyright (C) <year> <name of author>
837
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
838
- This is free software, and you are welcome to redistribute it
839
- under certain conditions; type `show c' for details.
840
-
841
- The hypothetical commands `show w' and `show c' should show the appropriate
842
- parts of the General Public License. Of course, your program's commands
843
- might be different; for a GUI interface, you would use an "about box".
844
-
845
- You should also get your employer (if you work as a programmer) or school,
846
- if any, to sign a "copyright disclaimer" for the program, if necessary.
847
- For more information on this, and how to apply and follow the GNU GPL, see
848
- <http://www.gnu.org/licenses/>.
849
-
850
- The GNU General Public License does not permit incorporating your program
851
- into proprietary programs. If your program is a subroutine library, you
852
- may consider it more useful to permit linking proprietary applications with
853
- the library. If this is what you want to do, use the GNU Lesser General
854
- Public License instead of this License. But first, please read
855
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
856
-
857
- **********************************************************************
858
- **********************************************************************
1
+ **********************************************************************
2
+ * TCPDF LICENSE
3
+ **********************************************************************
4
+
5
+ TCPDF is free software: you can redistribute it and/or modify it
6
+ under the terms of the GNU Lesser General Public License as
7
+ published by the Free Software Foundation, either version 3 of the
8
+ License, or (at your option) any later version.
9
+
10
+ **********************************************************************
11
+ **********************************************************************
12
+
13
+ GNU LESSER GENERAL PUBLIC LICENSE
14
+ Version 3, 29 June 2007
15
+
16
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
17
+ Everyone is permitted to copy and distribute verbatim copies
18
+ of this license document, but changing it is not allowed.
19
+
20
+
21
+ This version of the GNU Lesser General Public License incorporates
22
+ the terms and conditions of version 3 of the GNU General Public
23
+ License, supplemented by the additional permissions listed below.
24
+
25
+ 0. Additional Definitions.
26
+
27
+ As used herein, "this License" refers to version 3 of the GNU Lesser
28
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
29
+ General Public License.
30
+
31
+ "The Library" refers to a covered work governed by this License,
32
+ other than an Application or a Combined Work as defined below.
33
+
34
+ An "Application" is any work that makes use of an interface provided
35
+ by the Library, but which is not otherwise based on the Library.
36
+ Defining a subclass of a class defined by the Library is deemed a mode
37
+ of using an interface provided by the Library.
38
+
39
+ A "Combined Work" is a work produced by combining or linking an
40
+ Application with the Library. The particular version of the Library
41
+ with which the Combined Work was made is also called the "Linked
42
+ Version".
43
+
44
+ The "Minimal Corresponding Source" for a Combined Work means the
45
+ Corresponding Source for the Combined Work, excluding any source code
46
+ for portions of the Combined Work that, considered in isolation, are
47
+ based on the Application, and not on the Linked Version.
48
+
49
+ The "Corresponding Application Code" for a Combined Work means the
50
+ object code and/or source code for the Application, including any data
51
+ and utility programs needed for reproducing the Combined Work from the
52
+ Application, but excluding the System Libraries of the Combined Work.
53
+
54
+ 1. Exception to Section 3 of the GNU GPL.
55
+
56
+ You may convey a covered work under sections 3 and 4 of this License
57
+ without being bound by section 3 of the GNU GPL.
58
+
59
+ 2. Conveying Modified Versions.
60
+
61
+ If you modify a copy of the Library, and, in your modifications, a
62
+ facility refers to a function or data to be supplied by an Application
63
+ that uses the facility (other than as an argument passed when the
64
+ facility is invoked), then you may convey a copy of the modified
65
+ version:
66
+
67
+ a) under this License, provided that you make a good faith effort to
68
+ ensure that, in the event an Application does not supply the
69
+ function or data, the facility still operates, and performs
70
+ whatever part of its purpose remains meaningful, or
71
+
72
+ b) under the GNU GPL, with none of the additional permissions of
73
+ this License applicable to that copy.
74
+
75
+ 3. Object Code Incorporating Material from Library Header Files.
76
+
77
+ The object code form of an Application may incorporate material from
78
+ a header file that is part of the Library. You may convey such object
79
+ code under terms of your choice, provided that, if the incorporated
80
+ material is not limited to numerical parameters, data structure
81
+ layouts and accessors, or small macros, inline functions and templates
82
+ (ten or fewer lines in length), you do both of the following:
83
+
84
+ a) Give prominent notice with each copy of the object code that the
85
+ Library is used in it and that the Library and its use are
86
+ covered by this License.
87
+
88
+ b) Accompany the object code with a copy of the GNU GPL and this license
89
+ document.
90
+
91
+ 4. Combined Works.
92
+
93
+ You may convey a Combined Work under terms of your choice that,
94
+ taken together, effectively do not restrict modification of the
95
+ portions of the Library contained in the Combined Work and reverse
96
+ engineering for debugging such modifications, if you also do each of
97
+ the following:
98
+
99
+ a) Give prominent notice with each copy of the Combined Work that
100
+ the Library is used in it and that the Library and its use are
101
+ covered by this License.
102
+
103
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
104
+ document.
105
+
106
+ c) For a Combined Work that displays copyright notices during
107
+ execution, include the copyright notice for the Library among
108
+ these notices, as well as a reference directing the user to the
109
+ copies of the GNU GPL and this license document.
110
+
111
+ d) Do one of the following:
112
+
113
+ 0) Convey the Minimal Corresponding Source under the terms of this
114
+ License, and the Corresponding Application Code in a form
115
+ suitable for, and under terms that permit, the user to
116
+ recombine or relink the Application with a modified version of
117
+ the Linked Version to produce a modified Combined Work, in the
118
+ manner specified by section 6 of the GNU GPL for conveying
119
+ Corresponding Source.
120
+
121
+ 1) Use a suitable shared library mechanism for linking with the
122
+ Library. A suitable mechanism is one that (a) uses at run time
123
+ a copy of the Library already present on the user's computer
124
+ system, and (b) will operate properly with a modified version
125
+ of the Library that is interface-compatible with the Linked
126
+ Version.
127
+
128
+ e) Provide Installation Information, but only if you would otherwise
129
+ be required to provide such information under section 6 of the
130
+ GNU GPL, and only to the extent that such information is
131
+ necessary to install and execute a modified version of the
132
+ Combined Work produced by recombining or relinking the
133
+ Application with a modified version of the Linked Version. (If
134
+ you use option 4d0, the Installation Information must accompany
135
+ the Minimal Corresponding Source and Corresponding Application
136
+ Code. If you use option 4d1, you must provide the Installation
137
+ Information in the manner specified by section 6 of the GNU GPL
138
+ for conveying Corresponding Source.)
139
+
140
+ 5. Combined Libraries.
141
+
142
+ You may place library facilities that are a work based on the
143
+ Library side by side in a single library together with other library
144
+ facilities that are not Applications and are not covered by this
145
+ License, and convey such a combined library under terms of your
146
+ choice, if you do both of the following:
147
+
148
+ a) Accompany the combined library with a copy of the same work based
149
+ on the Library, uncombined with any other library facilities,
150
+ conveyed under the terms of this License.
151
+
152
+ b) Give prominent notice with the combined library that part of it
153
+ is a work based on the Library, and explaining where to find the
154
+ accompanying uncombined form of the same work.
155
+
156
+ 6. Revised Versions of the GNU Lesser General Public License.
157
+
158
+ The Free Software Foundation may publish revised and/or new versions
159
+ of the GNU Lesser General Public License from time to time. Such new
160
+ versions will be similar in spirit to the present version, but may
161
+ differ in detail to address new problems or concerns.
162
+
163
+ Each version is given a distinguishing version number. If the
164
+ Library as you received it specifies that a certain numbered version
165
+ of the GNU Lesser General Public License "or any later version"
166
+ applies to it, you have the option of following the terms and
167
+ conditions either of that published version or of any later version
168
+ published by the Free Software Foundation. If the Library as you
169
+ received it does not specify a version number of the GNU Lesser
170
+ General Public License, you may choose any version of the GNU Lesser
171
+ General Public License ever published by the Free Software Foundation.
172
+
173
+ If the Library as you received it specifies that a proxy can decide
174
+ whether future versions of the GNU Lesser General Public License shall
175
+ apply, that proxy's public statement of acceptance of any version is
176
+ permanent authorization for you to choose that version for the
177
+ Library.
178
+
179
+ **********************************************************************
180
+ **********************************************************************
181
+
182
+ GNU GENERAL PUBLIC LICENSE
183
+ Version 3, 29 June 2007
184
+
185
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
186
+ Everyone is permitted to copy and distribute verbatim copies
187
+ of this license document, but changing it is not allowed.
188
+
189
+ Preamble
190
+
191
+ The GNU General Public License is a free, copyleft license for
192
+ software and other kinds of works.
193
+
194
+ The licenses for most software and other practical works are designed
195
+ to take away your freedom to share and change the works. By contrast,
196
+ the GNU General Public License is intended to guarantee your freedom to
197
+ share and change all versions of a program--to make sure it remains free
198
+ software for all its users. We, the Free Software Foundation, use the
199
+ GNU General Public License for most of our software; it applies also to
200
+ any other work released this way by its authors. You can apply it to
201
+ your programs, too.
202
+
203
+ When we speak of free software, we are referring to freedom, not
204
+ price. Our General Public Licenses are designed to make sure that you
205
+ have the freedom to distribute copies of free software (and charge for
206
+ them if you wish), that you receive source code or can get it if you
207
+ want it, that you can change the software or use pieces of it in new
208
+ free programs, and that you know you can do these things.
209
+
210
+ To protect your rights, we need to prevent others from denying you
211
+ these rights or asking you to surrender the rights. Therefore, you have
212
+ certain responsibilities if you distribute copies of the software, or if
213
+ you modify it: responsibilities to respect the freedom of others.
214
+
215
+ For example, if you distribute copies of such a program, whether
216
+ gratis or for a fee, you must pass on to the recipients the same
217
+ freedoms that you received. You must make sure that they, too, receive
218
+ or can get the source code. And you must show them these terms so they
219
+ know their rights.
220
+
221
+ Developers that use the GNU GPL protect your rights with two steps:
222
+ (1) assert copyright on the software, and (2) offer you this License
223
+ giving you legal permission to copy, distribute and/or modify it.
224
+
225
+ For the developers' and authors' protection, the GPL clearly explains
226
+ that there is no warranty for this free software. For both users' and
227
+ authors' sake, the GPL requires that modified versions be marked as
228
+ changed, so that their problems will not be attributed erroneously to
229
+ authors of previous versions.
230
+
231
+ Some devices are designed to deny users access to install or run
232
+ modified versions of the software inside them, although the manufacturer
233
+ can do so. This is fundamentally incompatible with the aim of
234
+ protecting users' freedom to change the software. The systematic
235
+ pattern of such abuse occurs in the area of products for individuals to
236
+ use, which is precisely where it is most unacceptable. Therefore, we
237
+ have designed this version of the GPL to prohibit the practice for those
238
+ products. If such problems arise substantially in other domains, we
239
+ stand ready to extend this provision to those domains in future versions
240
+ of the GPL, as needed to protect the freedom of users.
241
+
242
+ Finally, every program is threatened constantly by software patents.
243
+ States should not allow patents to restrict development and use of
244
+ software on general-purpose computers, but in those that do, we wish to
245
+ avoid the special danger that patents applied to a free program could
246
+ make it effectively proprietary. To prevent this, the GPL assures that
247
+ patents cannot be used to render the program non-free.
248
+
249
+ The precise terms and conditions for copying, distribution and
250
+ modification follow.
251
+
252
+ TERMS AND CONDITIONS
253
+
254
+ 0. Definitions.
255
+
256
+ "This License" refers to version 3 of the GNU General Public License.
257
+
258
+ "Copyright" also means copyright-like laws that apply to other kinds of
259
+ works, such as semiconductor masks.
260
+
261
+ "The Program" refers to any copyrightable work licensed under this
262
+ License. Each licensee is addressed as "you". "Licensees" and
263
+ "recipients" may be individuals or organizations.
264
+
265
+ To "modify" a work means to copy from or adapt all or part of the work
266
+ in a fashion requiring copyright permission, other than the making of an
267
+ exact copy. The resulting work is called a "modified version" of the
268
+ earlier work or a work "based on" the earlier work.
269
+
270
+ A "covered work" means either the unmodified Program or a work based
271
+ on the Program.
272
+
273
+ To "propagate" a work means to do anything with it that, without
274
+ permission, would make you directly or secondarily liable for
275
+ infringement under applicable copyright law, except executing it on a
276
+ computer or modifying a private copy. Propagation includes copying,
277
+ distribution (with or without modification), making available to the
278
+ public, and in some countries other activities as well.
279
+
280
+ To "convey" a work means any kind of propagation that enables other
281
+ parties to make or receive copies. Mere interaction with a user through
282
+ a computer network, with no transfer of a copy, is not conveying.
283
+
284
+ An interactive user interface displays "Appropriate Legal Notices"
285
+ to the extent that it includes a convenient and prominently visible
286
+ feature that (1) displays an appropriate copyright notice, and (2)
287
+ tells the user that there is no warranty for the work (except to the
288
+ extent that warranties are provided), that licensees may convey the
289
+ work under this License, and how to view a copy of this License. If
290
+ the interface presents a list of user commands or options, such as a
291
+ menu, a prominent item in the list meets this criterion.
292
+
293
+ 1. Source Code.
294
+
295
+ The "source code" for a work means the preferred form of the work
296
+ for making modifications to it. "Object code" means any non-source
297
+ form of a work.
298
+
299
+ A "Standard Interface" means an interface that either is an official
300
+ standard defined by a recognized standards body, or, in the case of
301
+ interfaces specified for a particular programming language, one that
302
+ is widely used among developers working in that language.
303
+
304
+ The "System Libraries" of an executable work include anything, other
305
+ than the work as a whole, that (a) is included in the normal form of
306
+ packaging a Major Component, but which is not part of that Major
307
+ Component, and (b) serves only to enable use of the work with that
308
+ Major Component, or to implement a Standard Interface for which an
309
+ implementation is available to the public in source code form. A
310
+ "Major Component", in this context, means a major essential component
311
+ (kernel, window system, and so on) of the specific operating system
312
+ (if any) on which the executable work runs, or a compiler used to
313
+ produce the work, or an object code interpreter used to run it.
314
+
315
+ The "Corresponding Source" for a work in object code form means all
316
+ the source code needed to generate, install, and (for an executable
317
+ work) run the object code and to modify the work, including scripts to
318
+ control those activities. However, it does not include the work's
319
+ System Libraries, or general-purpose tools or generally available free
320
+ programs which are used unmodified in performing those activities but
321
+ which are not part of the work. For example, Corresponding Source
322
+ includes interface definition files associated with source files for
323
+ the work, and the source code for shared libraries and dynamically
324
+ linked subprograms that the work is specifically designed to require,
325
+ such as by intimate data communication or control flow between those
326
+ subprograms and other parts of the work.
327
+
328
+ The Corresponding Source need not include anything that users
329
+ can regenerate automatically from other parts of the Corresponding
330
+ Source.
331
+
332
+ The Corresponding Source for a work in source code form is that
333
+ same work.
334
+
335
+ 2. Basic Permissions.
336
+
337
+ All rights granted under this License are granted for the term of
338
+ copyright on the Program, and are irrevocable provided the stated
339
+ conditions are met. This License explicitly affirms your unlimited
340
+ permission to run the unmodified Program. The output from running a
341
+ covered work is covered by this License only if the output, given its
342
+ content, constitutes a covered work. This License acknowledges your
343
+ rights of fair use or other equivalent, as provided by copyright law.
344
+
345
+ You may make, run and propagate covered works that you do not
346
+ convey, without conditions so long as your license otherwise remains
347
+ in force. You may convey covered works to others for the sole purpose
348
+ of having them make modifications exclusively for you, or provide you
349
+ with facilities for running those works, provided that you comply with
350
+ the terms of this License in conveying all material for which you do
351
+ not control copyright. Those thus making or running the covered works
352
+ for you must do so exclusively on your behalf, under your direction
353
+ and control, on terms that prohibit them from making any copies of
354
+ your copyrighted material outside their relationship with you.
355
+
356
+ Conveying under any other circumstances is permitted solely under
357
+ the conditions stated below. Sublicensing is not allowed; section 10
358
+ makes it unnecessary.
359
+
360
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
361
+
362
+ No covered work shall be deemed part of an effective technological
363
+ measure under any applicable law fulfilling obligations under article
364
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
365
+ similar laws prohibiting or restricting circumvention of such
366
+ measures.
367
+
368
+ When you convey a covered work, you waive any legal power to forbid
369
+ circumvention of technological measures to the extent such circumvention
370
+ is effected by exercising rights under this License with respect to
371
+ the covered work, and you disclaim any intention to limit operation or
372
+ modification of the work as a means of enforcing, against the work's
373
+ users, your or third parties' legal rights to forbid circumvention of
374
+ technological measures.
375
+
376
+ 4. Conveying Verbatim Copies.
377
+
378
+ You may convey verbatim copies of the Program's source code as you
379
+ receive it, in any medium, provided that you conspicuously and
380
+ appropriately publish on each copy an appropriate copyright notice;
381
+ keep intact all notices stating that this License and any
382
+ non-permissive terms added in accord with section 7 apply to the code;
383
+ keep intact all notices of the absence of any warranty; and give all
384
+ recipients a copy of this License along with the Program.
385
+
386
+ You may charge any price or no price for each copy that you convey,
387
+ and you may offer support or warranty protection for a fee.
388
+
389
+ 5. Conveying Modified Source Versions.
390
+
391
+ You may convey a work based on the Program, or the modifications to
392
+ produce it from the Program, in the form of source code under the
393
+ terms of section 4, provided that you also meet all of these conditions:
394
+
395
+ a) The work must carry prominent notices stating that you modified
396
+ it, and giving a relevant date.
397
+
398
+ b) The work must carry prominent notices stating that it is
399
+ released under this License and any conditions added under section
400
+ 7. This requirement modifies the requirement in section 4 to
401
+ "keep intact all notices".
402
+
403
+ c) You must license the entire work, as a whole, under this
404
+ License to anyone who comes into possession of a copy. This
405
+ License will therefore apply, along with any applicable section 7
406
+ additional terms, to the whole of the work, and all its parts,
407
+ regardless of how they are packaged. This License gives no
408
+ permission to license the work in any other way, but it does not
409
+ invalidate such permission if you have separately received it.
410
+
411
+ d) If the work has interactive user interfaces, each must display
412
+ Appropriate Legal Notices; however, if the Program has interactive
413
+ interfaces that do not display Appropriate Legal Notices, your
414
+ work need not make them do so.
415
+
416
+ A compilation of a covered work with other separate and independent
417
+ works, which are not by their nature extensions of the covered work,
418
+ and which are not combined with it such as to form a larger program,
419
+ in or on a volume of a storage or distribution medium, is called an
420
+ "aggregate" if the compilation and its resulting copyright are not
421
+ used to limit the access or legal rights of the compilation's users
422
+ beyond what the individual works permit. Inclusion of a covered work
423
+ in an aggregate does not cause this License to apply to the other
424
+ parts of the aggregate.
425
+
426
+ 6. Conveying Non-Source Forms.
427
+
428
+ You may convey a covered work in object code form under the terms
429
+ of sections 4 and 5, provided that you also convey the
430
+ machine-readable Corresponding Source under the terms of this License,
431
+ in one of these ways:
432
+
433
+ a) Convey the object code in, or embodied in, a physical product
434
+ (including a physical distribution medium), accompanied by the
435
+ Corresponding Source fixed on a durable physical medium
436
+ customarily used for software interchange.
437
+
438
+ b) Convey the object code in, or embodied in, a physical product
439
+ (including a physical distribution medium), accompanied by a
440
+ written offer, valid for at least three years and valid for as
441
+ long as you offer spare parts or customer support for that product
442
+ model, to give anyone who possesses the object code either (1) a
443
+ copy of the Corresponding Source for all the software in the
444
+ product that is covered by this License, on a durable physical
445
+ medium customarily used for software interchange, for a price no
446
+ more than your reasonable cost of physically performing this
447
+ conveying of source, or (2) access to copy the
448
+ Corresponding Source from a network server at no charge.
449
+
450
+ c) Convey individual copies of the object code with a copy of the
451
+ written offer to provide the Corresponding Source. This
452
+ alternative is allowed only occasionally and noncommercially, and
453
+ only if you received the object code with such an offer, in accord
454
+ with subsection 6b.
455
+
456
+ d) Convey the object code by offering access from a designated
457
+ place (gratis or for a charge), and offer equivalent access to the
458
+ Corresponding Source in the same way through the same place at no
459
+ further charge. You need not require recipients to copy the
460
+ Corresponding Source along with the object code. If the place to
461
+ copy the object code is a network server, the Corresponding Source
462
+ may be on a different server (operated by you or a third party)
463
+ that supports equivalent copying facilities, provided you maintain
464
+ clear directions next to the object code saying where to find the
465
+ Corresponding Source. Regardless of what server hosts the
466
+ Corresponding Source, you remain obligated to ensure that it is
467
+ available for as long as needed to satisfy these requirements.
468
+
469
+ e) Convey the object code using peer-to-peer transmission, provided
470
+ you inform other peers where the object code and Corresponding
471
+ Source of the work are being offered to the general public at no
472
+ charge under subsection 6d.
473
+
474
+ A separable portion of the object code, whose source code is excluded
475
+ from the Corresponding Source as a System Library, need not be
476
+ included in conveying the object code work.
477
+
478
+ A "User Product" is either (1) a "consumer product", which means any
479
+ tangible personal property which is normally used for personal, family,
480
+ or household purposes, or (2) anything designed or sold for incorporation
481
+ into a dwelling. In determining whether a product is a consumer product,
482
+ doubtful cases shall be resolved in favor of coverage. For a particular
483
+ product received by a particular user, "normally used" refers to a
484
+ typical or common use of that class of product, regardless of the status
485
+ of the particular user or of the way in which the particular user
486
+ actually uses, or expects or is expected to use, the product. A product
487
+ is a consumer product regardless of whether the product has substantial
488
+ commercial, industrial or non-consumer uses, unless such uses represent
489
+ the only significant mode of use of the product.
490
+
491
+ "Installation Information" for a User Product means any methods,
492
+ procedures, authorization keys, or other information required to install
493
+ and execute modified versions of a covered work in that User Product from
494
+ a modified version of its Corresponding Source. The information must
495
+ suffice to ensure that the continued functioning of the modified object
496
+ code is in no case prevented or interfered with solely because
497
+ modification has been made.
498
+
499
+ If you convey an object code work under this section in, or with, or
500
+ specifically for use in, a User Product, and the conveying occurs as
501
+ part of a transaction in which the right of possession and use of the
502
+ User Product is transferred to the recipient in perpetuity or for a
503
+ fixed term (regardless of how the transaction is characterized), the
504
+ Corresponding Source conveyed under this section must be accompanied
505
+ by the Installation Information. But this requirement does not apply
506
+ if neither you nor any third party retains the ability to install
507
+ modified object code on the User Product (for example, the work has
508
+ been installed in ROM).
509
+
510
+ The requirement to provide Installation Information does not include a
511
+ requirement to continue to provide support service, warranty, or updates
512
+ for a work that has been modified or installed by the recipient, or for
513
+ the User Product in which it has been modified or installed. Access to a
514
+ network may be denied when the modification itself materially and
515
+ adversely affects the operation of the network or violates the rules and
516
+ protocols for communication across the network.
517
+
518
+ Corresponding Source conveyed, and Installation Information provided,
519
+ in accord with this section must be in a format that is publicly
520
+ documented (and with an implementation available to the public in
521
+ source code form), and must require no special password or key for
522
+ unpacking, reading or copying.
523
+
524
+ 7. Additional Terms.
525
+
526
+ "Additional permissions" are terms that supplement the terms of this
527
+ License by making exceptions from one or more of its conditions.
528
+ Additional permissions that are applicable to the entire Program shall
529
+ be treated as though they were included in this License, to the extent
530
+ that they are valid under applicable law. If additional permissions
531
+ apply only to part of the Program, that part may be used separately
532
+ under those permissions, but the entire Program remains governed by
533
+ this License without regard to the additional permissions.
534
+
535
+ When you convey a copy of a covered work, you may at your option
536
+ remove any additional permissions from that copy, or from any part of
537
+ it. (Additional permissions may be written to require their own
538
+ removal in certain cases when you modify the work.) You may place
539
+ additional permissions on material, added by you to a covered work,
540
+ for which you have or can give appropriate copyright permission.
541
+
542
+ Notwithstanding any other provision of this License, for material you
543
+ add to a covered work, you may (if authorized by the copyright holders of
544
+ that material) supplement the terms of this License with terms:
545
+
546
+ a) Disclaiming warranty or limiting liability differently from the
547
+ terms of sections 15 and 16 of this License; or
548
+
549
+ b) Requiring preservation of specified reasonable legal notices or
550
+ author attributions in that material or in the Appropriate Legal
551
+ Notices displayed by works containing it; or
552
+
553
+ c) Prohibiting misrepresentation of the origin of that material, or
554
+ requiring that modified versions of such material be marked in
555
+ reasonable ways as different from the original version; or
556
+
557
+ d) Limiting the use for publicity purposes of names of licensors or
558
+ authors of the material; or
559
+
560
+ e) Declining to grant rights under trademark law for use of some
561
+ trade names, trademarks, or service marks; or
562
+
563
+ f) Requiring indemnification of licensors and authors of that
564
+ material by anyone who conveys the material (or modified versions of
565
+ it) with contractual assumptions of liability to the recipient, for
566
+ any liability that these contractual assumptions directly impose on
567
+ those licensors and authors.
568
+
569
+ All other non-permissive additional terms are considered "further
570
+ restrictions" within the meaning of section 10. If the Program as you
571
+ received it, or any part of it, contains a notice stating that it is
572
+ governed by this License along with a term that is a further
573
+ restriction, you may remove that term. If a license document contains
574
+ a further restriction but permits relicensing or conveying under this
575
+ License, you may add to a covered work material governed by the terms
576
+ of that license document, provided that the further restriction does
577
+ not survive such relicensing or conveying.
578
+
579
+ If you add terms to a covered work in accord with this section, you
580
+ must place, in the relevant source files, a statement of the
581
+ additional terms that apply to those files, or a notice indicating
582
+ where to find the applicable terms.
583
+
584
+ Additional terms, permissive or non-permissive, may be stated in the
585
+ form of a separately written license, or stated as exceptions;
586
+ the above requirements apply either way.
587
+
588
+ 8. Termination.
589
+
590
+ You may not propagate or modify a covered work except as expressly
591
+ provided under this License. Any attempt otherwise to propagate or
592
+ modify it is void, and will automatically terminate your rights under
593
+ this License (including any patent licenses granted under the third
594
+ paragraph of section 11).
595
+
596
+ However, if you cease all violation of this License, then your
597
+ license from a particular copyright holder is reinstated (a)
598
+ provisionally, unless and until the copyright holder explicitly and
599
+ finally terminates your license, and (b) permanently, if the copyright
600
+ holder fails to notify you of the violation by some reasonable means
601
+ prior to 60 days after the cessation.
602
+
603
+ Moreover, your license from a particular copyright holder is
604
+ reinstated permanently if the copyright holder notifies you of the
605
+ violation by some reasonable means, this is the first time you have
606
+ received notice of violation of this License (for any work) from that
607
+ copyright holder, and you cure the violation prior to 30 days after
608
+ your receipt of the notice.
609
+
610
+ Termination of your rights under this section does not terminate the
611
+ licenses of parties who have received copies or rights from you under
612
+ this License. If your rights have been terminated and not permanently
613
+ reinstated, you do not qualify to receive new licenses for the same
614
+ material under section 10.
615
+
616
+ 9. Acceptance Not Required for Having Copies.
617
+
618
+ You are not required to accept this License in order to receive or
619
+ run a copy of the Program. Ancillary propagation of a covered work
620
+ occurring solely as a consequence of using peer-to-peer transmission
621
+ to receive a copy likewise does not require acceptance. However,
622
+ nothing other than this License grants you permission to propagate or
623
+ modify any covered work. These actions infringe copyright if you do
624
+ not accept this License. Therefore, by modifying or propagating a
625
+ covered work, you indicate your acceptance of this License to do so.
626
+
627
+ 10. Automatic Licensing of Downstream Recipients.
628
+
629
+ Each time you convey a covered work, the recipient automatically
630
+ receives a license from the original licensors, to run, modify and
631
+ propagate that work, subject to this License. You are not responsible
632
+ for enforcing compliance by third parties with this License.
633
+
634
+ An "entity transaction" is a transaction transferring control of an
635
+ organization, or substantially all assets of one, or subdividing an
636
+ organization, or merging organizations. If propagation of a covered
637
+ work results from an entity transaction, each party to that
638
+ transaction who receives a copy of the work also receives whatever
639
+ licenses to the work the party's predecessor in interest had or could
640
+ give under the previous paragraph, plus a right to possession of the
641
+ Corresponding Source of the work from the predecessor in interest, if
642
+ the predecessor has it or can get it with reasonable efforts.
643
+
644
+ You may not impose any further restrictions on the exercise of the
645
+ rights granted or affirmed under this License. For example, you may
646
+ not impose a license fee, royalty, or other charge for exercise of
647
+ rights granted under this License, and you may not initiate litigation
648
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
649
+ any patent claim is infringed by making, using, selling, offering for
650
+ sale, or importing the Program or any portion of it.
651
+
652
+ 11. Patents.
653
+
654
+ A "contributor" is a copyright holder who authorizes use under this
655
+ License of the Program or a work on which the Program is based. The
656
+ work thus licensed is called the contributor's "contributor version".
657
+
658
+ A contributor's "essential patent claims" are all patent claims
659
+ owned or controlled by the contributor, whether already acquired or
660
+ hereafter acquired, that would be infringed by some manner, permitted
661
+ by this License, of making, using, or selling its contributor version,
662
+ but do not include claims that would be infringed only as a
663
+ consequence of further modification of the contributor version. For
664
+ purposes of this definition, "control" includes the right to grant
665
+ patent sublicenses in a manner consistent with the requirements of
666
+ this License.
667
+
668
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
669
+ patent license under the contributor's essential patent claims, to
670
+ make, use, sell, offer for sale, import and otherwise run, modify and
671
+ propagate the contents of its contributor version.
672
+
673
+ In the following three paragraphs, a "patent license" is any express
674
+ agreement or commitment, however denominated, not to enforce a patent
675
+ (such as an express permission to practice a patent or covenant not to
676
+ sue for patent infringement). To "grant" such a patent license to a
677
+ party means to make such an agreement or commitment not to enforce a
678
+ patent against the party.
679
+
680
+ If you convey a covered work, knowingly relying on a patent license,
681
+ and the Corresponding Source of the work is not available for anyone
682
+ to copy, free of charge and under the terms of this License, through a
683
+ publicly available network server or other readily accessible means,
684
+ then you must either (1) cause the Corresponding Source to be so
685
+ available, or (2) arrange to deprive yourself of the benefit of the
686
+ patent license for this particular work, or (3) arrange, in a manner
687
+ consistent with the requirements of this License, to extend the patent
688
+ license to downstream recipients. "Knowingly relying" means you have
689
+ actual knowledge that, but for the patent license, your conveying the
690
+ covered work in a country, or your recipient's use of the covered work
691
+ in a country, would infringe one or more identifiable patents in that
692
+ country that you have reason to believe are valid.
693
+
694
+ If, pursuant to or in connection with a single transaction or
695
+ arrangement, you convey, or propagate by procuring conveyance of, a
696
+ covered work, and grant a patent license to some of the parties
697
+ receiving the covered work authorizing them to use, propagate, modify
698
+ or convey a specific copy of the covered work, then the patent license
699
+ you grant is automatically extended to all recipients of the covered
700
+ work and works based on it.
701
+
702
+ A patent license is "discriminatory" if it does not include within
703
+ the scope of its coverage, prohibits the exercise of, or is
704
+ conditioned on the non-exercise of one or more of the rights that are
705
+ specifically granted under this License. You may not convey a covered
706
+ work if you are a party to an arrangement with a third party that is
707
+ in the business of distributing software, under which you make payment
708
+ to the third party based on the extent of your activity of conveying
709
+ the work, and under which the third party grants, to any of the
710
+ parties who would receive the covered work from you, a discriminatory
711
+ patent license (a) in connection with copies of the covered work
712
+ conveyed by you (or copies made from those copies), or (b) primarily
713
+ for and in connection with specific products or compilations that
714
+ contain the covered work, unless you entered into that arrangement,
715
+ or that patent license was granted, prior to 28 March 2007.
716
+
717
+ Nothing in this License shall be construed as excluding or limiting
718
+ any implied license or other defenses to infringement that may
719
+ otherwise be available to you under applicable patent law.
720
+
721
+ 12. No Surrender of Others' Freedom.
722
+
723
+ If conditions are imposed on you (whether by court order, agreement or
724
+ otherwise) that contradict the conditions of this License, they do not
725
+ excuse you from the conditions of this License. If you cannot convey a
726
+ covered work so as to satisfy simultaneously your obligations under this
727
+ License and any other pertinent obligations, then as a consequence you may
728
+ not convey it at all. For example, if you agree to terms that obligate you
729
+ to collect a royalty for further conveying from those to whom you convey
730
+ the Program, the only way you could satisfy both those terms and this
731
+ License would be to refrain entirely from conveying the Program.
732
+
733
+ 13. Use with the GNU Affero General Public License.
734
+
735
+ Notwithstanding any other provision of this License, you have
736
+ permission to link or combine any covered work with a work licensed
737
+ under version 3 of the GNU Affero General Public License into a single
738
+ combined work, and to convey the resulting work. The terms of this
739
+ License will continue to apply to the part which is the covered work,
740
+ but the special requirements of the GNU Affero General Public License,
741
+ section 13, concerning interaction through a network will apply to the
742
+ combination as such.
743
+
744
+ 14. Revised Versions of this License.
745
+
746
+ The Free Software Foundation may publish revised and/or new versions of
747
+ the GNU General Public License from time to time. Such new versions will
748
+ be similar in spirit to the present version, but may differ in detail to
749
+ address new problems or concerns.
750
+
751
+ Each version is given a distinguishing version number. If the
752
+ Program specifies that a certain numbered version of the GNU General
753
+ Public License "or any later version" applies to it, you have the
754
+ option of following the terms and conditions either of that numbered
755
+ version or of any later version published by the Free Software
756
+ Foundation. If the Program does not specify a version number of the
757
+ GNU General Public License, you may choose any version ever published
758
+ by the Free Software Foundation.
759
+
760
+ If the Program specifies that a proxy can decide which future
761
+ versions of the GNU General Public License can be used, that proxy's
762
+ public statement of acceptance of a version permanently authorizes you
763
+ to choose that version for the Program.
764
+
765
+ Later license versions may give you additional or different
766
+ permissions. However, no additional obligations are imposed on any
767
+ author or copyright holder as a result of your choosing to follow a
768
+ later version.
769
+
770
+ 15. Disclaimer of Warranty.
771
+
772
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
773
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
774
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
775
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
776
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
777
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
778
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
779
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
780
+
781
+ 16. Limitation of Liability.
782
+
783
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
784
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
785
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
786
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
787
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
788
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
789
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
790
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
791
+ SUCH DAMAGES.
792
+
793
+ 17. Interpretation of Sections 15 and 16.
794
+
795
+ If the disclaimer of warranty and limitation of liability provided
796
+ above cannot be given local legal effect according to their terms,
797
+ reviewing courts shall apply local law that most closely approximates
798
+ an absolute waiver of all civil liability in connection with the
799
+ Program, unless a warranty or assumption of liability accompanies a
800
+ copy of the Program in return for a fee.
801
+
802
+ END OF TERMS AND CONDITIONS
803
+
804
+ How to Apply These Terms to Your New Programs
805
+
806
+ If you develop a new program, and you want it to be of the greatest
807
+ possible use to the public, the best way to achieve this is to make it
808
+ free software which everyone can redistribute and change under these terms.
809
+
810
+ To do so, attach the following notices to the program. It is safest
811
+ to attach them to the start of each source file to most effectively
812
+ state the exclusion of warranty; and each file should have at least
813
+ the "copyright" line and a pointer to where the full notice is found.
814
+
815
+ <one line to give the program's name and a brief idea of what it does.>
816
+ Copyright (C) <year> <name of author>
817
+
818
+ This program is free software: you can redistribute it and/or modify
819
+ it under the terms of the GNU General Public License as published by
820
+ the Free Software Foundation, either version 3 of the License, or
821
+ (at your option) any later version.
822
+
823
+ This program is distributed in the hope that it will be useful,
824
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
825
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
826
+ GNU General Public License for more details.
827
+
828
+ You should have received a copy of the GNU General Public License
829
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
830
+
831
+ Also add information on how to contact you by electronic and paper mail.
832
+
833
+ If the program does terminal interaction, make it output a short
834
+ notice like this when it starts in an interactive mode:
835
+
836
+ <program> Copyright (C) <year> <name of author>
837
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
838
+ This is free software, and you are welcome to redistribute it
839
+ under certain conditions; type `show c' for details.
840
+
841
+ The hypothetical commands `show w' and `show c' should show the appropriate
842
+ parts of the General Public License. Of course, your program's commands
843
+ might be different; for a GUI interface, you would use an "about box".
844
+
845
+ You should also get your employer (if you work as a programmer) or school,
846
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
847
+ For more information on this, and how to apply and follow the GNU GPL, see
848
+ <http://www.gnu.org/licenses/>.
849
+
850
+ The GNU General Public License does not permit incorporating your program
851
+ into proprietary programs. If your program is a subroutine library, you
852
+ may consider it more useful to permit linking proprietary applications with
853
+ the library. If this is what you want to do, use the GNU Lesser General
854
+ Public License instead of this License. But first, please read
855
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
856
+
857
+ **********************************************************************
858
+ **********************************************************************
includes/lib/tcpdf/README.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TCPDF
2
+ *PHP PDF Library*
3
+
4
+ [![Donate via PayPal](https://img.shields.io/badge/donate-paypal-87ceeb.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&currency_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project)
5
+ *Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&currency_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project)*
6
+
7
+ * **category** Library
8
+ * **author** Nicola Asuni <info@tecnick.com>
9
+ * **copyright** 2002-2016 Nicola Asuni - Tecnick.com LTD
10
+ * **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)
11
+ * **link** http://www.tcpdf.org
12
+ * **source** https://github.com/tecnickcom/TCPDF
13
+
14
+
15
+ ## IMPORTANT
16
+ A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support.
17
+ This version should be considered obsolete, new projects should use the new version as soon it will become stable.
18
+
19
+
20
+
21
+ ## Description
22
+
23
+ PHP library for generating PDF documents on-the-fly.
24
+
25
+ ### Main Features:
26
+ * no external libraries are required for the basic functions;
27
+ * all standard page formats, custom page formats, custom margins and units of measure;
28
+ * UTF-8 Unicode and Right-To-Left languages;
29
+ * TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1 and CID-0 fonts;
30
+ * font subsetting;
31
+ * methods to publish some XHTML + CSS code, Javascript and Forms;
32
+ * images, graphic (geometric figures) and transformation methods;
33
+ * supports JPEG, PNG and SVG 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/script/formats.php)
34
+ * 1D and 2D barcodes: 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 Extension, 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, Datamatrix, QR-Code, PDF417;
35
+ * JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;
36
+ * automatic page header and footer management;
37
+ * document encryption up to 256 bit and digital signature certifications;
38
+ * transactions to UNDO commands;
39
+ * PDF annotations, including links, text and file attachments;
40
+ * text rendering modes (fill, stroke and clipping);
41
+ * multiple columns mode;
42
+ * no-write page regions;
43
+ * bookmarks, named destinations and table of content;
44
+ * text hyphenation;
45
+ * text stretching and spacing (tracking);
46
+ * automatic page break, line break and text alignments including justification;
47
+ * automatic page numbering and page groups;
48
+ * move and delete pages;
49
+ * page compression (requires php-zlib extension);
50
+ * XOBject Templates;
51
+ * Layers and object visibility.
52
+ * PDF/A-1b support.
53
+
54
+ ### Third party fonts:
55
+
56
+ This library may include third party font files released with different licenses.
57
+
58
+ All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3),
59
+ they do not contain any binary data but just a description of the general properties of a particular font.
60
+ These files can be also generated on the fly using the font utilities and TCPDF methods.
61
+
62
+ All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files).
63
+
64
+ The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3).
65
+ The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license.
66
+ For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503
67
+ Link : http://www.gnu.org/software/freefont/
68
+
69
+ The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection.
70
+ For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33
71
+ Link : http://dejavu-fonts.org
72
+
73
+ The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2).
74
+ Link : http://projects.arabeyes.org/
75
+
76
+ ### ICC profile:
77
+
78
+ TCPDF includes the sRGB.icc profile from the icc-profiles-free Debian package:
79
+ https://packages.debian.org/source/stable/icc-profiles-free
80
+
81
+
82
+ ## Developer(s) Contact
83
+
84
+ * Nicola Asuni <info@tecnick.com>
includes/lib/{tcpdf_min → tcpdf}/composer.json RENAMED
@@ -1,40 +1,39 @@
1
- {
2
- "name": "tecnick.com/tcpdf",
3
- "version": "6.0.084",
4
- "homepage": "http://www.tcpdf.org/",
5
- "type": "library",
6
- "description": "TCPDF is a PHP class for generating PDF documents.",
7
- "keywords": ["PDF","tcpdf","PDFD32000-2008","qrcode","datamatrix","pdf417","barcodes"],
8
- "license": "LGPLv3",
9
- "authors": [
10
- {
11
- "name": "Nicola Asuni",
12
- "email": "info@tecnick.com",
13
- "homepage": "http://nicolaasuni.tecnick.com"
14
- }
15
- ],
16
- "require": {
17
- "php": ">=5.3.0"
18
- },
19
- "autoload": {
20
- "classmap": [
21
- "fonts",
22
- "config",
23
- "include",
24
- "tcpdf.php",
25
- "tcpdf_parser.php",
26
- "tcpdf_import.php",
27
- "tcpdf_barcodes_1d.php",
28
- "tcpdf_barcodes_2d.php",
29
- "include/tcpdf_colors.php",
30
- "include/tcpdf_filters.php",
31
- "include/tcpdf_font_data.php",
32
- "include/tcpdf_fonts.php",
33
- "include/tcpdf_images.php",
34
- "include/tcpdf_static.php",
35
- "include/barcodes/datamatrix.php",
36
- "include/barcodes/pdf417.php",
37
- "include/barcodes/qrcode.php"
38
- ]
39
- }
40
- }
1
+ {
2
+ "name": "tecnickcom/tcpdf",
3
+ "version": "6.2.13",
4
+ "homepage": "http://www.tcpdf.org/",
5
+ "type": "library",
6
+ "description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
7
+ "keywords": ["PDF","tcpdf","PDFD32000-2008","qrcode","datamatrix","pdf417","barcodes"],
8
+ "license": "LGPLv3",
9
+ "authors": [
10
+ {
11
+ "name": "Nicola Asuni",
12
+ "email": "info@tecnick.com",
13
+ "homepage": "http://nicolaasuni.tecnick.com"
14
+ }
15
+ ],
16
+ "require": {
17
+ "php": ">=5.3.0"
18
+ },
19
+ "autoload": {
20
+ "classmap": [
21
+ "config",
22
+ "include",
23
+ "tcpdf.php",
24
+ "tcpdf_parser.php",
25
+ "tcpdf_import.php",
26
+ "tcpdf_barcodes_1d.php",
27
+ "tcpdf_barcodes_2d.php",
28
+ "include/tcpdf_colors.php",
29
+ "include/tcpdf_filters.php",
30
+ "include/tcpdf_font_data.php",
31
+ "include/tcpdf_fonts.php",
32
+ "include/tcpdf_images.php",
33
+ "include/tcpdf_static.php",
34
+ "include/barcodes/datamatrix.php",
35
+ "include/barcodes/pdf417.php",
36
+ "include/barcodes/qrcode.php"
37
+ ]
38
+ }
39
+ }
 
includes/lib/{tcpdf_min → tcpdf}/config/tcpdf_config.php RENAMED
@@ -1,245 +1,227 @@
1
- <?php
2
- //============================================================+
3
- // File name : tcpdf_config.php
4
- // Begin : 2004-06-11
5
- // Last Update : 2014-01-25
6
- //
7
- // Description : Configuration file for TCPDF.
8
- // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
9
- // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
10
- // -------------------------------------------------------------------
11
- // Copyright (C) 2004-2014 Nicola Asuni - Tecnick.com LTD
12
- //
13
- // This file is part of TCPDF software library.
14
- //
15
- // TCPDF is free software: you can redistribute it and/or modify it
16
- // under the terms of the GNU Lesser General Public License as
17
- // published by the Free Software Foundation, either version 3 of the
18
- // License, or (at your option) any later version.
19
- //
20
- // TCPDF is distributed in the hope that it will be useful, but
21
- // WITHOUT ANY WARRANTY; without even the implied warranty of
22
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
- // See the GNU Lesser General Public License for more details.
24
- //
25
- // You should have received a copy of the GNU Lesser General Public License
26
- // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
27
- //
28
- // See LICENSE.TXT file for more information.
29
- //============================================================+
30
-
31
- /**
32
- * Configuration file for TCPDF.
33
- * @author Nicola Asuni
34
- * @package com.tecnick.tcpdf
35
- * @version 4.9.005
36
- * @since 2004-10-27
37
- */
38
-
39
- // IMPORTANT:
40
- // If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored.
41
- // If you use the tcpdf_autoconfig.php, then you can overwrite some values here.
42
-
43
-
44
- /**
45
- * Installation path (/var/www/tcpdf/).
46
- * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
47
- */
48
- //define ('K_PATH_MAIN', '');
49
-
50
- /**
51
- * URL path to tcpdf installation folder (http://localhost/tcpdf/).
52
- * By default it is automatically set but you can also set it as a fixed string to improve performances.
53
- */
54
- //define ('K_PATH_URL', '');
55
-
56
- /**
57
- * Path for PDF fonts.
58
- * By default it is automatically set but you can also set it as a fixed string to improve performances.
59
- */
60
- //define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
61
- ////////////////////////////////////////////
62
- // Algoritmika - Booster - version 2.9.0 / since 2.9.0
63
- if ( wcj_check_tcpdf_fonts_version( true ) ) {
64
- define( 'K_PATH_FONTS', wcj_get_wcj_uploads_dir( 'tcpdf_fonts' ) . '/' );
65
- }
66
- ////////////////////////////////////////////
67
-
68
- /**
69
- * Default images directory.
70
- * By default it is automatically set but you can also set it as a fixed string to improve performances.
71
- */
72
- // Algoritmika - Booster version 2.4.4
73
- switch ( get_option( 'wcj_invoicing_general_header_images_path', 'empty' ) ) {
74
- case 'tcpdf_default':
75
- //define ( 'K_PATH_IMAGES', '' );
76
- break;
77
- case 'empty':
78
- define ( 'K_PATH_IMAGES', '' );
79
- break;
80
- case 'document_root':
81
- define ( 'K_PATH_IMAGES', $_SERVER['DOCUMENT_ROOT'] );
82
- break;
83
- case 'abspath':
84
- define ( 'K_PATH_IMAGES', ABSPATH );
85
- break;
86
- }
87
-
88
- /**
89
- * Deafult image logo used be the default Header() method.
90
- * Please set here your own logo or an empty string to disable it.
91
- */
92
- //define ('PDF_HEADER_LOGO', '');
93
-
94
- /**
95
- * Header logo image width in user units.
96
- */
97
- //define ('PDF_HEADER_LOGO_WIDTH', 0);
98
-
99
- /**
100
- * Cache directory for temporary files (full path).
101
- */
102
- //define ('K_PATH_CACHE', '/tmp/');
103
-
104
- /**
105
- * Generic name for a blank image.
106
- */
107
- define ('K_BLANK_IMAGE', '_blank.png');
108
-
109
- /**
110
- * Page format.
111
- */
112
- define ('PDF_PAGE_FORMAT', 'A4');
113
-
114
- /**
115
- * Page orientation (P=portrait, L=landscape).
116
- */
117
- define ('PDF_PAGE_ORIENTATION', 'P');
118
-
119
- /**
120
- * Document creator.
121
- */
122
- define ('PDF_CREATOR', 'TCPDF');
123
-
124
- /**
125
- * Document author.
126
- */
127
- define ('PDF_AUTHOR', 'TCPDF');
128
-
129
- /**
130
- * Header title.
131
- */
132
- define ('PDF_HEADER_TITLE', 'TCPDF Example');
133
-
134
- /**
135
- * Header description string.
136
- */
137
- define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
138
-
139
- /**
140
- * Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
141
- */
142
- define ('PDF_UNIT', 'mm');
143
-
144
- /**
145
- * Header margin.
146
- */
147
- define ('PDF_MARGIN_HEADER', 5);
148
-
149
- /**
150
- * Footer margin.
151
- */
152
- define ('PDF_MARGIN_FOOTER', 10);
153
-
154
- /**
155
- * Top margin.
156
- */
157
- define ('PDF_MARGIN_TOP', 27);
158
-
159
- /**
160
- * Bottom margin.
161
- */
162
- define ('PDF_MARGIN_BOTTOM', 25);
163
-
164
- /**
165
- * Left margin.
166
- */
167
- define ('PDF_MARGIN_LEFT', 15);
168
-
169
- /**
170
- * Right margin.
171
- */
172
- define ('PDF_MARGIN_RIGHT', 15);
173
-
174
- /**
175
- * Default main font name.
176
- */
177
- define ('PDF_FONT_NAME_MAIN', 'helvetica');
178
-
179
- /**
180
- * Default main font size.
181
- */
182
- define ('PDF_FONT_SIZE_MAIN', 10);
183
-
184
- /**
185
- * Default data font name.
186
- */
187
- define ('PDF_FONT_NAME_DATA', 'helvetica');
188
-
189
- /**
190
- * Default data font size.
191
- */
192
- define ('PDF_FONT_SIZE_DATA', 8);
193
-
194
- /**
195
- * Default monospaced font name.
196
- */
197
- define ('PDF_FONT_MONOSPACED', 'courier');
198
-
199
- /**
200
- * Ratio used to adjust the conversion of pixels to user units.
201
- */
202
- define ('PDF_IMAGE_SCALE_RATIO', 1.25);
203
-
204
- /**
205
- * Magnification factor for titles.
206
- */
207
- define('HEAD_MAGNIFICATION', 1.1);
208
-
209
- /**
210
- * Height of cell respect font height.
211
- */
212
- define('K_CELL_HEIGHT_RATIO', 1.25);
213
-
214
- /**
215
- * Title magnification respect main font size.
216
- */
217
- define('K_TITLE_MAGNIFICATION', 1.3);
218
-
219
- /**
220
- * Reduction factor for small font.
221
- */
222
- define('K_SMALL_RATIO', 2/3);
223
-
224
- /**
225
- * Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
226
- */
227
- define('K_THAI_TOPCHARS', true);
228
-
229
- /**
230
- * If true allows to call TCPDF methods using HTML syntax
231
- * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
232
- */
233
- define('K_TCPDF_CALLS_IN_HTML', true);
234
-
235
- /**
236
- * If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
237
- */
238
- // Algoritmika - Booster version 2.4.5
239
- if (!defined('K_TCPDF_THROW_EXCEPTION_ERROR')) {
240
- define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
241
- }
242
-
243
- //============================================================+
244
- // END OF FILE
245
- //============================================================+
1
+ <?php
2
+ //============================================================+
3
+ // File name : tcpdf_config.php
4
+ // Begin : 2004-06-11
5
+ // Last Update : 2014-12-11
6
+ //
7
+ // Description : Configuration file for TCPDF.
8
+ // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
9
+ // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
10
+ // -------------------------------------------------------------------
11
+ // Copyright (C) 2004-2014 Nicola Asuni - Tecnick.com LTD
12
+ //
13
+ // This file is part of TCPDF software library.
14
+ //
15
+ // TCPDF is free software: you can redistribute it and/or modify it
16
+ // under the terms of the GNU Lesser General Public License as
17
+ // published by the Free Software Foundation, either version 3 of the
18
+ // License, or (at your option) any later version.
19
+ //
20
+ // TCPDF is distributed in the hope that it will be useful, but
21
+ // WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23
+ // See the GNU Lesser General Public License for more details.
24
+ //
25
+ // You should have received a copy of the GNU Lesser General Public License
26
+ // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
27
+ //
28
+ // See LICENSE.TXT file for more information.
29
+ //============================================================+
30
+
31
+ /**
32
+ * Configuration file for TCPDF.
33
+ * @author Nicola Asuni
34
+ * @package com.tecnick.tcpdf
35
+ * @version 4.9.005
36
+ * @since 2004-10-27
37
+ */
38
+
39
+ // IMPORTANT:
40
+ // If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored.
41
+ // If you use the tcpdf_autoconfig.php, then you can overwrite some values here.
42
+
43
+
44
+ /**
45
+ * Installation path (/var/www/tcpdf/).
46
+ * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
47
+ */
48
+ //define ('K_PATH_MAIN', '');
49
+
50
+ /**
51
+ * URL path to tcpdf installation folder (http://localhost/tcpdf/).
52
+ * By default it is automatically set but you can also set it as a fixed string to improve performances.
53
+ */
54
+ //define ('K_PATH_URL', '');
55
+
56
+ /**
57
+ * Path for PDF fonts.
58
+ * By default it is automatically set but you can also set it as a fixed string to improve performances.
59
+ */
60
+ //define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/');
61
+
62
+ /**
63
+ * Default images directory.
64
+ * By default it is automatically set but you can also set it as a fixed string to improve performances.
65
+ */
66
+ //define ('K_PATH_IMAGES', '');
67
+
68
+ /**
69
+ * Deafult image logo used be the default Header() method.
70
+ * Please set here your own logo or an empty string to disable it.
71
+ */
72
+ //define ('PDF_HEADER_LOGO', '');
73
+
74
+ /**
75
+ * Header logo image width in user units.
76
+ */
77
+ //define ('PDF_HEADER_LOGO_WIDTH', 0);
78
+
79
+ /**
80
+ * Cache directory for temporary files (full path).
81
+ */
82
+ //define ('K_PATH_CACHE', '/tmp/');
83
+
84
+ /**
85
+ * Generic name for a blank image.
86
+ */
87
+ define ('K_BLANK_IMAGE', '_blank.png');
88
+
89
+ /**
90
+ * Page format.
91
+ */
92
+ define ('PDF_PAGE_FORMAT', 'A4');
93
+
94
+ /**
95
+ * Page orientation (P=portrait, L=landscape).
96
+ */
97
+ define ('PDF_PAGE_ORIENTATION', 'P');
98
+
99
+ /**
100
+ * Document creator.
101
+ */
102
+ define ('PDF_CREATOR', 'TCPDF');
103
+
104
+ /**
105
+ * Document author.
106
+ */
107
+ define ('PDF_AUTHOR', 'TCPDF');
108
+
109
+ /**
110
+ * Header title.
111
+ */
112
+ define ('PDF_HEADER_TITLE', 'TCPDF Example');
113
+
114
+ /**
115
+ * Header description string.
116
+ */
117
+ define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
118
+
119
+ /**
120
+ * Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
121
+ */
122
+ define ('PDF_UNIT', 'mm');
123
+
124
+ /**
125
+ * Header margin.
126
+ */
127
+ define ('PDF_MARGIN_HEADER', 5);
128
+
129
+ /**
130
+ * Footer margin.
131
+ */
132
+ define ('PDF_MARGIN_FOOTER', 10);
133
+
134
+ /**
135
+ * Top margin.
136
+ */
137
+ define ('PDF_MARGIN_TOP', 27);
138
+
139
+ /**
140
+ * Bottom margin.
141
+ */
142
+ define ('PDF_MARGIN_BOTTOM', 25);
143
+
144
+ /**
145
+ * Left margin.
146
+ */
147
+ define ('PDF_MARGIN_LEFT', 15);
148
+
149
+ /**
150
+ * Right margin.
151
+ */
152
+ define ('PDF_MARGIN_RIGHT', 15);
153
+
154
+ /**
155
+ * Default main font name.
156
+ */
157
+ define ('PDF_FONT_NAME_MAIN', 'helvetica');
158
+
159
+ /**
160
+ * Default main font size.
161
+ */
162
+ define ('PDF_FONT_SIZE_MAIN', 10);
163
+
164
+ /**
165
+ * Default data font name.
166
+ */
167
+ define ('PDF_FONT_NAME_DATA', 'helvetica');
168
+
169
+ /**
170
+ * Default data font size.
171
+ */
172
+ define ('PDF_FONT_SIZE_DATA', 8);
173
+
174
+ /**
175
+ * Default monospaced font name.
176
+ */
177
+ define ('PDF_FONT_MONOSPACED', 'courier');
178
+
179
+ /**
180
+ * Ratio used to adjust the conversion of pixels to user units.
181
+ */
182
+ define ('PDF_IMAGE_SCALE_RATIO', 1.25);
183
+
184
+ /**
185
+ * Magnification factor for titles.
186
+ */
187
+ define('HEAD_MAGNIFICATION', 1.1);
188
+
189
+ /**
190
+ * Height of cell respect font height.
191
+ */
192
+ define('K_CELL_HEIGHT_RATIO', 1.25);
193
+
194
+ /**
195
+ * Title magnification respect main font size.
196
+ */
197
+ define('K_TITLE_MAGNIFICATION', 1.3);
198
+
199
+ /**
200
+ * Reduction factor for small font.
201
+ */
202
+ define('K_SMALL_RATIO', 2/3);
203
+
204
+ /**
205
+ * Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
206
+ */
207
+ define('K_THAI_TOPCHARS', true);
208
+
209
+ /**
210
+ * If true allows to call TCPDF methods using HTML syntax
211
+ * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
212
+ */
213
+ define('K_TCPDF_CALLS_IN_HTML', false);
214
+
215
+ /**
216
+ * If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
217
+ */
218
+ define('K_TCPDF_THROW_EXCEPTION_ERROR', false);
219
+
220
+ /**
221
+ * Default timezone for datetime functions
222
+ */
223
+ define('K_TIMEZONE', 'UTC');
224
+
225
+ //============================================================+
226
+ // END OF FILE
227
+ //============================================================+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/lib/{tcpdf_min → tcpdf}/fonts/courier.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Courier';
5
- $up=-100;
6
- $ut=50;
7
- $dw=600;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>33,'FontBBox'=>'[-23 -250 715 805]','ItalicAngle'=>0,'Ascent'=>805,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>426,'StemV'=>51,'StemH'=>51,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
- $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Courier';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=600;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>33,'FontBBox'=>'[-23 -250 715 805]','ItalicAngle'=>0,'Ascent'=>805,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>426,'StemV'=>51,'StemH'=>51,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
+ $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/courierb.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Courier-Bold';
5
- $up=-100;
6
- $ut=50;
7
- $dw=600;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>33,'FontBBox'=>'[-113 -250 749 801]','ItalicAngle'=>0,'Ascent'=>801,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>439,'StemV'=>106,'StemH'=>84,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
- $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Courier-Bold';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=600;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>33,'FontBBox'=>'[-113 -250 749 801]','ItalicAngle'=>0,'Ascent'=>801,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>439,'StemV'=>106,'StemH'=>84,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
+ $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/courierbi.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Courier-BoldOblique';
5
- $up=-100;
6
- $ut=50;
7
- $dw=600;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>97,'FontBBox'=>'[-57 -250 869 801]','ItalicAngle'=>-12,'Ascent'=>801,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>439,'StemV'=>106,'StemH'=>84,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
- $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Courier-BoldOblique';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=600;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>97,'FontBBox'=>'[-57 -250 869 801]','ItalicAngle'=>-12,'Ascent'=>801,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>439,'StemV'=>106,'StemH'=>84,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
+ $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/courieri.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Courier-Oblique';
5
- $up=-100;
6
- $ut=50;
7
- $dw=600;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>97,'FontBBox'=>'[-27 -250 849 805]','ItalicAngle'=>-12,'Ascent'=>805,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>426,'StemV'=>51,'StemH'=>51,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
- $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Courier-Oblique';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=600;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>97,'FontBBox'=>'[-27 -250 849 805]','ItalicAngle'=>-12,'Ascent'=>805,'Descent'=>-250,'Leading'=>0,'CapHeight'=>562,'XHeight'=>426,'StemV'=>51,'StemH'=>51,'AvgWidth'=>600,'MaxWidth'=>600,'MissingWidth'=>600);
11
+ $cw=array(0=>600,1=>600,2=>600,3=>600,4=>600,5=>600,6=>600,7=>600,8=>600,9=>600,10=>600,11=>600,12=>600,13=>600,14=>600,15=>600,16=>600,17=>600,18=>600,19=>600,20=>600,21=>600,22=>600,23=>600,24=>600,25=>600,26=>600,27=>600,28=>600,29=>600,30=>600,31=>600,32=>600,33=>600,34=>600,35=>600,36=>600,37=>600,38=>600,39=>600,40=>600,41=>600,42=>600,43=>600,44=>600,45=>600,46=>600,47=>600,48=>600,49=>600,50=>600,51=>600,52=>600,53=>600,54=>600,55=>600,56=>600,57=>600,58=>600,59=>600,60=>600,61=>600,62=>600,63=>600,64=>600,65=>600,66=>600,67=>600,68=>600,69=>600,70=>600,71=>600,72=>600,73=>600,74=>600,75=>600,76=>600,77=>600,78=>600,79=>600,80=>600,81=>600,82=>600,83=>600,84=>600,85=>600,86=>600,87=>600,88=>600,89=>600,90=>600,91=>600,92=>600,93=>600,94=>600,95=>600,96=>600,97=>600,98=>600,99=>600,100=>600,101=>600,102=>600,103=>600,104=>600,105=>600,106=>600,107=>600,108=>600,109=>600,110=>600,111=>600,112=>600,113=>600,114=>600,115=>600,116=>600,117=>600,118=>600,119=>600,120=>600,121=>600,122=>600,123=>600,124=>600,125=>600,126=>600,127=>600,128=>600,129=>600,130=>600,131=>600,132=>600,133=>600,134=>600,135=>600,136=>600,137=>600,138=>600,139=>600,140=>600,141=>600,142=>600,143=>600,144=>600,145=>600,146=>600,147=>600,148=>600,149=>600,150=>600,151=>600,152=>600,153=>600,154=>600,155=>600,156=>600,157=>600,158=>600,159=>600,160=>600,161=>600,162=>600,163=>600,164=>600,165=>600,166=>600,167=>600,168=>600,169=>600,170=>600,171=>600,172=>600,173=>600,174=>600,175=>600,176=>600,177=>600,178=>600,179=>600,180=>600,181=>600,182=>600,183=>600,184=>600,185=>600,186=>600,187=>600,188=>600,189=>600,190=>600,191=>600,192=>600,193=>600,194=>600,195=>600,196=>600,197=>600,198=>600,199=>600,200=>600,201=>600,202=>600,203=>600,204=>600,205=>600,206=>600,207=>600,208=>600,209=>600,210=>600,211=>600,212=>600,213=>600,214=>600,215=>600,216=>600,217=>600,218=>600,219=>600,220=>600,221=>600,222=>600,223=>600,224=>600,225=>600,226=>600,227=>600,228=>600,229=>600,230=>600,231=>600,232=>600,233=>600,234=>600,235=>600,236=>600,237=>600,238=>600,239=>600,240=>600,241=>600,242=>600,243=>600,244=>600,245=>600,246=>600,247=>600,248=>600,249=>600,250=>600,251=>600,252=>600,253=>600,254=>600,255=>600);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/helvetica.php RENAMED
@@ -1,13 +1,13 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Helvetica';
5
- $up=-100;
6
- $ut=50;
7
- $dw=513;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>32,'FontBBox'=>'[-166 -225 1000 931]','ItalicAngle'=>0,'Ascent'=>931,'Descent'=>-225,'Leading'=>0,'CapHeight'=>718,'XHeight'=>523,'StemV'=>88,'StemH'=>76,'AvgWidth'=>513,'MaxWidth'=>1015,'MissingWidth'=>513);
11
- $cw=array(0=>500,1=>500,2=>500,3=>500,4=>500,5=>500,6=>500,7=>500,8=>500,9=>500,10=>500,11=>500,12=>500,13=>500,14=>500,15=>500,16=>500,17=>500,18=>500,19=>500,20=>500,21=>500,22=>500,23=>500,24=>500,25=>500,26=>500,27=>500,28=>500,29=>500,30=>500,31=>500,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>277,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,127=>500,128=>655,129=>500,130=>222,131=>278,132=>333,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>250,140=>1000,141=>500,142=>611,143=>500,144=>500,145=>222,146=>221,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>500,155=>250,156=>938,157=>500,158=>500,159=>667,160=>278,161=>278,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>448,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584,178=>350,179=>350,180=>333,181=>556,182=>537,183=>278,184=>333,185=>350,186=>365,187=>448,188=>869,189=>869,190=>879,191=>556,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>666,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>896,231=>500,232=>556,233=>556,234=>556,235=>556,236=>251,237=>251,238=>251,239=>251,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>555,255=>500);
12
-
13
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Helvetica';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=513;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>32,'FontBBox'=>'[-166 -225 1000 931]','ItalicAngle'=>0,'Ascent'=>931,'Descent'=>-225,'Leading'=>0,'CapHeight'=>718,'XHeight'=>523,'StemV'=>88,'StemH'=>76,'AvgWidth'=>513,'MaxWidth'=>1015,'MissingWidth'=>513);
11
+ $cw=array(0=>500,1=>500,2=>500,3=>500,4=>500,5=>500,6=>500,7=>500,8=>500,9=>500,10=>500,11=>500,12=>500,13=>500,14=>500,15=>500,16=>500,17=>500,18=>500,19=>500,20=>500,21=>500,22=>500,23=>500,24=>500,25=>500,26=>500,27=>500,28=>500,29=>500,30=>500,31=>500,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>277,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,127=>500,128=>655,129=>500,130=>222,131=>278,132=>333,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>250,140=>1000,141=>500,142=>611,143=>500,144=>500,145=>222,146=>221,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>500,155=>250,156=>938,157=>500,158=>500,159=>667,160=>278,161=>278,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>448,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584,178=>350,179=>350,180=>333,181=>556,182=>537,183=>278,184=>333,185=>350,186=>365,187=>448,188=>869,189=>869,190=>879,191=>556,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>666,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>896,231=>500,232=>556,233=>556,234=>556,235=>556,236=>251,237=>251,238=>251,239=>251,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>555,255=>500);
12
+
13
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/helveticab.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Helvetica-Bold';
5
- $up=-100;
6
- $ut=50;
7
- $dw=535;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>32,'FontBBox'=>'[-170 -228 1003 962]','ItalicAngle'=>0,'Ascent'=>962,'Descent'=>-228,'Leading'=>0,'CapHeight'=>718,'XHeight'=>532,'StemV'=>140,'StemH'=>118,'AvgWidth'=>535,'MaxWidth'=>1000,'MissingWidth'=>535);
11
- $cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278,10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278,20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278,30=>278,31=>278,32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333,60=>584,61=>584,62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>333,92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556,100=>611,101=>556,102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278,109=>889,110=>611,111=>611,112=>611,113=>611,114=>389,115=>556,116=>333,117=>611,118=>556,119=>778,120=>556,121=>556,122=>500,123=>389,124=>280,125=>389,126=>584,127=>350,128=>556,129=>350,130=>278,131=>556,132=>500,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350,145=>278,146=>278,147=>500,148=>500,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>556,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>280,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333,181=>611,182=>556,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>611,241=>611,242=>611,243=>611,244=>611,245=>611,246=>611,247=>584,248=>611,249=>611,250=>611,251=>611,252=>611,253=>556,254=>611,255=>556);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Helvetica-Bold';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=535;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>32,'FontBBox'=>'[-170 -228 1003 962]','ItalicAngle'=>0,'Ascent'=>962,'Descent'=>-228,'Leading'=>0,'CapHeight'=>718,'XHeight'=>532,'StemV'=>140,'StemH'=>118,'AvgWidth'=>535,'MaxWidth'=>1000,'MissingWidth'=>535);
11
+ $cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278,10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278,20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278,30=>278,31=>278,32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333,60=>584,61=>584,62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>333,92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556,100=>611,101=>556,102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278,109=>889,110=>611,111=>611,112=>611,113=>611,114=>389,115=>556,116=>333,117=>611,118=>556,119=>778,120=>556,121=>556,122=>500,123=>389,124=>280,125=>389,126=>584,127=>350,128=>556,129=>350,130=>278,131=>556,132=>500,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350,145=>278,146=>278,147=>500,148=>500,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>556,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>280,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333,181=>611,182=>556,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>611,241=>611,242=>611,243=>611,244=>611,245=>611,246=>611,247=>584,248=>611,249=>611,250=>611,251=>611,252=>611,253=>556,254=>611,255=>556);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/helveticabi.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Helvetica-BoldOblique';
5
- $up=-100;
6
- $ut=50;
7
- $dw=535;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>96,'FontBBox'=>'[-174 -228 1114 962]','ItalicAngle'=>-12,'Ascent'=>962,'Descent'=>-228,'Leading'=>0,'CapHeight'=>718,'XHeight'=>532,'StemV'=>140,'StemH'=>118,'AvgWidth'=>535,'MaxWidth'=>1000,'MissingWidth'=>535);
11
- $cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278,10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278,20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278,30=>278,31=>278,32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333,60=>584,61=>584,62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>333,92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556,100=>611,101=>556,102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278,109=>889,110=>611,111=>611,112=>611,113=>611,114=>389,115=>556,116=>333,117=>611,118=>556,119=>778,120=>556,121=>556,122=>500,123=>389,124=>280,125=>389,126=>584,127=>350,128=>556,129=>350,130=>278,131=>556,132=>500,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350,145=>278,146=>278,147=>500,148=>500,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>556,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>280,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333,181=>611,182=>556,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>611,241=>611,242=>611,243=>611,244=>611,245=>611,246=>611,247=>584,248=>611,249=>611,250=>611,251=>611,252=>611,253=>556,254=>611,255=>556);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Helvetica-BoldOblique';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=535;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>96,'FontBBox'=>'[-174 -228 1114 962]','ItalicAngle'=>-12,'Ascent'=>962,'Descent'=>-228,'Leading'=>0,'CapHeight'=>718,'XHeight'=>532,'StemV'=>140,'StemH'=>118,'AvgWidth'=>535,'MaxWidth'=>1000,'MissingWidth'=>535);
11
+ $cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278,10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278,20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278,30=>278,31=>278,32=>278,33=>333,34=>474,35=>556,36=>556,37=>889,38=>722,39=>238,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>333,59=>333,60=>584,61=>584,62=>584,63=>611,64=>975,65=>722,66=>722,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>556,75=>722,76=>611,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>333,92=>278,93=>333,94=>584,95=>556,96=>333,97=>556,98=>611,99=>556,100=>611,101=>556,102=>333,103=>611,104=>611,105=>278,106=>278,107=>556,108=>278,109=>889,110=>611,111=>611,112=>611,113=>611,114=>389,115=>556,116=>333,117=>611,118=>556,119=>778,120=>556,121=>556,122=>500,123=>389,124=>280,125=>389,126=>584,127=>350,128=>556,129=>350,130=>278,131=>556,132=>500,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350,145=>278,146=>278,147=>500,148=>500,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>556,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>280,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333,181=>611,182=>556,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>889,231=>556,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>611,241=>611,242=>611,243=>611,244=>611,245=>611,246=>611,247=>584,248=>611,249=>611,250=>611,251=>611,252=>611,253=>556,254=>611,255=>556);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/helveticai.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Helvetica-Oblique';
5
- $up=-100;
6
- $ut=50;
7
- $dw=513;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>96,'FontBBox'=>'[-170 -225 1116 931]','ItalicAngle'=>-12,'Ascent'=>931,'Descent'=>-225,'Leading'=>0,'CapHeight'=>718,'XHeight'=>523,'StemV'=>88,'StemH'=>76,'AvgWidth'=>513,'MaxWidth'=>1015,'MissingWidth'=>513);
11
- $cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278,10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278,20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278,30=>278,31=>278,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>278,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,127=>350,128=>556,129=>350,130=>222,131=>556,132=>333,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350,145=>222,146=>222,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>500,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333,181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Helvetica-Oblique';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=513;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>96,'FontBBox'=>'[-170 -225 1116 931]','ItalicAngle'=>-12,'Ascent'=>931,'Descent'=>-225,'Leading'=>0,'CapHeight'=>718,'XHeight'=>523,'StemV'=>88,'StemH'=>76,'AvgWidth'=>513,'MaxWidth'=>1015,'MissingWidth'=>513);
11
+ $cw=array(0=>278,1=>278,2=>278,3=>278,4=>278,5=>278,6=>278,7=>278,8=>278,9=>278,10=>278,11=>278,12=>278,13=>278,14=>278,15=>278,16=>278,17=>278,18=>278,19=>278,20=>278,21=>278,22=>278,23=>278,24=>278,25=>278,26=>278,27=>278,28=>278,29=>278,30=>278,31=>278,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>278,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,127=>350,128=>556,129=>350,130=>222,131=>556,132=>333,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>333,140=>1000,141=>350,142=>611,143=>350,144=>350,145=>222,146=>222,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>500,155=>333,156=>944,157=>350,158=>500,159=>667,160=>278,161=>333,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>556,172=>584,173=>333,174=>737,175=>333,176=>400,177=>584,178=>333,179=>333,180=>333,181=>556,182=>537,183=>278,184=>333,185=>333,186=>365,187=>556,188=>834,189=>834,190=>834,191=>611,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>667,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>889,231=>500,232=>556,233=>556,234=>556,235=>556,236=>278,237=>278,238=>278,239=>278,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/stsongstdlight.php RENAMED
@@ -1,39 +1,39 @@
1
- <?php
2
- $type = 'cidfont0';
3
- $name = 'STSongStd-Light-Acro';
4
- $displayname = 'STSong Light (Simp. Chinese)';
5
- $desc = array(
6
- 'Ascent' => 752,
7
- 'Descent' => -271,
8
- 'CapHeight' => 737,
9
- 'Flags' => 6,
10
- 'FontBBox' => '[-25 -254 1000 880]',
11
- 'ItalicAngle' => 0,
12
- 'StemV' => 58,
13
- 'Style' => '<< /Panose <000000000400000000000000> >>',
14
- );
15
- $cidinfo = array(
16
- 'Registry' => 'Adobe',
17
- 'Ordering' => 'GB1',
18
- 'Supplement' => '2',
19
- );
20
- $enc = 'UniGB-UCS2-H';
21
-
22
- // underline position, needs checking:
23
- $up = -130;
24
- $ut = 40;
25
-
26
- $dw = 1000;
27
- $cw = array(
28
- 32 => 207, 33 => 270, 34 => 342, 35 => 467, 36 => 462, 37 => 797, 38 => 710, 39 => 239, 40 => 374, 41 => 374,
29
- 42 => 423, 43 => 605, 44 => 238, 45 => 375, 46 => 238, 47 => 334, 48 => 462, 49 => 462, 50 => 462, 51 => 462,
30
- 52 => 462, 53 => 462, 54 => 462, 55 => 462, 56 => 462, 57 => 462, 58 => 238, 59 => 238, 60 => 605, 61 => 605,
31
- 62 => 605, 63 => 344, 64 => 748, 65 => 684, 66 => 560, 67 => 695, 68 => 739, 69 => 563, 70 => 511, 71 => 729,
32
- 72 => 793, 73 => 318, 74 => 312, 75 => 666, 76 => 526, 77 => 896, 78 => 758, 79 => 772, 80 => 544, 81 => 772,
33
- 82 => 628, 83 => 465, 84 => 607, 85 => 753, 86 => 711, 87 => 972, 88 => 647, 89 => 620, 90 => 607, 91 => 374,
34
- 92 => 333, 93 => 374, 94 => 606, 95 => 500, 96 => 239, 97 => 417, 98 => 503, 99 => 427, 100 => 529, 101 => 415,
35
- 102 => 264, 103 => 444, 104 => 518, 105 => 241, 106 => 230, 107 => 495, 108 => 228, 109 => 793, 110 => 527, 111 => 524,
36
- 112 => 524, 113 => 504, 114 => 338, 115 => 336, 116 => 277, 117 => 517, 118 => 450, 119 => 652, 120 => 466, 121 => 452,
37
- 122 => 407, 123 => 370, 124 => 258, 125 => 370, 126 => 605
38
- );
39
- // --- EOF ---
1
+ <?php
2
+ $type = 'cidfont0';
3
+ $name = 'STSongStd-Light-Acro';
4
+ $displayname = 'STSong Light (Simp. Chinese)';
5
+ $desc = array(
6
+ 'Ascent' => 752,
7
+ 'Descent' => -271,
8
+ 'CapHeight' => 737,
9
+ 'Flags' => 6,
10
+ 'FontBBox' => '[-25 -254 1000 880]',
11
+ 'ItalicAngle' => 0,
12
+ 'StemV' => 58,
13
+ 'Style' => '<< /Panose <000000000400000000000000> >>',
14
+ );
15
+ $cidinfo = array(
16
+ 'Registry' => 'Adobe',
17
+ 'Ordering' => 'GB1',
18
+ 'Supplement' => '2',
19
+ );
20
+ $enc = 'UniGB-UCS2-H';
21
+
22
+ // underline position, needs checking:
23
+ $up = -130;
24
+ $ut = 40;
25
+
26
+ $dw = 1000;
27
+ $cw = array(
28
+ 32 => 207, 33 => 270, 34 => 342, 35 => 467, 36 => 462, 37 => 797, 38 => 710, 39 => 239, 40 => 374, 41 => 374,
29
+ 42 => 423, 43 => 605, 44 => 238, 45 => 375, 46 => 238, 47 => 334, 48 => 462, 49 => 462, 50 => 462, 51 => 462,
30
+ 52 => 462, 53 => 462, 54 => 462, 55 => 462, 56 => 462, 57 => 462, 58 => 238, 59 => 238, 60 => 605, 61 => 605,
31
+ 62 => 605, 63 => 344, 64 => 748, 65 => 684, 66 => 560, 67 => 695, 68 => 739, 69 => 563, 70 => 511, 71 => 729,
32
+ 72 => 793, 73 => 318, 74 => 312, 75 => 666, 76 => 526, 77 => 896, 78 => 758, 79 => 772, 80 => 544, 81 => 772,
33
+ 82 => 628, 83 => 465, 84 => 607, 85 => 753, 86 => 711, 87 => 972, 88 => 647, 89 => 620, 90 => 607, 91 => 374,
34
+ 92 => 333, 93 => 374, 94 => 606, 95 => 500, 96 => 239, 97 => 417, 98 => 503, 99 => 427, 100 => 529, 101 => 415,
35
+ 102 => 264, 103 => 444, 104 => 518, 105 => 241, 106 => 230, 107 => 495, 108 => 228, 109 => 793, 110 => 527, 111 => 524,
36
+ 112 => 524, 113 => 504, 114 => 338, 115 => 336, 116 => 277, 117 => 517, 118 => 450, 119 => 652, 120 => 466, 121 => 452,
37
+ 122 => 407, 123 => 370, 124 => 258, 125 => 370, 126 => 605
38
+ );
39
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/symbol.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Symbol';
5
- $up=-100;
6
- $ut=50;
7
- $dw=587;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>4,'FontBBox'=>'[-180 -293 1090 1010]','ItalicAngle'=>0,'Ascent'=>1010,'Descent'=>-293,'Leading'=>0,'CapHeight'=>1010,'StemV'=>85,'StemH'=>92,'AvgWidth'=>587,'MaxWidth'=>1042,'MissingWidth'=>587);
11
- $cw=array(0=>587,1=>587,2=>587,3=>587,4=>587,5=>587,6=>587,7=>587,8=>587,9=>587,10=>587,11=>587,12=>587,13=>587,14=>587,15=>587,16=>587,17=>587,18=>587,19=>587,20=>587,21=>587,22=>587,23=>587,24=>587,25=>587,26=>587,27=>587,28=>587,29=>587,30=>587,31=>587,32=>250,33=>333,34=>713,35=>500,36=>549,37=>833,38=>778,39=>439,40=>333,41=>333,42=>500,43=>549,44=>250,45=>549,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278,60=>549,61=>549,62=>549,63=>444,64=>549,65=>722,66=>667,67=>722,68=>612,69=>611,70=>763,71=>603,72=>722,73=>333,74=>631,75=>722,76=>686,77=>889,78=>722,79=>722,80=>768,81=>741,82=>556,83=>592,84=>611,85=>690,86=>439,87=>768,88=>645,89=>795,90=>611,91=>333,92=>863,93=>333,94=>658,95=>500,96=>500,97=>631,98=>549,99=>549,100=>494,101=>439,102=>521,103=>411,104=>603,105=>329,106=>603,107=>549,108=>549,109=>576,110=>521,111=>549,112=>549,113=>521,114=>549,115=>603,116=>439,117=>576,118=>713,119=>686,120=>493,121=>686,122=>494,123=>480,124=>200,125=>480,126=>549,127=>587,128=>587,129=>587,130=>587,131=>587,132=>587,133=>587,134=>587,135=>587,136=>587,137=>587,138=>587,139=>587,140=>587,141=>587,142=>587,143=>587,144=>587,145=>587,146=>587,147=>587,148=>587,149=>587,150=>587,151=>587,152=>587,153=>587,154=>587,155=>587,156=>587,157=>587,158=>587,159=>587,160=>750,161=>620,162=>247,163=>549,164=>167,165=>713,166=>500,167=>753,168=>753,169=>753,170=>753,171=>1042,172=>987,173=>603,174=>987,175=>603,176=>400,177=>549,178=>411,179=>549,180=>549,181=>713,182=>494,183=>460,184=>549,185=>549,186=>549,187=>549,188=>1000,189=>603,190=>1000,191=>658,192=>823,193=>686,194=>795,195=>987,196=>768,197=>768,198=>823,199=>768,200=>768,201=>713,202=>713,203=>713,204=>713,205=>713,206=>713,207=>713,208=>768,209=>713,210=>790,211=>790,212=>890,213=>823,214=>549,215=>250,216=>713,217=>603,218=>603,219=>1042,220=>987,221=>603,222=>987,223=>603,224=>494,225=>329,226=>790,227=>790,228=>786,229=>713,230=>384,231=>384,232=>384,233=>384,234=>384,235=>384,236=>494,237=>494,238=>494,239=>494,240=>587,241=>329,242=>274,243=>686,244=>686,245=>686,246=>384,247=>384,248=>384,249=>384,250=>384,251=>384,252=>494,253=>494,254=>494,255=>587);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Symbol';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=587;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>4,'FontBBox'=>'[-180 -293 1090 1010]','ItalicAngle'=>0,'Ascent'=>1010,'Descent'=>-293,'Leading'=>0,'CapHeight'=>1010,'StemV'=>85,'StemH'=>92,'AvgWidth'=>587,'MaxWidth'=>1042,'MissingWidth'=>587);
11
+ $cw=array(0=>587,1=>587,2=>587,3=>587,4=>587,5=>587,6=>587,7=>587,8=>587,9=>587,10=>587,11=>587,12=>587,13=>587,14=>587,15=>587,16=>587,17=>587,18=>587,19=>587,20=>587,21=>587,22=>587,23=>587,24=>587,25=>587,26=>587,27=>587,28=>587,29=>587,30=>587,31=>587,32=>250,33=>333,34=>713,35=>500,36=>549,37=>833,38=>778,39=>439,40=>333,41=>333,42=>500,43=>549,44=>250,45=>549,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278,60=>549,61=>549,62=>549,63=>444,64=>549,65=>722,66=>667,67=>722,68=>612,69=>611,70=>763,71=>603,72=>722,73=>333,74=>631,75=>722,76=>686,77=>889,78=>722,79=>722,80=>768,81=>741,82=>556,83=>592,84=>611,85=>690,86=>439,87=>768,88=>645,89=>795,90=>611,91=>333,92=>863,93=>333,94=>658,95=>500,96=>500,97=>631,98=>549,99=>549,100=>494,101=>439,102=>521,103=>411,104=>603,105=>329,106=>603,107=>549,108=>549,109=>576,110=>521,111=>549,112=>549,113=>521,114=>549,115=>603,116=>439,117=>576,118=>713,119=>686,120=>493,121=>686,122=>494,123=>480,124=>200,125=>480,126=>549,127=>587,128=>587,129=>587,130=>587,131=>587,132=>587,133=>587,134=>587,135=>587,136=>587,137=>587,138=>587,139=>587,140=>587,141=>587,142=>587,143=>587,144=>587,145=>587,146=>587,147=>587,148=>587,149=>587,150=>587,151=>587,152=>587,153=>587,154=>587,155=>587,156=>587,157=>587,158=>587,159=>587,160=>750,161=>620,162=>247,163=>549,164=>167,165=>713,166=>500,167=>753,168=>753,169=>753,170=>753,171=>1042,172=>987,173=>603,174=>987,175=>603,176=>400,177=>549,178=>411,179=>549,180=>549,181=>713,182=>494,183=>460,184=>549,185=>549,186=>549,187=>549,188=>1000,189=>603,190=>1000,191=>658,192=>823,193=>686,194=>795,195=>987,196=>768,197=>768,198=>823,199=>768,200=>768,201=>713,202=>713,203=>713,204=>713,205=>713,206=>713,207=>713,208=>768,209=>713,210=>790,211=>790,212=>890,213=>823,214=>549,215=>250,216=>713,217=>603,218=>603,219=>1042,220=>987,221=>603,222=>987,223=>603,224=>494,225=>329,226=>790,227=>790,228=>786,229=>713,230=>384,231=>384,232=>384,233=>384,234=>384,235=>384,236=>494,237=>494,238=>494,239=>494,240=>587,241=>329,242=>274,243=>686,244=>686,245=>686,246=>384,247=>384,248=>384,249=>384,250=>384,251=>384,252=>494,253=>494,254=>494,255=>587);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/times.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Times-Roman';
5
- $up=-100;
6
- $ut=50;
7
- $dw=495;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>32,'FontBBox'=>'[-168 -218 1000 898]','ItalicAngle'=>0,'Ascent'=>898,'Descent'=>-218,'Leading'=>0,'CapHeight'=>662,'XHeight'=>450,'StemV'=>84,'StemH'=>28,'AvgWidth'=>495,'MaxWidth'=>1000,'MissingWidth'=>495);
11
- $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>333,34=>408,35=>500,36=>500,37=>833,38=>778,39=>180,40=>333,41=>333,42=>500,43=>564,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278,60=>564,61=>564,62=>564,63=>444,64=>921,65=>722,66=>667,67=>667,68=>722,69=>611,70=>556,71=>722,72=>722,73=>333,74=>389,75=>722,76=>611,77=>889,78=>722,79=>722,80=>556,81=>722,82=>667,83=>556,84=>611,85=>722,86=>722,87=>944,88=>722,89=>722,90=>611,91=>333,92=>278,93=>333,94=>469,95=>500,96=>333,97=>444,98=>500,99=>444,100=>500,101=>444,102=>333,103=>500,104=>500,105=>278,106=>278,107=>500,108=>278,109=>778,110=>500,111=>500,112=>500,113=>500,114=>333,115=>389,116=>278,117=>500,118=>500,119=>722,120=>500,121=>500,122=>444,123=>480,124=>200,125=>480,126=>541,127=>350,128=>500,129=>350,130=>333,131=>500,132=>444,133=>1000,134=>500,135=>500,136=>333,137=>1000,138=>556,139=>333,140=>889,141=>350,142=>611,143=>350,144=>350,145=>333,146=>333,147=>444,148=>444,149=>350,150=>500,151=>1000,152=>333,153=>980,154=>389,155=>333,156=>722,157=>350,158=>444,159=>722,160=>250,161=>333,162=>500,163=>500,164=>500,165=>500,166=>200,167=>500,168=>333,169=>760,170=>276,171=>500,172=>564,173=>333,174=>760,175=>333,176=>400,177=>564,178=>300,179=>300,180=>333,181=>500,182=>453,183=>250,184=>333,185=>300,186=>310,187=>500,188=>750,189=>750,190=>750,191=>444,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>889,199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333,208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>564,216=>722,217=>722,218=>722,219=>722,220=>722,221=>722,222=>556,223=>500,224=>444,225=>444,226=>444,227=>444,228=>444,229=>444,230=>667,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>500,242=>500,243=>500,244=>500,245=>500,246=>500,247=>564,248=>500,249=>500,250=>500,251=>500,252=>500,253=>500,254=>500,255=>500);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Times-Roman';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=495;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>32,'FontBBox'=>'[-168 -218 1000 898]','ItalicAngle'=>0,'Ascent'=>898,'Descent'=>-218,'Leading'=>0,'CapHeight'=>662,'XHeight'=>450,'StemV'=>84,'StemH'=>28,'AvgWidth'=>495,'MaxWidth'=>1000,'MissingWidth'=>495);
11
+ $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>333,34=>408,35=>500,36=>500,37=>833,38=>778,39=>180,40=>333,41=>333,42=>500,43=>564,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>278,59=>278,60=>564,61=>564,62=>564,63=>444,64=>921,65=>722,66=>667,67=>667,68=>722,69=>611,70=>556,71=>722,72=>722,73=>333,74=>389,75=>722,76=>611,77=>889,78=>722,79=>722,80=>556,81=>722,82=>667,83=>556,84=>611,85=>722,86=>722,87=>944,88=>722,89=>722,90=>611,91=>333,92=>278,93=>333,94=>469,95=>500,96=>333,97=>444,98=>500,99=>444,100=>500,101=>444,102=>333,103=>500,104=>500,105=>278,106=>278,107=>500,108=>278,109=>778,110=>500,111=>500,112=>500,113=>500,114=>333,115=>389,116=>278,117=>500,118=>500,119=>722,120=>500,121=>500,122=>444,123=>480,124=>200,125=>480,126=>541,127=>350,128=>500,129=>350,130=>333,131=>500,132=>444,133=>1000,134=>500,135=>500,136=>333,137=>1000,138=>556,139=>333,140=>889,141=>350,142=>611,143=>350,144=>350,145=>333,146=>333,147=>444,148=>444,149=>350,150=>500,151=>1000,152=>333,153=>980,154=>389,155=>333,156=>722,157=>350,158=>444,159=>722,160=>250,161=>333,162=>500,163=>500,164=>500,165=>500,166=>200,167=>500,168=>333,169=>760,170=>276,171=>500,172=>564,173=>333,174=>760,175=>333,176=>400,177=>564,178=>300,179=>300,180=>333,181=>500,182=>453,183=>250,184=>333,185=>300,186=>310,187=>500,188=>750,189=>750,190=>750,191=>444,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>889,199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333,208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>564,216=>722,217=>722,218=>722,219=>722,220=>722,221=>722,222=>556,223=>500,224=>444,225=>444,226=>444,227=>444,228=>444,229=>444,230=>667,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>500,242=>500,243=>500,244=>500,245=>500,246=>500,247=>564,248=>500,249=>500,250=>500,251=>500,252=>500,253=>500,254=>500,255=>500);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/timesb.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Times-Bold';
5
- $up=-100;
6
- $ut=50;
7
- $dw=516;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>32,'FontBBox'=>'[-168 -218 1000 935]','ItalicAngle'=>0,'Ascent'=>935,'Descent'=>-218,'Leading'=>0,'CapHeight'=>676,'XHeight'=>461,'StemV'=>139,'StemH'=>44,'AvgWidth'=>516,'MaxWidth'=>1000,'MissingWidth'=>516);
11
- $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>333,34=>555,35=>500,36=>500,37=>1000,38=>833,39=>278,40=>333,41=>333,42=>500,43=>570,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>570,61=>570,62=>570,63=>500,64=>930,65=>722,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>778,73=>389,74=>500,75=>778,76=>667,77=>944,78=>722,79=>778,80=>611,81=>778,82=>722,83=>556,84=>667,85=>722,86=>722,87=>1000,88=>722,89=>722,90=>667,91=>333,92=>278,93=>333,94=>581,95=>500,96=>333,97=>500,98=>556,99=>444,100=>556,101=>444,102=>333,103=>500,104=>556,105=>278,106=>333,107=>556,108=>278,109=>833,110=>556,111=>500,112=>556,113=>556,114=>444,115=>389,116=>333,117=>556,118=>500,119=>722,120=>500,121=>500,122=>444,123=>394,124=>220,125=>394,126=>520,127=>350,128=>500,129=>350,130=>333,131=>500,132=>500,133=>1000,134=>500,135=>500,136=>333,137=>1000,138=>556,139=>333,140=>1000,141=>350,142=>667,143=>350,144=>350,145=>333,146=>333,147=>500,148=>500,149=>350,150=>500,151=>1000,152=>333,153=>1000,154=>389,155=>333,156=>722,157=>350,158=>444,159=>722,160=>250,161=>333,162=>500,163=>500,164=>500,165=>500,166=>220,167=>500,168=>333,169=>747,170=>300,171=>500,172=>570,173=>333,174=>747,175=>333,176=>400,177=>570,178=>300,179=>300,180=>333,181=>556,182=>540,183=>250,184=>333,185=>300,186=>330,187=>500,188=>750,189=>750,190=>750,191=>500,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>570,216=>778,217=>722,218=>722,219=>722,220=>722,221=>722,222=>611,223=>556,224=>500,225=>500,226=>500,227=>500,228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>556,242=>500,243=>500,244=>500,245=>500,246=>500,247=>570,248=>500,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Times-Bold';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=516;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>32,'FontBBox'=>'[-168 -218 1000 935]','ItalicAngle'=>0,'Ascent'=>935,'Descent'=>-218,'Leading'=>0,'CapHeight'=>676,'XHeight'=>461,'StemV'=>139,'StemH'=>44,'AvgWidth'=>516,'MaxWidth'=>1000,'MissingWidth'=>516);
11
+ $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>333,34=>555,35=>500,36=>500,37=>1000,38=>833,39=>278,40=>333,41=>333,42=>500,43=>570,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>570,61=>570,62=>570,63=>500,64=>930,65=>722,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>778,73=>389,74=>500,75=>778,76=>667,77=>944,78=>722,79=>778,80=>611,81=>778,82=>722,83=>556,84=>667,85=>722,86=>722,87=>1000,88=>722,89=>722,90=>667,91=>333,92=>278,93=>333,94=>581,95=>500,96=>333,97=>500,98=>556,99=>444,100=>556,101=>444,102=>333,103=>500,104=>556,105=>278,106=>333,107=>556,108=>278,109=>833,110=>556,111=>500,112=>556,113=>556,114=>444,115=>389,116=>333,117=>556,118=>500,119=>722,120=>500,121=>500,122=>444,123=>394,124=>220,125=>394,126=>520,127=>350,128=>500,129=>350,130=>333,131=>500,132=>500,133=>1000,134=>500,135=>500,136=>333,137=>1000,138=>556,139=>333,140=>1000,141=>350,142=>667,143=>350,144=>350,145=>333,146=>333,147=>500,148=>500,149=>350,150=>500,151=>1000,152=>333,153=>1000,154=>389,155=>333,156=>722,157=>350,158=>444,159=>722,160=>250,161=>333,162=>500,163=>500,164=>500,165=>500,166=>220,167=>500,168=>333,169=>747,170=>300,171=>500,172=>570,173=>333,174=>747,175=>333,176=>400,177=>570,178=>300,179=>300,180=>333,181=>556,182=>540,183=>250,184=>333,185=>300,186=>330,187=>500,188=>750,189=>750,190=>750,191=>500,192=>722,193=>722,194=>722,195=>722,196=>722,197=>722,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>570,216=>778,217=>722,218=>722,219=>722,220=>722,221=>722,222=>611,223=>556,224=>500,225=>500,226=>500,227=>500,228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>556,242=>500,243=>500,244=>500,245=>500,246=>500,247=>570,248=>500,249=>556,250=>556,251=>556,252=>556,253=>500,254=>556,255=>500);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/timesbi.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Times-BoldItalic';
5
- $up=-100;
6
- $ut=50;
7
- $dw=501;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>96,'FontBBox'=>'[-200 -218 996 921]','ItalicAngle'=>-15,'Ascent'=>921,'Descent'=>-218,'Leading'=>0,'CapHeight'=>669,'XHeight'=>462,'StemV'=>121,'StemH'=>42,'AvgWidth'=>501,'MaxWidth'=>1000,'MissingWidth'=>501);
11
- $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>389,34=>555,35=>500,36=>500,37=>833,38=>778,39=>278,40=>333,41=>333,42=>500,43=>570,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>570,61=>570,62=>570,63=>500,64=>832,65=>667,66=>667,67=>667,68=>722,69=>667,70=>667,71=>722,72=>778,73=>389,74=>500,75=>667,76=>611,77=>889,78=>722,79=>722,80=>611,81=>722,82=>667,83=>556,84=>611,85=>722,86=>667,87=>889,88=>667,89=>611,90=>611,91=>333,92=>278,93=>333,94=>570,95=>500,96=>333,97=>500,98=>500,99=>444,100=>500,101=>444,102=>333,103=>500,104=>556,105=>278,106=>278,107=>500,108=>278,109=>778,110=>556,111=>500,112=>500,113=>500,114=>389,115=>389,116=>278,117=>556,118=>444,119=>667,120=>500,121=>444,122=>389,123=>348,124=>220,125=>348,126=>570,127=>350,128=>500,129=>350,130=>333,131=>500,132=>500,133=>1000,134=>500,135=>500,136=>333,137=>1000,138=>556,139=>333,140=>944,141=>350,142=>611,143=>350,144=>350,145=>333,146=>333,147=>500,148=>500,149=>350,150=>500,151=>1000,152=>333,153=>1000,154=>389,155=>333,156=>722,157=>350,158=>389,159=>611,160=>250,161=>389,162=>500,163=>500,164=>500,165=>500,166=>220,167=>500,168=>333,169=>747,170=>266,171=>500,172=>606,173=>333,174=>747,175=>333,176=>400,177=>570,178=>300,179=>300,180=>333,181=>576,182=>500,183=>250,184=>333,185=>300,186=>300,187=>500,188=>750,189=>750,190=>750,191=>500,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>944,199=>667,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389,208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>570,216=>722,217=>722,218=>722,219=>722,220=>722,221=>611,222=>611,223=>500,224=>500,225=>500,226=>500,227=>500,228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>556,242=>500,243=>500,244=>500,245=>500,246=>500,247=>570,248=>500,249=>556,250=>556,251=>556,252=>556,253=>444,254=>500,255=>444);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Times-BoldItalic';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=501;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>96,'FontBBox'=>'[-200 -218 996 921]','ItalicAngle'=>-15,'Ascent'=>921,'Descent'=>-218,'Leading'=>0,'CapHeight'=>669,'XHeight'=>462,'StemV'=>121,'StemH'=>42,'AvgWidth'=>501,'MaxWidth'=>1000,'MissingWidth'=>501);
11
+ $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>389,34=>555,35=>500,36=>500,37=>833,38=>778,39=>278,40=>333,41=>333,42=>500,43=>570,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>570,61=>570,62=>570,63=>500,64=>832,65=>667,66=>667,67=>667,68=>722,69=>667,70=>667,71=>722,72=>778,73=>389,74=>500,75=>667,76=>611,77=>889,78=>722,79=>722,80=>611,81=>722,82=>667,83=>556,84=>611,85=>722,86=>667,87=>889,88=>667,89=>611,90=>611,91=>333,92=>278,93=>333,94=>570,95=>500,96=>333,97=>500,98=>500,99=>444,100=>500,101=>444,102=>333,103=>500,104=>556,105=>278,106=>278,107=>500,108=>278,109=>778,110=>556,111=>500,112=>500,113=>500,114=>389,115=>389,116=>278,117=>556,118=>444,119=>667,120=>500,121=>444,122=>389,123=>348,124=>220,125=>348,126=>570,127=>350,128=>500,129=>350,130=>333,131=>500,132=>500,133=>1000,134=>500,135=>500,136=>333,137=>1000,138=>556,139=>333,140=>944,141=>350,142=>611,143=>350,144=>350,145=>333,146=>333,147=>500,148=>500,149=>350,150=>500,151=>1000,152=>333,153=>1000,154=>389,155=>333,156=>722,157=>350,158=>389,159=>611,160=>250,161=>389,162=>500,163=>500,164=>500,165=>500,166=>220,167=>500,168=>333,169=>747,170=>266,171=>500,172=>606,173=>333,174=>747,175=>333,176=>400,177=>570,178=>300,179=>300,180=>333,181=>576,182=>500,183=>250,184=>333,185=>300,186=>300,187=>500,188=>750,189=>750,190=>750,191=>500,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>944,199=>667,200=>667,201=>667,202=>667,203=>667,204=>389,205=>389,206=>389,207=>389,208=>722,209=>722,210=>722,211=>722,212=>722,213=>722,214=>722,215=>570,216=>722,217=>722,218=>722,219=>722,220=>722,221=>611,222=>611,223=>500,224=>500,225=>500,226=>500,227=>500,228=>500,229=>500,230=>722,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>556,242=>500,243=>500,244=>500,245=>500,246=>500,247=>570,248=>500,249=>556,250=>556,251=>556,252=>556,253=>444,254=>500,255=>444);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/timesi.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='Times-Italic';
5
- $up=-100;
6
- $ut=50;
7
- $dw=491;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>96,'FontBBox'=>'[-169 -217 1010 883]','ItalicAngle'=>-15.5,'Ascent'=>883,'Descent'=>-217,'Leading'=>0,'CapHeight'=>653,'XHeight'=>441,'StemV'=>76,'StemH'=>32,'AvgWidth'=>491,'MaxWidth'=>1000,'MissingWidth'=>491);
11
- $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>333,34=>420,35=>500,36=>500,37=>833,38=>778,39=>214,40=>333,41=>333,42=>500,43=>675,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>675,61=>675,62=>675,63=>500,64=>920,65=>611,66=>611,67=>667,68=>722,69=>611,70=>611,71=>722,72=>722,73=>333,74=>444,75=>667,76=>556,77=>833,78=>667,79=>722,80=>611,81=>722,82=>611,83=>500,84=>556,85=>722,86=>611,87=>833,88=>611,89=>556,90=>556,91=>389,92=>278,93=>389,94=>422,95=>500,96=>333,97=>500,98=>500,99=>444,100=>500,101=>444,102=>278,103=>500,104=>500,105=>278,106=>278,107=>444,108=>278,109=>722,110=>500,111=>500,112=>500,113=>500,114=>389,115=>389,116=>278,117=>500,118=>444,119=>667,120=>444,121=>444,122=>389,123=>400,124=>275,125=>400,126=>541,127=>350,128=>500,129=>350,130=>333,131=>500,132=>556,133=>889,134=>500,135=>500,136=>333,137=>1000,138=>500,139=>333,140=>944,141=>350,142=>556,143=>350,144=>350,145=>333,146=>333,147=>556,148=>556,149=>350,150=>500,151=>889,152=>333,153=>980,154=>389,155=>333,156=>667,157=>350,158=>389,159=>556,160=>250,161=>389,162=>500,163=>500,164=>500,165=>500,166=>275,167=>500,168=>333,169=>760,170=>276,171=>500,172=>675,173=>333,174=>760,175=>333,176=>400,177=>675,178=>300,179=>300,180=>333,181=>500,182=>523,183=>250,184=>333,185=>300,186=>310,187=>500,188=>750,189=>750,190=>750,191=>500,192=>611,193=>611,194=>611,195=>611,196=>611,197=>611,198=>889,199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333,208=>722,209=>667,210=>722,211=>722,212=>722,213=>722,214=>722,215=>675,216=>722,217=>722,218=>722,219=>722,220=>722,221=>556,222=>611,223=>500,224=>500,225=>500,226=>500,227=>500,228=>500,229=>500,230=>667,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>500,242=>500,243=>500,244=>500,245=>500,246=>500,247=>675,248=>500,249=>500,250=>500,251=>500,252=>500,253=>444,254=>500,255=>444);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='Times-Italic';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=491;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>96,'FontBBox'=>'[-169 -217 1010 883]','ItalicAngle'=>-15.5,'Ascent'=>883,'Descent'=>-217,'Leading'=>0,'CapHeight'=>653,'XHeight'=>441,'StemV'=>76,'StemH'=>32,'AvgWidth'=>491,'MaxWidth'=>1000,'MissingWidth'=>491);
11
+ $cw=array(0=>250,1=>250,2=>250,3=>250,4=>250,5=>250,6=>250,7=>250,8=>250,9=>250,10=>250,11=>250,12=>250,13=>250,14=>250,15=>250,16=>250,17=>250,18=>250,19=>250,20=>250,21=>250,22=>250,23=>250,24=>250,25=>250,26=>250,27=>250,28=>250,29=>250,30=>250,31=>250,32=>250,33=>333,34=>420,35=>500,36=>500,37=>833,38=>778,39=>214,40=>333,41=>333,42=>500,43=>675,44=>250,45=>333,46=>250,47=>278,48=>500,49=>500,50=>500,51=>500,52=>500,53=>500,54=>500,55=>500,56=>500,57=>500,58=>333,59=>333,60=>675,61=>675,62=>675,63=>500,64=>920,65=>611,66=>611,67=>667,68=>722,69=>611,70=>611,71=>722,72=>722,73=>333,74=>444,75=>667,76=>556,77=>833,78=>667,79=>722,80=>611,81=>722,82=>611,83=>500,84=>556,85=>722,86=>611,87=>833,88=>611,89=>556,90=>556,91=>389,92=>278,93=>389,94=>422,95=>500,96=>333,97=>500,98=>500,99=>444,100=>500,101=>444,102=>278,103=>500,104=>500,105=>278,106=>278,107=>444,108=>278,109=>722,110=>500,111=>500,112=>500,113=>500,114=>389,115=>389,116=>278,117=>500,118=>444,119=>667,120=>444,121=>444,122=>389,123=>400,124=>275,125=>400,126=>541,127=>350,128=>500,129=>350,130=>333,131=>500,132=>556,133=>889,134=>500,135=>500,136=>333,137=>1000,138=>500,139=>333,140=>944,141=>350,142=>556,143=>350,144=>350,145=>333,146=>333,147=>556,148=>556,149=>350,150=>500,151=>889,152=>333,153=>980,154=>389,155=>333,156=>667,157=>350,158=>389,159=>556,160=>250,161=>389,162=>500,163=>500,164=>500,165=>500,166=>275,167=>500,168=>333,169=>760,170=>276,171=>500,172=>675,173=>333,174=>760,175=>333,176=>400,177=>675,178=>300,179=>300,180=>333,181=>500,182=>523,183=>250,184=>333,185=>300,186=>310,187=>500,188=>750,189=>750,190=>750,191=>500,192=>611,193=>611,194=>611,195=>611,196=>611,197=>611,198=>889,199=>667,200=>611,201=>611,202=>611,203=>611,204=>333,205=>333,206=>333,207=>333,208=>722,209=>667,210=>722,211=>722,212=>722,213=>722,214=>722,215=>675,216=>722,217=>722,218=>722,219=>722,220=>722,221=>556,222=>611,223=>500,224=>500,225=>500,226=>500,227=>500,228=>500,229=>500,230=>667,231=>444,232=>444,233=>444,234=>444,235=>444,236=>278,237=>278,238=>278,239=>278,240=>500,241=>500,242=>500,243=>500,244=>500,245=>500,246=>500,247=>675,248=>500,249=>500,250=>500,251=>500,252=>500,253=>444,254=>500,255=>444);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/fonts/zapfdingbats.php RENAMED
@@ -1,12 +1,12 @@
1
- <?php
2
- // TCPDF FONT FILE DESCRIPTION
3
- $type='core';
4
- $name='ZapfDingbats';
5
- $up=-100;
6
- $ut=50;
7
- $dw=746;
8
- $diff='';
9
- $enc='';
10
- $desc=array('Flags'=>4,'FontBBox'=>'[-1 -143 981 820]','ItalicAngle'=>0,'Ascent'=>820,'Descent'=>-143,'Leading'=>0,'CapHeight'=>820,'StemV'=>90,'StemH'=>28,'AvgWidth'=>746,'MaxWidth'=>1016,'MissingWidth'=>746);
11
- $cw=array(0=>746,1=>746,2=>746,3=>746,4=>746,5=>746,6=>746,7=>746,8=>746,9=>746,10=>746,11=>746,12=>746,13=>746,14=>746,15=>746,16=>746,17=>746,18=>746,19=>746,20=>746,21=>746,22=>746,23=>746,24=>746,25=>746,26=>746,27=>746,28=>746,29=>746,30=>746,31=>746,32=>278,33=>974,34=>961,35=>974,36=>980,37=>719,38=>789,39=>790,40=>791,41=>690,42=>960,43=>939,44=>549,45=>855,46=>911,47=>933,48=>911,49=>945,50=>974,51=>755,52=>846,53=>762,54=>761,55=>571,56=>677,57=>763,58=>760,59=>759,60=>754,61=>494,62=>552,63=>537,64=>577,65=>692,66=>786,67=>788,68=>788,69=>790,70=>793,71=>794,72=>816,73=>823,74=>789,75=>841,76=>823,77=>833,78=>816,79=>831,80=>923,81=>744,82=>723,83=>749,84=>790,85=>792,86=>695,87=>776,88=>768,89=>792,90=>759,91=>707,92=>708,93=>682,94=>701,95=>826,96=>815,97=>789,98=>789,99=>707,100=>687,101=>696,102=>689,103=>786,104=>787,105=>713,106=>791,107=>785,108=>791,109=>873,110=>761,111=>762,112=>762,113=>759,114=>759,115=>892,116=>892,117=>788,118=>784,119=>438,120=>138,121=>277,122=>415,123=>392,124=>392,125=>668,126=>668,127=>746,128=>390,129=>390,130=>317,131=>317,132=>276,133=>276,134=>509,135=>509,136=>410,137=>410,138=>234,139=>234,140=>334,141=>334,142=>746,143=>746,144=>746,145=>746,146=>746,147=>746,148=>746,149=>746,150=>746,151=>746,152=>746,153=>746,154=>746,155=>746,156=>746,157=>746,158=>746,159=>746,160=>746,161=>732,162=>544,163=>544,164=>910,165=>667,166=>760,167=>760,168=>776,169=>595,170=>694,171=>626,172=>788,173=>788,174=>788,175=>788,176=>788,177=>788,178=>788,179=>788,180=>788,181=>788,182=>788,183=>788,184=>788,185=>788,186=>788,187=>788,188=>788,189=>788,190=>788,191=>788,192=>788,193=>788,194=>788,195=>788,196=>788,197=>788,198=>788,199=>788,200=>788,201=>788,202=>788,203=>788,204=>788,205=>788,206=>788,207=>788,208=>788,209=>788,210=>788,211=>788,212=>894,213=>838,214=>1016,215=>458,216=>748,217=>924,218=>748,219=>918,220=>927,221=>928,222=>928,223=>834,224=>873,225=>828,226=>924,227=>924,228=>917,229=>930,230=>931,231=>463,232=>883,233=>836,234=>836,235=>867,236=>867,237=>696,238=>696,239=>874,240=>746,241=>874,242=>760,243=>946,244=>771,245=>865,246=>771,247=>888,248=>967,249=>888,250=>831,251=>873,252=>927,253=>970,254=>918,255=>746);
12
- // --- EOF ---
1
+ <?php
2
+ // TCPDF FONT FILE DESCRIPTION
3
+ $type='core';
4
+ $name='ZapfDingbats';
5
+ $up=-100;
6
+ $ut=50;
7
+ $dw=746;
8
+ $diff='';
9
+ $enc='';
10
+ $desc=array('Flags'=>4,'FontBBox'=>'[-1 -143 981 820]','ItalicAngle'=>0,'Ascent'=>820,'Descent'=>-143,'Leading'=>0,'CapHeight'=>820,'StemV'=>90,'StemH'=>28,'AvgWidth'=>746,'MaxWidth'=>1016,'MissingWidth'=>746);
11
+ $cw=array(0=>746,1=>746,2=>746,3=>746,4=>746,5=>746,6=>746,7=>746,8=>746,9=>746,10=>746,11=>746,12=>746,13=>746,14=>746,15=>746,16=>746,17=>746,18=>746,19=>746,20=>746,21=>746,22=>746,23=>746,24=>746,25=>746,26=>746,27=>746,28=>746,29=>746,30=>746,31=>746,32=>278,33=>974,34=>961,35=>974,36=>980,37=>719,38=>789,39=>790,40=>791,41=>690,42=>960,43=>939,44=>549,45=>855,46=>911,47=>933,48=>911,49=>945,50=>974,51=>755,52=>846,53=>762,54=>761,55=>571,56=>677,57=>763,58=>760,59=>759,60=>754,61=>494,62=>552,63=>537,64=>577,65=>692,66=>786,67=>788,68=>788,69=>790,70=>793,71=>794,72=>816,73=>823,74=>789,75=>841,76=>823,77=>833,78=>816,79=>831,80=>923,81=>744,82=>723,83=>749,84=>790,85=>792,86=>695,87=>776,88=>768,89=>792,90=>759,91=>707,92=>708,93=>682,94=>701,95=>826,96=>815,97=>789,98=>789,99=>707,100=>687,101=>696,102=>689,103=>786,104=>787,105=>713,106=>791,107=>785,108=>791,109=>873,110=>761,111=>762,112=>762,113=>759,114=>759,115=>892,116=>892,117=>788,118=>784,119=>438,120=>138,121=>277,122=>415,123=>392,124=>392,125=>668,126=>668,127=>746,128=>390,129=>390,130=>317,131=>317,132=>276,133=>276,134=>509,135=>509,136=>410,137=>410,138=>234,139=>234,140=>334,141=>334,142=>746,143=>746,144=>746,145=>746,146=>746,147=>746,148=>746,149=>746,150=>746,151=>746,152=>746,153=>746,154=>746,155=>746,156=>746,157=>746,158=>746,159=>746,160=>746,161=>732,162=>544,163=>544,164=>910,165=>667,166=>760,167=>760,168=>776,169=>595,170=>694,171=>626,172=>788,173=>788,174=>788,175=>788,176=>788,177=>788,178=>788,179=>788,180=>788,181=>788,182=>788,183=>788,184=>788,185=>788,186=>788,187=>788,188=>788,189=>788,190=>788,191=>788,192=>788,193=>788,194=>788,195=>788,196=>788,197=>788,198=>788,199=>788,200=>788,201=>788,202=>788,203=>788,204=>788,205=>788,206=>788,207=>788,208=>788,209=>788,210=>788,211=>788,212=>894,213=>838,214=>1016,215=>458,216=>748,217=>924,218=>748,219=>918,220=>927,221=>928,222=>928,223=>834,224=>873,225=>828,226=>924,227=>924,228=>917,229=>930,230=>931,231=>463,232=>883,233=>836,234=>836,235=>867,236=>867,237=>696,238=>696,239=>874,240=>746,241=>874,242=>760,243=>946,244=>771,245=>865,246=>771,247=>888,248=>967,249=>888,250=>831,251=>873,252=>927,253=>970,254=>918,255=>746);
12
+ // --- EOF ---
includes/lib/{tcpdf_min → tcpdf}/include/barcodes/datamatrix.php RENAMED
@@ -1,1176 +1,1176 @@
1
- <?php
2
- //============================================================+
3
- // File name : datamatrix.php
4
- // Version : 1.0.008
5
- // Begin : 2010-06-07
6
- // Last Update : 2014-05-06
7
- // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
- // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
- // -------------------------------------------------------------------
10
- // Copyright (C) 2010-2014 Nicola Asuni - Tecnick.com LTD
11
- //
12
- // This file is part of TCPDF software library.
13
- //
14
- // TCPDF is free software: you can redistribute it and/or modify it
15
- // under the terms of the GNU Lesser General Public License as
16
- // published by the Free Software Foundation, either version 3 of the
17
- // License, or (at your option) any later version.
18
- //
19
- // TCPDF is distributed in the hope that it will be useful, but
20
- // WITHOUT ANY WARRANTY; without even the implied warranty of
21
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
- // See the GNU Lesser General Public License for more details.
23
- //
24
- // You should have received a copy of the GNU Lesser General Public License
25
- // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
- //
27
- // See LICENSE.TXT file for more information.
28
- // -------------------------------------------------------------------
29
- //
30
- // DESCRIPTION :
31
- //
32
- // Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
33
- // DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
34
- //============================================================+
35
-
36
- /**
37
- * @file
38
- * Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
39
- * DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
40
- *
41
- * @package com.tecnick.tcpdf
42
- * @author Nicola Asuni
43
- * @version 1.0.008
44
- */
45
-
46
- // custom definitions
47
- if (!defined('DATAMATRIXDEFS')) {
48
-
49
- /**
50
- * Indicate that definitions for this class are set
51
- */
52
- define('DATAMATRIXDEFS', true);
53
-
54
- // -----------------------------------------------------
55
-
56
- } // end of custom definitions
57
-
58
- // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
59
-
60
-
61
- /**
62
- * ASCII encoding: ASCII character 0 to 127 (1 byte per CW)
63
- */
64
- define('ENC_ASCII', 0);
65
-
66
- /**
67
- * C40 encoding: Upper-case alphanumeric (3/2 bytes per CW)
68
- */
69
- define('ENC_C40', 1);
70
-
71
- /**
72
- * TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW)
73
- */
74
- define('ENC_TXT', 2);
75
-
76
- /**
77
- * X12 encoding: ANSI X12 (3/2 byte per CW)
78
- */
79
- define('ENC_X12', 3);
80
-
81
- /**
82
- * EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW)
83
- */
84
- define('ENC_EDF', 4);
85
-
86
- /**
87
- * BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW)
88
- */
89
- define('ENC_BASE256', 5);
90
-
91
- /**
92
- * ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW)
93
- */
94
- define('ENC_ASCII_EXT', 6);
95
-
96
- /**
97
- * ASCII number encoding: ASCII digits (2 bytes per CW)
98
- */
99
- define('ENC_ASCII_NUM', 7);
100
-
101
- /**
102
- * @class Datamatrix
103
- * Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
104
- * DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
105
- *
106
- * @package com.tecnick.tcpdf
107
- * @author Nicola Asuni
108
- * @version 1.0.004
109
- */
110
- class Datamatrix {
111
-
112
- /**
113
- * Barcode array to be returned which is readable by TCPDF.
114
- * @protected
115
- */
116
- protected $barcode_array = array();
117
-
118
- /**
119
- * Store last used encoding for data codewords.
120
- * @protected
121
- */
122
- protected $last_enc = ENC_ASCII;
123
-
124
- /**
125
- * Table of Data Matrix ECC 200 Symbol Attributes:<ul>
126
- * <li>total matrix rows (including finder pattern)</li>
127
- * <li>total matrix cols (including finder pattern)</li>
128
- * <li>total matrix rows (without finder pattern)</li>
129
- * <li>total matrix cols (without finder pattern)</li>
130
- * <li>region data rows (with finder pattern)</li>
131
- * <li>region data col (with finder pattern)</li>
132
- * <li>region data rows (without finder pattern)</li>
133
- * <li>region data col (without finder pattern)</li>
134
- * <li>horizontal regions</li>
135
- * <li>vertical regions</li>
136
- * <li>regions</li>
137
- * <li>data codewords</li>
138
- * <li>error codewords</li>
139
- * <li>blocks</li>
140
- * <li>data codewords per block</li>
141
- * <li>error codewords per block</li>
142
- * </ul>
143
- * @protected
144
- */
145
- protected $symbattr = array(
146
- // square form ---------------------------------------------------------------------------------------
147
- array(0x00a,0x00a,0x008,0x008,0x00a,0x00a,0x008,0x008,0x001,0x001,0x001,0x003,0x005,0x001,0x003,0x005), // 10x10
148
- array(0x00c,0x00c,0x00a,0x00a,0x00c,0x00c,0x00a,0x00a,0x001,0x001,0x001,0x005,0x007,0x001,0x005,0x007), // 12x12
149
- array(0x00e,0x00e,0x00c,0x00c,0x00e,0x00e,0x00c,0x00c,0x001,0x001,0x001,0x008,0x00a,0x001,0x008,0x00a), // 14x14
150
- array(0x010,0x010,0x00e,0x00e,0x010,0x010,0x00e,0x00e,0x001,0x001,0x001,0x00c,0x00c,0x001,0x00c,0x00c), // 16x16
151
- array(0x012,0x012,0x010,0x010,0x012,0x012,0x010,0x010,0x001,0x001,0x001,0x012,0x00e,0x001,0x012,0x00e), // 18x18
152
- array(0x014,0x014,0x012,0x012,0x014,0x014,0x012,0x012,0x001,0x001,0x001,0x016,0x012,0x001,0x016,0x012), // 20x20
153
- array(0x016,0x016,0x014,0x014,0x016,0x016,0x014,0x014,0x001,0x001,0x001,0x01e,0x014,0x001,0x01e,0x014), // 22x22
154
- array(0x018,0x018,0x016,0x016,0x018,0x018,0x016,0x016,0x001,0x001,0x001,0x024,0x018,0x001,0x024,0x018), // 24x24
155
- array(0x01a,0x01a,0x018,0x018,0x01a,0x01a,0x018,0x018,0x001,0x001,0x001,0x02c,0x01c,0x001,0x02c,0x01c), // 26x26
156
- array(0x020,0x020,0x01c,0x01c,0x010,0x010,0x00e,0x00e,0x002,0x002,0x004,0x03e,0x024,0x001,0x03e,0x024), // 32x32
157
- array(0x024,0x024,0x020,0x020,0x012,0x012,0x010,0x010,0x002,0x002,0x004,0x056,0x02a,0x001,0x056,0x02a), // 36x36
158
- array(0x028,0x028,0x024,0x024,0x014,0x014,0x012,0x012,0x002,0x002,0x004,0x072,0x030,0x001,0x072,0x030), // 40x40
159
- array(0x02c,0x02c,0x028,0x028,0x016,0x016,0x014,0x014,0x002,0x002,0x004,0x090,0x038,0x001,0x090,0x038), // 44x44
160
- array(0x030,0x030,0x02c,0x02c,0x018,0x018,0x016,0x016,0x002,0x002,0x004,0x0ae,0x044,0x001,0x0ae,0x044), // 48x48
161
- array(0x034,0x034,0x030,0x030,0x01a,0x01a,0x018,0x018,0x002,0x002,0x004,0x0cc,0x054,0x002,0x066,0x02a), // 52x52
162
- array(0x040,0x040,0x038,0x038,0x010,0x010,0x00e,0x00e,0x004,0x004,0x010,0x118,0x070,0x002,0x08c,0x038), // 64x64
163
- array(0x048,0x048,0x040,0x040,0x012,0x012,0x010,0x010,0x004,0x004,0x010,0x170,0x090,0x004,0x05c,0x024), // 72x72
164
- array(0x050,0x050,0x048,0x048,0x014,0x014,0x012,0x012,0x004,0x004,0x010,0x1c8,0x0c0,0x004,0x072,0x030), // 80x80
165
- array(0x058,0x058,0x050,0x050,0x016,0x016,0x014,0x014,0x004,0x004,0x010,0x240,0x0e0,0x004,0x090,0x038), // 88x88
166
- array(0x060,0x060,0x058,0x058,0x018,0x018,0x016,0x016,0x004,0x004,0x010,0x2b8,0x110,0x004,0x0ae,0x044), // 96x96
167
- array(0x068,0x068,0x060,0x060,0x01a,0x01a,0x018,0x018,0x004,0x004,0x010,0x330,0x150,0x006,0x088,0x038), // 104x104
168
- array(0x078,0x078,0x06c,0x06c,0x014,0x014,0x012,0x012,0x006,0x006,0x024,0x41a,0x198,0x006,0x0af,0x044), // 120x120
169
- array(0x084,0x084,0x078,0x078,0x016,0x016,0x014,0x014,0x006,0x006,0x024,0x518,0x1f0,0x008,0x0a3,0x03e), // 132x132
170
- array(0x090,0x090,0x084,0x084,0x018,0x018,0x016,0x016,0x006,0x006,0x024,0x616,0x26c,0x00a,0x09c,0x03e), // 144x144
171
- // rectangular form (currently unused) ---------------------------------------------------------------------------
172
- array(0x008,0x012,0x006,0x010,0x008,0x012,0x006,0x010,0x001,0x001,0x001,0x005,0x007,0x001,0x005,0x007), // 8x18
173
- array(0x008,0x020,0x006,0x01c,0x008,0x010,0x006,0x00e,0x001,0x002,0x002,0x00a,0x00b,0x001,0x00a,0x00b), // 8x32
174
- array(0x00c,0x01a,0x00a,0x018,0x00c,0x01a,0x00a,0x018,0x001,0x001,0x001,0x010,0x00e,0x001,0x010,0x00e), // 12x26
175
- array(0x00c,0x024,0x00a,0x020,0x00c,0x012,0x00a,0x010,0x001,0x002,0x002,0x00c,0x012,0x001,0x00c,0x012), // 12x36
176
- array(0x010,0x024,0x00e,0x020,0x010,0x012,0x00e,0x010,0x001,0x002,0x002,0x020,0x018,0x001,0x020,0x018), // 16x36
177
- array(0x010,0x030,0x00e,0x02c,0x010,0x018,0x00e,0x016,0x001,0x002,0x002,0x031,0x01c,0x001,0x031,0x01c) // 16x48
178
- );
179
-
180
- /**
181
- * Map encodation modes whit character sets.
182
- * @protected
183
- */
184
- protected $chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12');
185
-
186
- /**
187
- * Basic set of characters for each encodation mode.
188
- * @protected
189
- */
190
- protected $chset = array(
191
- 'C40' => array( // Basic set for C40 ----------------------------------------------------------------------------
192
- 'S1'=>0x00,'S2'=>0x01,'S3'=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, //
193
- 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x41=>0x0e,0x42=>0x0f,0x43=>0x10,0x44=>0x11,0x45=>0x12,0x46=>0x13, //
194
- 0x47=>0x14,0x48=>0x15,0x49=>0x16,0x4a=>0x17,0x4b=>0x18,0x4c=>0x19,0x4d=>0x1a,0x4e=>0x1b,0x4f=>0x1c,0x50=>0x1d, //
195
- 0x51=>0x1e,0x52=>0x1f,0x53=>0x20,0x54=>0x21,0x55=>0x22,0x56=>0x23,0x57=>0x24,0x58=>0x25,0x59=>0x26,0x5a=>0x27),//
196
- 'TXT' => array( // Basic set for TEXT ---------------------------------------------------------------------------
197
- 'S1'=>0x00,'S2'=>0x01,'S3'=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, //
198
- 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x61=>0x0e,0x62=>0x0f,0x63=>0x10,0x64=>0x11,0x65=>0x12,0x66=>0x13, //
199
- 0x67=>0x14,0x68=>0x15,0x69=>0x16,0x6a=>0x17,0x6b=>0x18,0x6c=>0x19,0x6d=>0x1a,0x6e=>0x1b,0x6f=>0x1c,0x70=>0x1d, //
200
- 0x71=>0x1e,0x72=>0x1f,0x73=>0x20,0x74=>0x21,0x75=>0x22,0x76=>0x23,0x77=>0x24,0x78=>0x25,0x79=>0x26,0x7a=>0x27),//
201
- 'SH1' => array( // Shift 1 set ----------------------------------------------------------------------------------
202
- 0x00=>0x00,0x01=>0x01,0x02=>0x02,0x03=>0x03,0x04=>0x04,0x05=>0x05,0x06=>0x06,0x07=>0x07,0x08=>0x08,0x09=>0x09, //
203
- 0x0a=>0x0a,0x0b=>0x0b,0x0c=>0x0c,0x0d=>0x0d,0x0e=>0x0e,0x0f=>0x0f,0x10=>0x10,0x11=>0x11,0x12=>0x12,0x13=>0x13, //
204
- 0x14=>0x14,0x15=>0x15,0x16=>0x16,0x17=>0x17,0x18=>0x18,0x19=>0x19,0x1a=>0x1a,0x1b=>0x1b,0x1c=>0x1c,0x1d=>0x1d, //
205
- 0x1e=>0x1e,0x1f=>0x1f), //
206
- 'SH2' => array( // Shift 2 set ----------------------------------------------------------------------------------
207
- 0x21=>0x00,0x22=>0x01,0x23=>0x02,0x24=>0x03,0x25=>0x04,0x26=>0x05,0x27=>0x06,0x28=>0x07,0x29=>0x08,0x2a=>0x09, //
208
- 0x2b=>0x0a,0x2c=>0x0b,0x2d=>0x0c,0x2e=>0x0d,0x2f=>0x0e,0x3a=>0x0f,0x3b=>0x10,0x3c=>0x11,0x3d=>0x12,0x3e=>0x13, //
209
- 0x3f=>0x14,0x40=>0x15,0x5b=>0x16,0x5c=>0x17,0x5d=>0x18,0x5e=>0x19,0x5f=>0x1a,'F1'=>0x1b,'US'=>0x1e), //
210
- 'S3C' => array( // Shift 3 set for C40 --------------------------------------------------------------------------
211
- 0x60=>0x00,0x61=>0x01,0x62=>0x02,0x63=>0x03,0x64=>0x04,0x65=>0x05,0x66=>0x06,0x67=>0x07,0x68=>0x08,0x69=>0x09, //
212
- 0x6a=>0x0a,0x6b=>0x0b,0x6c=>0x0c,0x6d=>0x0d,0x6e=>0x0e,0x6f=>0x0f,0x70=>0x10,0x71=>0x11,0x72=>0x12,0x73=>0x13, //
213
- 0x74=>0x14,0x75=>0x15,0x76=>0x16,0x77=>0x17,0x78=>0x18,0x79=>0x19,0x7a=>0x1a,0x7b=>0x1b,0x7c=>0x1c,0x7d=>0x1d, //
214
- 0x7e=>0x1e,0x7f=>0x1f),
215
- 'S3T' => array( // Shift 3 set for TEXT -------------------------------------------------------------------------
216
- 0x60=>0x00,0x41=>0x01,0x42=>0x02,0x43=>0x03,0x44=>0x04,0x45=>0x05,0x46=>0x06,0x47=>0x07,0x48=>0x08,0x49=>0x09, //
217
- 0x4a=>0x0a,0x4b=>0x0b,0x4c=>0x0c,0x4d=>0x0d,0x4e=>0x0e,0x4f=>0x0f,0x50=>0x10,0x51=>0x11,0x52=>0x12,0x53=>0x13, //
218
- 0x54=>0x14,0x55=>0x15,0x56=>0x16,0x57=>0x17,0x58=>0x18,0x59=>0x19,0x5a=>0x1a,0x7b=>0x1b,0x7c=>0x1c,0x7d=>0x1d, //
219
- 0x7e=>0x1e,0x7f=>0x1f), //
220
- 'X12' => array( // Set for X12 ----------------------------------------------------------------------------------
221
- 0x0d=>0x00,0x2a=>0x01,0x3e=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, //
222
- 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x41=>0x0e,0x42=>0x0f,0x43=>0x10,0x44=>0x11,0x45=>0x12,0x46=>0x13, //
223
- 0x47=>0x14,0x48=>0x15,0x49=>0x16,0x4a=>0x17,0x4b=>0x18,0x4c=>0x19,0x4d=>0x1a,0x4e=>0x1b,0x4f=>0x1c,0x50=>0x1d, //
224
- 0x51=>0x1e,0x52=>0x1f,0x53=>0x20,0x54=>0x21,0x55=>0x22,0x56=>0x23,0x57=>0x24,0x58=>0x25,0x59=>0x26,0x5a=>0x27) //
225
- );
226
-
227
- // -----------------------------------------------------------------------------
228
-
229
- /**
230
- * This is the class constructor.
231
- * Creates a datamatrix object
232
- * @param $code (string) Code to represent using Datamatrix.
233
- * @public
234
- */
235
- public function __construct($code) {
236
- $barcode_array = array();
237
- if ((is_null($code)) OR ($code == '\0') OR ($code == '')) {
238
- return false;
239
- }
240
- // get data codewords
241
- $cw = $this->getHighLevelEncoding($code);
242
- // number of data codewords
243
- $nd = count($cw);
244
- // check size
245
- if ($nd > 1558) {
246
- return false;
247
- }
248
- // get minimum required matrix size.
249
- foreach ($this->symbattr as $params) {
250
- if ($params[11] >= $nd) {
251
- break;
252
- }
253
- }
254
- if ($params[11] < $nd) {
255
- // too much data
256
- return false;
257
- } elseif ($params[11] > $nd) {
258
- // add padding
259
- if ((($params[11] - $nd) > 1) AND ($cw[($nd - 1)] != 254)) {
260
- if ($this->last_enc == ENC_EDF) {
261
- // switch to ASCII encoding
262
- $cw[] = 124;
263
- ++$nd;
264
- } elseif (($this->last_enc != ENC_ASCII) AND ($this->last_enc != ENC_BASE256)) {
265
- // switch to ASCII encoding
266
- $cw[] = 254;
267
- ++$nd;
268
- }
269
- }
270
- if ($params[11] > $nd) {
271
- // add first pad
272
- $cw[] = 129;
273
- ++$nd;
274
- // add remaining pads
275
- for ($i = $nd; $i < $params[11]; ++$i) {
276
- $cw[] = $this->get253StateCodeword(129, $i);
277
- }
278
- }
279
- }
280
- // add error correction codewords
281
- $cw = $this->getErrorCorrection($cw, $params[13], $params[14], $params[15]);
282
- // initialize empty arrays
283
- $grid = array_fill(0, ($params[2] * $params[3]), 0);
284
- // get placement map
285
- $places = $this->getPlacementMap($params[2], $params[3]);
286
- // fill the grid with data
287
- $grid = array();
288
- $i = 0;
289
- // region data row max index
290
- $rdri = ($params[4] - 1);
291
- // region data column max index
292
- $rdci = ($params[5] - 1);
293
- // for each vertical region
294
- for ($vr = 0; $vr < $params[9]; ++$vr) {
295
- // for each row on region
296
- for ($r = 0; $r < $params[4]; ++$r) {
297
- // get row
298
- $row = (($vr * $params[4]) + $r);
299
- // for each horizontal region
300
- for ($hr = 0; $hr < $params[8]; ++$hr) {
301
- // for each column on region
302
- for ($c = 0; $c < $params[5]; ++$c) {
303
- // get column
304
- $col = (($hr * $params[5]) + $c);
305
- // braw bits by case
306
- if ($r == 0) {
307
- // top finder pattern
308
- if ($c % 2) {
309
- $grid[$row][$col] = 0;
310
- } else {
311
- $grid[$row][$col] = 1;
312
- }
313
- } elseif ($r == $rdri) {
314
- // bottom finder pattern
315
- $grid[$row][$col] = 1;
316
- } elseif ($c == 0) {
317
- // left finder pattern
318
- $grid[$row][$col] = 1;
319
- } elseif ($c == $rdci) {
320
- // right finder pattern
321
- if ($r % 2) {
322
- $grid[$row][$col] = 1;
323
- } else {
324
- $grid[$row][$col] = 0;
325
- }
326
- } else { // data bit
327
- if ($places[$i] < 2) {
328
- $grid[$row][$col] = $places[$i];
329
- } else {
330
- // codeword ID
331
- $cw_id = (floor($places[$i] / 10) - 1);
332
- // codeword BIT mask
333
- $cw_bit = pow(2, (8 - ($places[$i] % 10)));
334
- $grid[$row][$col] = (($cw[$cw_id] & $cw_bit) == 0) ? 0 : 1;
335
- }
336
- ++$i;
337
- }
338
- }
339
- }
340
- }
341
- }
342
- $this->barcode_array['num_rows'] = $params[0];
343
- $this->barcode_array['num_cols'] = $params[1];
344
- $this->barcode_array['bcode'] = $grid;
345
- }
346
-
347
- /**
348
- * Returns a barcode array which is readable by TCPDF
349
- * @return array barcode array readable by TCPDF;
350
- * @public
351
- */
352
- public function getBarcodeArray() {
353
- return $this->barcode_array;
354
- }
355
-
356
- /**
357
- * Product of two numbers in a Power-of-Two Galois Field
358
- * @param $a (int) first number to multiply.
359
- * @param $b (int) second number to multiply.
360
- * @param $log (array) Log table.
361
- * @param $alog (array) Anti-Log table.
362
- * @param $gf (array) Number of Factors of the Reed-Solomon polynomial.
363
- * @return int product
364
- * @protected
365
- */
366
- protected function getGFProduct($a, $b, $log, $alog, $gf) {
367
- if (($a == 0) OR ($b == 0)) {
368
- return 0;
369
- }
370
- return ($alog[($log[$a] + $log[$b]) % ($gf - 1)]);
371
- }
372
-
373
- /**
374
- * Add error correction codewords to data codewords array (ANNEX E).
375
- * @param $wd (array) Array of datacodewords.
376
- * @param $nb (int) Number of blocks.
377
- * @param $nd (int) Number of data codewords per block.
378
- * @param $nc (int) Number of correction codewords per block.
379
- * @param $gf (int) numner of fields on log/antilog table (power of 2).
380
- * @param $pp (int) The value of its prime modulus polynomial (301 for ECC200).
381
- * @return array data codewords + error codewords
382
- * @protected
383
- */
384
- protected function getErrorCorrection($wd, $nb, $nd, $nc, $gf=256, $pp=301) {
385
- // generate the log ($log) and antilog ($alog) tables
386
- $log[0] = 0;
387
- $alog[0] = 1;
388
- for ($i = 1; $i < $gf; ++$i) {
389
- $alog[$i] = ($alog[($i - 1)] * 2);
390
- if ($alog[$i] >= $gf) {
391
- $alog[$i] ^= $pp;
392
- }
393
- $log[$alog[$i]] = $i;
394
- }
395
- ksort($log);
396
- // generate the polynomial coefficients (c)
397
- $c = array_fill(0, ($nc + 1), 0);
398
- $c[0] = 1;
399
- for ($i = 1; $i <= $nc; ++$i) {
400
- $c[$i] = $c[($i-1)];
401
- for ($j = ($i - 1); $j >= 1; --$j) {
402
- $c[$j] = $c[($j - 1)] ^ $this->getGFProduct($c[$j], $alog[$i], $log, $alog, $gf);
403
- }
404
- $c[0] = $this->getGFProduct($c[0], $alog[$i], $log, $alog, $gf);
405
- }
406
- ksort($c);
407
- // total number of data codewords
408
- $num_wd = ($nb * $nd);
409
- // total number of error codewords
410
- $num_we = ($nb * $nc);
411
- // for each block
412
- for ($b = 0; $b < $nb; ++$b) {
413
- // create interleaved data block
414
- $block = array();
415
- for ($n = $b; $n < $num_wd; $n += $nb) {
416
- $block[] = $wd[$n];
417
- }
418
- // initialize error codewords
419
- $we = array_fill(0, ($nc + 1), 0);
420
- // calculate error correction codewords for this block
421
- for ($i = 0; $i < $nd; ++$i) {
422
- $k = ($we[0] ^ $block[$i]);
423
- for ($j = 0; $j < $nc; ++$j) {
424
- $we[$j] = ($we[($j + 1)] ^ $this->getGFProduct($k, $c[($nc - $j - 1)], $log, $alog, $gf));
425
- }
426
- }
427
- // add error codewords at the end of data codewords
428
- $j = 0;
429
- for ($i = $b; $i < $num_we; $i += $nb) {
430
- $wd[($num_wd + $i)] = $we[$j];
431
- ++$j;
432
- }
433
- }
434
- // reorder codewords
435
- ksort($wd);
436
- return $wd;
437
- }
438
-
439
- /**
440
- * Return the 253-state codeword
441
- * @param $cwpad (int) Pad codeword.
442
- * @param $cwpos (int) Number of data codewords from the beginning of encoded data.
443
- * @return pad codeword
444
- * @protected
445
- */
446
- protected function get253StateCodeword($cwpad, $cwpos) {
447
- $pad = ($cwpad + (((149 * $cwpos) % 253) + 1));
448
- if ($pad > 254) {
449
- $pad -= 254;
450
- }
451
- return $pad;
452
- }
453
-
454
- /**
455
- * Return the 255-state codeword
456
- * @param $cwpad (int) Pad codeword.
457
- * @param $cwpos (int) Number of data codewords from the beginning of encoded data.
458
- * @return pad codeword
459
- * @protected
460
- */
461
- protected function get255StateCodeword($cwpad, $cwpos) {
462
- $pad = ($cwpad + (((149 * $cwpos) % 255) + 1));
463
- if ($pad > 255) {
464
- $pad -= 256;
465
- }
466
- return $pad;
467
- }
468
-
469
- /**
470
- * Returns true if the char belongs to the selected mode
471
- * @param $chr (int) Character (byte) to check.
472
- * @param $mode (int) Current encoding mode.
473
- * @return boolean true if the char is of the selected mode.
474
- * @protected
475
- */
476
- protected function isCharMode($chr, $mode) {
477
- $status = false;
478
- switch ($mode) {
479
- case ENC_ASCII: { // ASCII character 0 to 127
480
- $status = (($chr >= 0) AND ($chr <= 127));
481
- break;
482
- }
483
- case ENC_C40: { // Upper-case alphanumeric
484
- $status = (($chr == 32) OR (($chr >= 48) AND ($chr <= 57)) OR (($chr >= 65) AND ($chr <= 90)));
485
- break;
486
- }
487
- case ENC_TXT: { // Lower-case alphanumeric
488
- $status = (($chr == 32) OR (($chr >= 48) AND ($chr <= 57)) OR (($chr >= 97) AND ($chr <= 122)));
489
- break;
490
- }
491
- case ENC_X12: { // ANSI X12
492
- $status = (($chr == 13) OR ($chr == 42) OR ($chr == 62));
493
- break;
494
- }
495
- case ENC_EDF: { // ASCII character 32 to 94
496
- $status = (($chr >= 32) AND ($chr <= 94));
497
- break;
498
- }
499
- case ENC_BASE256: { // Function character (FNC1, Structured Append, Reader Program, or Code Page)
500
- $status = (($chr == 232) OR ($chr == 233) OR ($chr == 234) OR ($chr == 241));
501
- break;
502
- }
503
- case ENC_ASCII_EXT: { // ASCII character 128 to 255
504
- $status = (($chr >= 128) AND ($chr <= 255));
505
- break;
506
- }
507
- case ENC_ASCII_NUM: { // ASCII digits
508
- $status = (($chr >= 48) AND ($chr <= 57));
509
- break;
510
- }
511
- }
512
- return $status;
513
- }
514
-
515
- /**
516
- * The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S).
517
- * @param $data (string) data to encode
518
- * @param $pos (int) current position
519
- * @param $mode (int) current encoding mode
520
- * @return int encoding mode
521
- * @protected
522
- */
523
- protected function lookAheadTest($data, $pos, $mode) {
524
- $data_length = strlen($data);
525
- if ($pos >= $data_length) {
526
- return $mode;
527
- }
528
- $charscount = 0; // count processed chars
529
- // STEP J
530
- if ($mode == ENC_ASCII) {
531
- $numch = array(0, 1, 1, 1, 1, 1.25);
532
- } else {
533
- $numch = array(1, 2, 2, 2, 2, 2.25);
534
- $numch[$mode] = 0;
535
- }
536
- while (true) {
537
- // STEP K
538
- if (($pos + $charscount) == $data_length) {
539
- if ($numch[ENC_ASCII] <= ceil(min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256]))) {
540
- return ENC_ASCII;
541
- }
542
- if ($numch[ENC_BASE256] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF]))) {
543
- return ENC_BASE256;
544
- }
545
- if ($numch[ENC_EDF] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_BASE256]))) {
546
- return ENC_EDF;
547
- }
548
- if ($numch[ENC_TXT] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256]))) {
549
- return ENC_TXT;
550
- }
551
- if ($numch[ENC_X12] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256]))) {
552
- return ENC_X12;
553
- }
554
- return ENC_C40;
555
- }
556
- // get char
557
- $chr = ord($data[$pos + $charscount]);
558
- $charscount++;
559
- // STEP L
560
- if ($this->isCharMode($chr, ENC_ASCII_NUM)) {
561
- $numch[ENC_ASCII] += (1 / 2);
562
- } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
563
- $numch[ENC_ASCII] = ceil($numch[ENC_ASCII]);
564
- $numch[ENC_ASCII] += 2;
565
- } else {
566
- $numch[ENC_ASCII] = ceil($numch[ENC_ASCII]);
567
- $numch[ENC_ASCII] += 1;
568
- }
569
- // STEP M
570
- if ($this->isCharMode($chr, ENC_C40)) {
571
- $numch[ENC_C40] += (2 / 3);
572
- } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
573
- $numch[ENC_C40] += (8 / 3);
574
- } else {
575
- $numch[ENC_C40] += (4 / 3);
576
- }
577
- // STEP N
578
- if ($this->isCharMode($chr, ENC_TXT)) {
579
- $numch[ENC_TXT] += (2 / 3);
580
- } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
581
- $numch[ENC_TXT] += (8 / 3);
582
- } else {
583
- $numch[ENC_TXT] += (4 / 3);
584
- }
585
- // STEP O
586
- if ($this->isCharMode($chr, ENC_X12) OR $this->isCharMode($chr, ENC_C40)) {
587
- $numch[ENC_X12] += (2 / 3);
588
- } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
589
- $numch[ENC_X12] += (13 / 3);
590
- } else {
591
- $numch[ENC_X12] += (10 / 3);
592
- }
593
- // STEP P
594
- if ($this->isCharMode($chr, ENC_EDF)) {
595
- $numch[ENC_EDF] += (3 / 4);
596
- } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
597
- $numch[ENC_EDF] += (17 / 4);
598
- } else {
599
- $numch[ENC_EDF] += (13 / 4);
600
- }
601
- // STEP Q
602
- if ($this->isCharMode($chr, ENC_BASE256)) {
603
- $numch[ENC_BASE256] += 4;
604
- } else {
605
- $numch[ENC_BASE256] += 1;
606
- }
607
- // STEP R
608
- if ($charscount >= 4) {
609
- if (($numch[ENC_ASCII] + 1) <= min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256])) {
610
- return ENC_ASCII;
611
- }
612
- if ((($numch[ENC_BASE256] + 1) <= $numch[ENC_ASCII])
613
- OR (($numch[ENC_BASE256] + 1) < min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF]))) {
614
- return ENC_BASE256;
615
- }
616
- if (($numch[ENC_EDF] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_BASE256])) {
617
- return ENC_EDF;
618
- }
619
- if (($numch[ENC_TXT] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256])) {
620
- return ENC_TXT;
621
- }
622
- if (($numch[ENC_X12] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256])) {
623
- return ENC_X12;
624
- }
625
- if (($numch[ENC_C40] + 1) < min($numch[ENC_ASCII], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256])) {
626
- if ($numch[ENC_C40] < $numch[ENC_X12]) {
627
- return ENC_C40;
628
- }
629
- if ($numch[ENC_C40] == $numch[ENC_X12]) {
630
- $k = ($pos + $charscount + 1);
631
- while ($k < $data_length) {
632
- $tmpchr = ord($data{$k});
633
- if ($this->isCharMode($tmpchr, ENC_X12)) {
634
- return ENC_X12;
635
- } elseif (!($this->isCharMode($tmpchr, ENC_X12) OR $this->isCharMode($tmpchr, ENC_C40))) {
636
- break;
637
- }
638
- ++$k;
639
- }
640
- return ENC_C40;
641
- }
642
- }
643
- }
644
- } // end of while
645
- }
646
-
647
- /**
648
- * Get the switching codeword to a new encoding mode (latch codeword)
649
- * @param $mode (int) New encoding mode.
650
- * @return (int) Switch codeword.
651
- * @protected
652
- */
653
- protected function getSwitchEncodingCodeword($mode) {
654
- switch ($mode) {
655
- case ENC_ASCII: { // ASCII character 0 to 127
656
- $cw = 254;
657
- if ($this->last_enc == ENC_EDF) {
658
- $cw = 124;
659
- }
660
- break;
661
- }
662
- case ENC_C40: { // Upper-case alphanumeric
663
- $cw = 230;
664
- break;
665
- }
666
- case ENC_TXT: { // Lower-case alphanumeric
667
- $cw = 239;
668
- break;
669
- }
670
- case ENC_X12: { // ANSI X12
671
- $cw = 238;
672
- break;
673
- }
674
- case ENC_EDF: { // ASCII character 32 to 94
675
- $cw = 240;
676
- break;
677
- }
678
- case ENC_BASE256: { // Function character (FNC1, Structured Append, Reader Program, or Code Page)
679
- $cw = 231;
680
- break;
681
- }
682
- }
683
- return $cw;
684
- }
685
-
686
- /**
687
- * Choose the minimum matrix size and return the max number of data codewords.
688
- * @param $numcw (int) Number of current codewords.
689
- * @return number of data codewords in matrix
690
- * @protected
691
- */
692
- protected function getMaxDataCodewords($numcw) {
693
- foreach ($this->symbattr as $key => $matrix) {
694
- if ($matrix[11] >= $numcw) {
695
- return $matrix[11];
696
- }
697
- }
698
- return 0;
699
- }
700
-
701
- /**
702
- * Get high level encoding using the minimum symbol data characters for ECC 200
703
- * @param $data (string) data to encode
704
- * @return array of codewords
705
- * @protected
706
- */
707
- protected function getHighLevelEncoding($data) {
708
- // STEP A. Start in ASCII encodation.
709
- $enc = ENC_ASCII; // current encoding mode
710
- $pos = 0; // current position
711
- $cw = array(); // array of codewords to be returned
712
- $cw_num = 0; // number of data codewords
713
- $data_lenght = strlen($data); // number of chars
714
- while ($pos < $data_lenght) {
715
- // set last used encoding
716
- $this->last_enc = $enc;
717
- switch ($enc) {
718
- case ENC_ASCII: { // STEP B. While in ASCII encodation
719
- if (($data_lenght > 1) AND ($pos < ($data_lenght - 1)) AND ($this->isCharMode(ord($data[$pos]), ENC_ASCII_NUM) AND $this->isCharMode(ord($data[$pos + 1]), ENC_ASCII_NUM))) {
720
- // 1. If the next data sequence is at least 2 consecutive digits, encode the next two digits as a double digit in ASCII mode.
721
- $cw[] = (intval(substr($data, $pos, 2)) + 130);
722
- ++$cw_num;
723
- $pos += 2;
724
- } else {
725
- // 2. If the look-ahead test (starting at step J) indicates another mode, switch to that mode.
726
- $newenc = $this->lookAheadTest($data, $pos, $enc);
727
- if ($newenc != $enc) {
728
- // switch to new encoding
729
- $enc = $newenc;
730
- $cw[] = $this->getSwitchEncodingCodeword($enc);
731
- ++$cw_num;
732
- } else {
733
- // get new byte
734
- $chr = ord($data[$pos]);
735
- ++$pos;
736
- if ($this->isCharMode($chr, ENC_ASCII_EXT)) {
737
- // 3. If the next data character is extended ASCII (greater than 127) encode it in ASCII mode first using the Upper Shift (value 235) character.
738
- $cw[] = 235;
739
- $cw[] = ($chr - 127);
740
- $cw_num += 2;
741
- } else {
742
- // 4. Otherwise process the next data character in ASCII encodation.
743
- $cw[] = ($chr + 1);
744
- ++$cw_num;
745
- }
746
- }
747
- }
748
- break;
749
- }
750
- case ENC_C40 : // Upper-case alphanumeric
751
- case ENC_TXT : // Lower-case alphanumeric
752
- case ENC_X12 : { // ANSI X12
753
- $temp_cw = array();
754
- $p = 0;
755
- $epos = $pos;
756
- // get charset ID
757
- $set_id = $this->chset_id[$enc];
758
- // get basic charset for current encoding
759
- $charset = $this->chset[$set_id];
760
- do {
761
- // 2. process the next character in C40 encodation.
762
- $chr = ord($data[$epos]);
763
- ++$epos;
764
- // check for extended character
765
- if ($chr & 0x80) {
766
- if ($enc == ENC_X12) {
767
- return false;
768
- }
769
- $chr = ($chr & 0x7f);
770
- $temp_cw[] = 1; // shift 2
771
- $temp_cw[] = 30; // upper shift
772
- $p += 2;
773
- }
774
- if (isset($charset[$chr])) {
775
- $temp_cw[] = $charset[$chr];
776
- ++$p;
777
- } else {
778
- if (isset($this->chset['SH1'][$chr])) {
779
- $temp_cw[] = 0; // shift 1
780
- $shiftset = $this->chset['SH1'];
781
- } elseif (isset($chr, $this->chset['SH2'][$chr])) {
782
- $temp_cw[] = 1; // shift 2
783
- $shiftset = $this->chset['SH2'];
784
- } elseif (($enc == ENC_C40) AND isset($this->chset['S3C'][$chr])) {
785
- $temp_cw[] = 2; // shift 3
786
- $shiftset = $this->chset['S3C'];
787
- } elseif (($enc == ENC_TXT) AND isset($this->chset['S3T'][$chr])) {
788
- $temp_cw[] = 2; // shift 3
789
- $shiftset = $this->chset['S3T'];
790
- } else {
791
- return false;
792
- }
793
- $temp_cw[] = $shiftset[$chr];
794
- $p += 2;
795
- }
796
- if ($p >= 3) {
797
- $c1 = array_shift($temp_cw);
798
- $c2 = array_shift($temp_cw);
799
- $c3 = array_shift($temp_cw);
800
- $p -= 3;
801
- $tmp = ((1600 * $c1) + (40 * $c2) + $c3 + 1);
802
- $cw[] = ($tmp >> 8);
803
- $cw[] = ($tmp % 256);
804
- $cw_num += 2;
805
- $pos = $epos;
806
- // 1. If the C40 encoding is at the point of starting a new double symbol character and if the look-ahead test (starting at step J) indicates another mode, switch to that mode.
807
- $newenc = $this->lookAheadTest($data, $pos, $enc);
808
- if ($newenc != $enc) {
809
- // switch to new encoding
810
- $enc = $newenc;
811
- if ($enc != ENC_ASCII) {
812
- // set unlatch character
813
- $cw[] = $this->getSwitchEncodingCodeword(ENC_ASCII);
814
- ++$cw_num;
815
- }
816
- $cw[] = $this->getSwitchEncodingCodeword($enc);
817
- ++$cw_num;
818
- $pos -= $p;
819
- $p = 0;
820
- break;
821
- }
822
- }
823
- } while (($p > 0) AND ($epos < $data_lenght));
824
- // process last data (if any)
825
- if ($p > 0) {
826
- // get remaining number of data symbols
827
- $cwr = ($this->getMaxDataCodewords($cw_num) - $cw_num);
828
- if (($cwr == 1) AND ($p == 1)) {
829
- // d. If one symbol character remains and one C40 value (data character) remains to be encoded
830
- $c1 = array_shift($temp_cw);
831
- --$p;
832
- $cw[] = ($chr + 1);
833
- ++$cw_num;
834
- $pos = $epos;
835
- $enc = ENC_ASCII;
836
- $this->last_enc = $enc;
837
- } elseif (($cwr == 2) AND ($p == 1)) {
838
- // c. If two symbol characters remain and only one C40 value (data character) remains to be encoded
839
- $c1 = array_shift($temp_cw);
840
- --$p;
841
- $cw[] = 254;
842
- $cw[] = ($chr + 1);
843
- $cw_num += 2;
844
- $pos = $epos;
845
- $enc = ENC_ASCII;
846
- $this->last_enc = $enc;
847
- } elseif (($cwr == 2) AND ($p == 2)) {
848
- // b. If two symbol characters remain and two C40 values remain to be encoded
849
- $c1 = array_shift($temp_cw);
850
- $c2 = array_shift($temp_cw);
851
- $p -= 2;
852
- $tmp = ((1600 * $c1) + (40 * $c2) + 1);
853
- $cw[] = ($tmp >> 8);
854
- $cw[] = ($tmp % 256);
855
- $cw_num += 2;
856
- $pos = $epos;
857
- $enc = ENC_ASCII;
858
- $this->last_enc = $enc;
859
- } else {
860
- // switch to ASCII encoding
861
- if ($enc != ENC_ASCII) {
862
- $enc = ENC_ASCII;
863
- $this->last_enc = $enc;
864
- $cw[] = $this->getSwitchEncodingCodeword($enc);
865
- ++$cw_num;
866
- $pos = ($epos - $p);
867
- }
868
- }
869
- }
870
- break;
871
- }
872
- case ENC_EDF: { // F. While in EDIFACT (EDF) encodation
873
- // initialize temporary array with 0 lenght
874
- $temp_cw = array();
875
- $epos = $pos;
876
- $field_lenght = 0;
877
- $newenc = $enc;
878
- do {
879
- // 2. process the next character in EDIFACT encodation.
880
- $chr = ord($data[$epos]);
881
- if ($this->isCharMode($chr, ENC_EDF)) {
882
- ++$epos;
883
- $temp_cw[] = $chr;
884
- ++$field_lenght;
885
- }
886
- if (($field_lenght == 4) OR ($epos == $data_lenght) OR !$this->isCharMode($chr, ENC_EDF)) {
887
- if (($epos == $data_lenght) AND ($field_lenght < 3)) {
888
- $enc = ENC_ASCII;
889
- $cw[] = $this->getSwitchEncodingCodeword($enc);
890
- ++$cw_num;
891
- break;
892
- }
893
- if ($field_lenght < 4) {
894
- // set unlatch character
895
- $temp_cw[] = 0x1f;
896
- ++$field_lenght;
897
- // fill empty characters
898
- for ($i = $field_lenght; $i < 4; ++$i) {
899
- $temp_cw[] = 0;
900
- }
901
- $enc = ENC_ASCII;
902
- $this->last_enc = $enc;
903
- }
904
- // encodes four data characters in three codewords
905
- $tcw = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4);
906
- if ($tcw > 0) {
907
- $cw[] = $tcw;
908
- $cw_num++;
909
- }
910
- $tcw= (($temp_cw[1] & 0x0F) << 4) + (($temp_cw[2] & 0x3C) >> 2);
911
- if ($tcw > 0) {
912
- $cw[] = $tcw;
913
- $cw_num++;
914
- }
915
- $tcw = (($temp_cw[2] & 0x03) << 6) + ($temp_cw[3] & 0x3F);
916
- if ($tcw > 0) {
917
- $cw[] = $tcw;
918
- $cw_num++;
919
- }
920
- $temp_cw = array();
921
- $pos = $epos;
922
- $field_lenght = 0;
923
- if ($enc == ENC_ASCII) {
924
- break; // exit from EDIFACT mode
925
- }
926
- }
927
- } while ($epos < $data_lenght);
928
- break;
929
- }
930
- case ENC_BASE256: { // G. While in Base 256 (B256) encodation
931
- // initialize temporary array with 0 lenght
932
- $temp_cw = array();
933
- $field_lenght = 0;
934
- while (($pos < $data_lenght) AND ($field_lenght <= 1555)) {
935
- $newenc = $this->lookAheadTest($data, $pos, $enc);
936
- if ($newenc != $enc) {
937
- // 1. If the look-ahead test (starting at step J) indicates another mode, switch to that mode.
938
- $enc = $newenc;
939
- break; // exit from B256 mode
940
- } else {
941
- // 2. Otherwise, process the next character in Base 256 encodation.
942
- $chr = ord($data[$pos]);
943
- ++$pos;
944
- $temp_cw[] = $chr;
945
- ++$field_lenght;
946
- }
947
- }
948
- // set field lenght
949
- if ($field_lenght <= 249) {
950
- $cw[] = $this->get255StateCodeword($field_lenght, ($cw_num + 1));
951
- ++$cw_num;
952
- } else {
953
- $cw[] = $this->get255StateCodeword((floor($field_lenght / 250) + 249), ($cw_num + 1));
954
- $cw[] = $this->get255StateCodeword(($field_lenght % 250), ($cw_num + 2));
955
- $cw_num += 2;
956
- }
957
- if (!empty($temp_cw)) {
958
- // add B256 field
959
- foreach ($temp_cw as $p => $cht) {
960
- $cw[] = $this->get255StateCodeword($cht, ($cw_num + $p + 1));
961
- }
962
- }
963
- break;
964
- }
965
- } // end of switch enc
966
- } // end of while
967
- return $cw;
968
- }
969
-
970
- /**
971
- * Places "chr+bit" with appropriate wrapping within array[].
972
- * (Annex F - ECC 200 symbol character placement)
973
- * @param $marr (array) Array of symbols.
974
- * @param $nrow (int) Number of rows.
975
- * @param $ncol (int) Number of columns.
976
- * @param $row (int) Row number.
977
- * @param $col (int) Column number.
978
- * @param $chr (int) Char byte.
979
- * @param $bit (int) Bit.
980
- * @return array
981
- * @protected
982
- */
983
- protected function placeModule($marr, $nrow, $ncol, $row, $col, $chr, $bit) {
984
- if ($row < 0) {
985
- $row += $nrow;
986
- $col += (4 - (($nrow + 4) % 8));
987
- }
988
- if ($col < 0) {
989
- $col += $ncol;
990
- $row += (4 - (($ncol + 4) % 8));
991
- }
992
- $marr[(($row * $ncol) + $col)] = ((10 * $chr) + $bit);
993
- return $marr;
994
- }
995
-
996
- /**
997
- * Places the 8 bits of a utah-shaped symbol character.
998
- * (Annex F - ECC 200 symbol character placement)
999
- * @param $marr (array) Array of symbols.
1000
- * @param $nrow (int) Number of rows.
1001
- * @param $ncol (int) Number of columns.
1002
- * @param $row (int) Row number.
1003
- * @param $col (int) Column number.
1004
- * @param $chr (int) Char byte.
1005
- * @return array
1006
- * @protected
1007
- */
1008
- protected function placeUtah($marr, $nrow, $ncol, $row, $col, $chr) {
1009
- $marr = $this->placeModule($marr, $nrow, $ncol, $row-2, $col-2, $chr, 1);
1010
- $marr = $this->placeModule($marr, $nrow, $ncol, $row-2, $col-1, $chr, 2);
1011
- $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col-2, $chr, 3);
1012
- $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col-1, $chr, 4);
1013
- $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col, $chr, 5);
1014
- $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col-2, $chr, 6);
1015
- $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col-1, $chr, 7);
1016
- $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col, $chr, 8);
1017
- return $marr;
1018
- }
1019
-
1020
- /**
1021
- * Places the 8 bits of the first special corner case.
1022
- * (Annex F - ECC 200 symbol character placement)
1023
- * @param $marr (array) Array of symbols.
1024
- * @param $nrow (int) Number of rows.
1025
- * @param $ncol (int) Number of columns.
1026
- * @param $chr (int) Char byte.
1027
- * @return array
1028
- * @protected
1029
- */
1030
- protected function placeCornerA($marr, $nrow, $ncol, $chr) {
1031
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 1);
1032
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 1, $chr, 2);
1033
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 2, $chr, 3);
1034
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4);
1035
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5);
1036
- $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 6);
1037
- $marr = $this->placeModule($marr, $nrow, $ncol, 2, $ncol-1, $chr, 7);
1038
- $marr = $this->placeModule($marr, $nrow, $ncol, 3, $ncol-1, $chr, 8);
1039
- return $marr;
1040
- }
1041
-
1042
- /**
1043
- * Places the 8 bits of the second special corner case.
1044
- * (Annex F - ECC 200 symbol character placement)
1045
- * @param $marr (array) Array of symbols.
1046
- * @param $nrow (int) Number of rows.
1047
- * @param $ncol (int) Number of columns.
1048
- * @param $chr (int) Char byte.
1049
- * @return array
1050
- * @protected
1051
- */
1052
- protected function placeCornerB($marr, $nrow, $ncol, $chr) {
1053
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-3, 0, $chr, 1);
1054
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-2, 0, $chr, 2);
1055
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 3);
1056
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-4, $chr, 4);
1057
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-3, $chr, 5);
1058
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 6);
1059
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 7);
1060
- $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 8);
1061
- return $marr;
1062
- }
1063
-
1064
- /**
1065
- * Places the 8 bits of the third special corner case.
1066
- * (Annex F - ECC 200 symbol character placement)
1067
- * @param $marr (array) Array of symbols.
1068
- * @param $nrow (int) Number of rows.
1069
- * @param $ncol (int) Number of columns.
1070
- * @param $chr (int) Char byte.
1071
- * @return array
1072
- * @protected
1073
- */
1074
- protected function placeCornerC($marr, $nrow, $ncol, $chr) {
1075
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-3, 0, $chr, 1);
1076
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-2, 0, $chr, 2);
1077
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 3);
1078
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4);
1079
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5);
1080
- $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 6);
1081
- $marr = $this->placeModule($marr, $nrow, $ncol, 2, $ncol-1, $chr, 7);
1082
- $marr = $this->placeModule($marr, $nrow, $ncol, 3, $ncol-1, $chr, 8);
1083
- return $marr;
1084
- }
1085
-
1086
- /**
1087
- * Places the 8 bits of the fourth special corner case.
1088
- * (Annex F - ECC 200 symbol character placement)
1089
- * @param $marr (array) Array of symbols.
1090
- * @param $nrow (int) Number of rows.
1091
- * @param $ncol (int) Number of columns.
1092
- * @param $chr (int) Char byte.
1093
- * @return array
1094
- * @protected
1095
- */
1096
- protected function placeCornerD($marr, $nrow, $ncol, $chr) {
1097
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 1);
1098
- $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, $ncol-1, $chr, 2);
1099
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-3, $chr, 3);
1100
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4);
1101
- $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5);
1102
- $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-3, $chr, 6);
1103
- $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-2, $chr, 7);
1104
- $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 8);
1105
- return $marr;
1106
- }
1107
-
1108
- /**
1109
- * Build a placement map.
1110
- * (Annex F - ECC 200 symbol character placement)
1111
- * @param $nrow (int) Number of rows.
1112
- * @param $ncol (int) Number of columns.
1113
- * @return array
1114
- * @protected
1115
- */
1116
- protected function getPlacementMap($nrow, $ncol) {
1117
- // initialize array with zeros
1118
- $marr = array_fill(0, ($nrow * $ncol), 0);
1119
- // set starting values
1120
- $chr = 1;
1121
- $row = 4;
1122
- $col = 0;
1123
- do {
1124
- // repeatedly first check for one of the special corner cases, then
1125
- if (($row == $nrow) AND ($col == 0)) {
1126
- $marr = $this->placeCornerA($marr, $nrow, $ncol, $chr);
1127
- ++$chr;
1128
- }
1129
- if (($row == ($nrow - 2)) AND ($col == 0) AND ($ncol % 4)) {
1130
- $marr = $this->placeCornerB($marr, $nrow, $ncol, $chr);
1131
- ++$chr;
1132
- }
1133
- if (($row == ($nrow - 2)) AND ($col == 0) AND (($ncol % 8) == 4)) {
1134
- $marr = $this->placeCornerC($marr, $nrow, $ncol, $chr);
1135
- ++$chr;
1136
- }
1137
- if (($row == ($nrow + 4)) AND ($col == 2) AND (!($ncol % 8))) {
1138
- $marr = $this->placeCornerD($marr, $nrow, $ncol, $chr);
1139
- ++$chr;
1140
- }
1141
- // sweep upward diagonally, inserting successive characters,
1142
- do {
1143
- if (($row < $nrow) AND ($col >= 0) AND (!$marr[(($row * $ncol) + $col)])) {
1144
- $marr = $this->placeUtah($marr, $nrow, $ncol, $row, $col, $chr);
1145
- ++$chr;
1146
- }
1147
- $row -= 2;
1148
- $col += 2;
1149
- } while (($row >= 0) AND ($col < $ncol));
1150
- ++$row;
1151
- $col += 3;
1152
- // & then sweep downward diagonally, inserting successive characters,...
1153
- do {
1154
- if (($row >= 0) AND ($col < $ncol) AND (!$marr[(($row * $ncol) + $col)])) {
1155
- $marr = $this->placeUtah($marr, $nrow, $ncol, $row, $col, $chr);
1156
- ++$chr;
1157
- }
1158
- $row += 2;
1159
- $col -= 2;
1160
- } while (($row < $nrow) AND ($col >= 0));
1161
- $row += 3;
1162
- ++$col;
1163
- // ... until the entire array is scanned
1164
- } while (($row < $nrow) OR ($col < $ncol));
1165
- // lastly, if the lower righthand corner is untouched, fill in fixed pattern
1166
- if (!$marr[(($nrow * $ncol) - 1)]) {
1167
- $marr[(($nrow * $ncol) - 1)] = 1;
1168
- $marr[(($nrow * $ncol) - $ncol - 2)] = 1;
1169
- }
1170
- return $marr;
1171
- }
1172
-
1173
- } // end DataMatrix class
1174
- //============================================================+
1175
- // END OF FILE
1176
- //============================================================+
1
+ <?php
2
+ //============================================================+
3
+ // File name : datamatrix.php
4
+ // Version : 1.0.008
5
+ // Begin : 2010-06-07
6
+ // Last Update : 2014-05-06
7
+ // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
+ // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
+ // -------------------------------------------------------------------
10
+ // Copyright (C) 2010-2014 Nicola Asuni - Tecnick.com LTD
11
+ //
12
+ // This file is part of TCPDF software library.
13
+ //
14
+ // TCPDF is free software: you can redistribute it and/or modify it
15
+ // under the terms of the GNU Lesser General Public License as
16
+ // published by the Free Software Foundation, either version 3 of the
17
+ // License, or (at your option) any later version.
18
+ //
19
+ // TCPDF is distributed in the hope that it will be useful, but
20
+ // WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
+ // See the GNU Lesser General Public License for more details.
23
+ //
24
+ // You should have received a copy of the GNU Lesser General Public License
25
+ // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
+ //
27
+ // See LICENSE.TXT file for more information.
28
+ // -------------------------------------------------------------------
29
+ //
30
+ // DESCRIPTION :
31
+ //
32
+ // Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
33
+ // DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
34
+ //============================================================+
35
+
36
+ /**
37
+ * @file
38
+ * Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
39
+ * DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
40
+ *
41
+ * @package com.tecnick.tcpdf
42
+ * @author Nicola Asuni
43
+ * @version 1.0.008
44
+ */
45
+
46
+ // custom definitions
47
+ if (!defined('DATAMATRIXDEFS')) {
48
+
49
+ /**
50
+ * Indicate that definitions for this class are set
51
+ */
52
+ define('DATAMATRIXDEFS', true);
53
+
54
+ // -----------------------------------------------------
55
+
56
+ } // end of custom definitions
57
+
58
+ // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
59
+
60
+
61
+ /**
62
+ * ASCII encoding: ASCII character 0 to 127 (1 byte per CW)
63
+ */
64
+ define('ENC_ASCII', 0);
65
+
66
+ /**
67
+ * C40 encoding: Upper-case alphanumeric (3/2 bytes per CW)
68
+ */
69
+ define('ENC_C40', 1);
70
+
71
+ /**
72
+ * TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW)
73
+ */
74
+ define('ENC_TXT', 2);
75
+
76
+ /**
77
+ * X12 encoding: ANSI X12 (3/2 byte per CW)
78
+ */
79
+ define('ENC_X12', 3);
80
+
81
+ /**
82
+ * EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW)
83
+ */
84
+ define('ENC_EDF', 4);
85
+
86
+ /**
87
+ * BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW)
88
+ */
89
+ define('ENC_BASE256', 5);
90
+
91
+ /**
92
+ * ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW)
93
+ */
94
+ define('ENC_ASCII_EXT', 6);
95
+
96
+ /**
97
+ * ASCII number encoding: ASCII digits (2 bytes per CW)
98
+ */
99
+ define('ENC_ASCII_NUM', 7);
100
+
101
+ /**
102
+ * @class Datamatrix
103
+ * Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
104
+ * DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
105
+ *
106
+ * @package com.tecnick.tcpdf
107
+ * @author Nicola Asuni
108
+ * @version 1.0.004
109
+ */
110
+ class Datamatrix {
111
+
112
+ /**
113
+ * Barcode array to be returned which is readable by TCPDF.
114
+ * @protected
115
+ */
116
+ protected $barcode_array = array();
117
+
118
+ /**
119
+ * Store last used encoding for data codewords.
120
+ * @protected
121
+ */
122
+ protected $last_enc = ENC_ASCII;
123
+
124
+ /**
125
+ * Table of Data Matrix ECC 200 Symbol Attributes:<ul>
126
+ * <li>total matrix rows (including finder pattern)</li>
127
+ * <li>total matrix cols (including finder pattern)</li>
128
+ * <li>total matrix rows (without finder pattern)</li>
129
+ * <li>total matrix cols (without finder pattern)</li>
130
+ * <li>region data rows (with finder pattern)</li>
131
+ * <li>region data col (with finder pattern)</li>
132
+ * <li>region data rows (without finder pattern)</li>
133
+ * <li>region data col (without finder pattern)</li>
134
+ * <li>horizontal regions</li>
135
+ * <li>vertical regions</li>
136
+ * <li>regions</li>
137
+ * <li>data codewords</li>
138
+ * <li>error codewords</li>
139
+ * <li>blocks</li>
140
+ * <li>data codewords per block</li>
141
+ * <li>error codewords per block</li>
142
+ * </ul>
143
+ * @protected
144
+ */
145
+ protected $symbattr = array(
146
+ // square form ---------------------------------------------------------------------------------------
147
+ array(0x00a,0x00a,0x008,0x008,0x00a,0x00a,0x008,0x008,0x001,0x001,0x001,0x003,0x005,0x001,0x003,0x005), // 10x10
148
+ array(0x00c,0x00c,0x00a,0x00a,0x00c,0x00c,0x00a,0x00a,0x001,0x001,0x001,0x005,0x007,0x001,0x005,0x007), // 12x12
149
+ array(0x00e,0x00e,0x00c,0x00c,0x00e,0x00e,0x00c,0x00c,0x001,0x001,0x001,0x008,0x00a,0x001,0x008,0x00a), // 14x14
150
+ array(0x010,0x010,0x00e,0x00e,0x010,0x010,0x00e,0x00e,0x001,0x001,0x001,0x00c,0x00c,0x001,0x00c,0x00c), // 16x16
151
+ array(0x012,0x012,0x010,0x010,0x012,0x012,0x010,0x010,0x001,0x001,0x001,0x012,0x00e,0x001,0x012,0x00e), // 18x18
152
+ array(0x014,0x014,0x012,0x012,0x014,0x014,0x012,0x012,0x001,0x001,0x001,0x016,0x012,0x001,0x016,0x012), // 20x20
153
+ array(0x016,0x016,0x014,0x014,0x016,0x016,0x014,0x014,0x001,0x001,0x001,0x01e,0x014,0x001,0x01e,0x014), // 22x22
154
+ array(0x018,0x018,0x016,0x016,0x018,0x018,0x016,0x016,0x001,0x001,0x001,0x024,0x018,0x001,0x024,0x018), // 24x24
155
+ array(0x01a,0x01a,0x018,0x018,0x01a,0x01a,0x018,0x018,0x001,0x001,0x001,0x02c,0x01c,0x001,0x02c,0x01c), // 26x26
156
+ array(0x020,0x020,0x01c,0x01c,0x010,0x010,0x00e,0x00e,0x002,0x002,0x004,0x03e,0x024,0x001,0x03e,0x024), // 32x32
157
+ array(0x024,0x024,0x020,0x020,0x012,0x012,0x010,0x010,0x002,0x002,0x004,0x056,0x02a,0x001,0x056,0x02a), // 36x36
158
+ array(0x028,0x028,0x024,0x024,0x014,0x014,0x012,0x012,0x002,0x002,0x004,0x072,0x030,0x001,0x072,0x030), // 40x40
159
+ array(0x02c,0x02c,0x028,0x028,0x016,0x016,0x014,0x014,0x002,0x002,0x004,0x090,0x038,0x001,0x090,0x038), // 44x44
160
+ array(0x030,0x030,0x02c,0x02c,0x018,0x018,0x016,0x016,0x002,0x002,0x004,0x0ae,0x044,0x001,0x0ae,0x044), // 48x48
161
+ array(0x034,0x034,0x030,0x030,0x01a,0x01a,0x018,0x018,0x002,0x002,0x004,0x0cc,0x054,0x002,0x066,0x02a), // 52x52
162
+ array(0x040,0x040,0x038,0x038,0x010,0x010,0x00e,0x00e,0x004,0x004,0x010,0x118,0x070,0x002,0x08c,0x038), // 64x64
163
+ array(0x048,0x048,0x040,0x040,0x012,0x012,0x010,0x010,0x004,0x004,0x010,0x170,0x090,0x004,0x05c,0x024), // 72x72
164
+ array(0x050,0x050,0x048,0x048,0x014,0x014,0x012,0x012,0x004,0x004,0x010,0x1c8,0x0c0,0x004,0x072,0x030), // 80x80
165
+ array(0x058,0x058,0x050,0x050,0x016,0x016,0x014,0x014,0x004,0x004,0x010,0x240,0x0e0,0x004,0x090,0x038), // 88x88
166
+ array(0x060,0x060,0x058,0x058,0x018,0x018,0x016,0x016,0x004,0x004,0x010,0x2b8,0x110,0x004,0x0ae,0x044), // 96x96
167
+ array(0x068,0x068,0x060,0x060,0x01a,0x01a,0x018,0x018,0x004,0x004,0x010,0x330,0x150,0x006,0x088,0x038), // 104x104
168
+ array(0x078,0x078,0x06c,0x06c,0x014,0x014,0x012,0x012,0x006,0x006,0x024,0x41a,0x198,0x006,0x0af,0x044), // 120x120
169
+ array(0x084,0x084,0x078,0x078,0x016,0x016,0x014,0x014,0x006,0x006,0x024,0x518,0x1f0,0x008,0x0a3,0x03e), // 132x132
170
+ array(0x090,0x090,0x084,0x084,0x018,0x018,0x016,0x016,0x006,0x006,0x024,0x616,0x26c,0x00a,0x09c,0x03e), // 144x144
171
+ // rectangular form (currently unused) ---------------------------------------------------------------------------
172
+ array(0x008,0x012,0x006,0x010,0x008,0x012,0x006,0x010,0x001,0x001,0x001,0x005,0x007,0x001,0x005,0x007), // 8x18
173
+ array(0x008,0x020,0x006,0x01c,0x008,0x010,0x006,0x00e,0x001,0x002,0x002,0x00a,0x00b,0x001,0x00a,0x00b), // 8x32
174
+ array(0x00c,0x01a,0x00a,0x018,0x00c,0x01a,0x00a,0x018,0x001,0x001,0x001,0x010,0x00e,0x001,0x010,0x00e), // 12x26
175
+ array(0x00c,0x024,0x00a,0x020,0x00c,0x012,0x00a,0x010,0x001,0x002,0x002,0x00c,0x012,0x001,0x00c,0x012), // 12x36
176
+ array(0x010,0x024,0x00e,0x020,0x010,0x012,0x00e,0x010,0x001,0x002,0x002,0x020,0x018,0x001,0x020,0x018), // 16x36
177
+ array(0x010,0x030,0x00e,0x02c,0x010,0x018,0x00e,0x016,0x001,0x002,0x002,0x031,0x01c,0x001,0x031,0x01c) // 16x48
178
+ );
179
+
180
+ /**
181
+ * Map encodation modes whit character sets.
182
+ * @protected
183
+ */
184
+ protected $chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12');
185
+
186
+ /**
187
+ * Basic set of characters for each encodation mode.
188
+ * @protected
189
+ */
190
+ protected $chset = array(
191
+ 'C40' => array( // Basic set for C40 ----------------------------------------------------------------------------
192
+ 'S1'=>0x00,'S2'=>0x01,'S3'=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, //
193
+ 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x41=>0x0e,0x42=>0x0f,0x43=>0x10,0x44=>0x11,0x45=>0x12,0x46=>0x13, //
194
+ 0x47=>0x14,0x48=>0x15,0x49=>0x16,0x4a=>0x17,0x4b=>0x18,0x4c=>0x19,0x4d=>0x1a,0x4e=>0x1b,0x4f=>0x1c,0x50=>0x1d, //
195
+ 0x51=>0x1e,0x52=>0x1f,0x53=>0x20,0x54=>0x21,0x55=>0x22,0x56=>0x23,0x57=>0x24,0x58=>0x25,0x59=>0x26,0x5a=>0x27),//
196
+ 'TXT' => array( // Basic set for TEXT ---------------------------------------------------------------------------
197
+ 'S1'=>0x00,'S2'=>0x01,'S3'=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, //
198
+ 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x61=>0x0e,0x62=>0x0f,0x63=>0x10,0x64=>0x11,0x65=>0x12,0x66=>0x13, //
199
+ 0x67=>0x14,0x68=>0x15,0x69=>0x16,0x6a=>0x17,0x6b=>0x18,0x6c=>0x19,0x6d=>0x1a,0x6e=>0x1b,0x6f=>0x1c,0x70=>0x1d, //
200
+ 0x71=>0x1e,0x72=>0x1f,0x73=>0x20,0x74=>0x21,0x75=>0x22,0x76=>0x23,0x77=>0x24,0x78=>0x25,0x79=>0x26,0x7a=>0x27),//
201
+ 'SH1' => array( // Shift 1 set ----------------------------------------------------------------------------------
202
+ 0x00=>0x00,0x01=>0x01,0x02=>0x02,0x03=>0x03,0x04=>0x04,0x05=>0x05,0x06=>0x06,0x07=>0x07,0x08=>0x08,0x09=>0x09, //
203
+ 0x0a=>0x0a,0x0b=>0x0b,0x0c=>0x0c,0x0d=>0x0d,0x0e=>0x0e,0x0f=>0x0f,0x10=>0x10,0x11=>0x11,0x12=>0x12,0x13=>0x13, //
204
+ 0x14=>0x14,0x15=>0x15,0x16=>0x16,0x17=>0x17,0x18=>0x18,0x19=>0x19,0x1a=>0x1a,0x1b=>0x1b,0x1c=>0x1c,0x1d=>0x1d, //
205
+ 0x1e=>0x1e,0x1f=>0x1f), //
206
+ 'SH2' => array( // Shift 2 set ----------------------------------------------------------------------------------
207
+ 0x21=>0x00,0x22=>0x01,0x23=>0x02,0x24=>0x03,0x25=>0x04,0x26=>0x05,0x27=>0x06,0x28=>0x07,0x29=>0x08,0x2a=>0x09, //
208
+ 0x2b=>0x0a,0x2c=>0x0b,0x2d=>0x0c,0x2e=>0x0d,0x2f=>0x0e,0x3a=>0x0f,0x3b=>0x10,0x3c=>0x11,0x3d=>0x12,0x3e=>0x13, //
209
+ 0x3f=>0x14,0x40=>0x15,0x5b=>0x16,0x5c=>0x17,0x5d=>0x18,0x5e=>0x19,0x5f=>0x1a,'F1'=>0x1b,'US'=>0x1e), //
210
+ 'S3C' => array( // Shift 3 set for C40 --------------------------------------------------------------------------
211
+ 0x60=>0x00,0x61=>0x01,0x62=>0x02,0x63=>0x03,0x64=>0x04,0x65=>0x05,0x66=>0x06,0x67=>0x07,0x68=>0x08,0x69=>0x09, //
212
+ 0x6a=>0x0a,0x6b=>0x0b,0x6c=>0x0c,0x6d=>0x0d,0x6e=>0x0e,0x6f=>0x0f,0x70=>0x10,0x71=>0x11,0x72=>0x12,0x73=>0x13, //
213
+ 0x74=>0x14,0x75=>0x15,0x76=>0x16,0x77=>0x17,0x78=>0x18,0x79=>0x19,0x7a=>0x1a,0x7b=>0x1b,0x7c=>0x1c,0x7d=>0x1d, //
214
+ 0x7e=>0x1e,0x7f=>0x1f),
215
+ 'S3T' => array( // Shift 3 set for TEXT -------------------------------------------------------------------------
216
+ 0x60=>0x00,0x41=>0x01,0x42=>0x02,0x43=>0x03,0x44=>0x04,0x45=>0x05,0x46=>0x06,0x47=>0x07,0x48=>0x08,0x49=>0x09, //
217
+ 0x4a=>0x0a,0x4b=>0x0b,0x4c=>0x0c,0x4d=>0x0d,0x4e=>0x0e,0x4f=>0x0f,0x50=>0x10,0x51=>0x11,0x52=>0x12,0x53=>0x13, //
218
+ 0x54=>0x14,0x55=>0x15,0x56=>0x16,0x57=>0x17,0x58=>0x18,0x59=>0x19,0x5a=>0x1a,0x7b=>0x1b,0x7c=>0x1c,0x7d=>0x1d, //
219
+ 0x7e=>0x1e,0x7f=>0x1f), //
220
+ 'X12' => array( // Set for X12 ----------------------------------------------------------------------------------
221
+ 0x0d=>0x00,0x2a=>0x01,0x3e=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, //
222
+ 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x41=>0x0e,0x42=>0x0f,0x43=>0x10,0x44=>0x11,0x45=>0x12,0x46=>0x13, //
223
+ 0x47=>0x14,0x48=>0x15,0x49=>0x16,0x4a=>0x17,0x4b=>0x18,0x4c=>0x19,0x4d=>0x1a,0x4e=>0x1b,0x4f=>0x1c,0x50=>0x1d, //
224
+ 0x51=>0x1e,0x52=>0x1f,0x53=>0x20,0x54=>0x21,0x55=>0x22,0x56=>0x23,0x57=>0x24,0x58=>0x25,0x59=>0x26,0x5a=>0x27) //
225
+ );
226
+
227
+ // -----------------------------------------------------------------------------
228
+
229
+ /**
230
+ * This is the class constructor.
231
+ * Creates a datamatrix object
232
+ * @param $code (string) Code to represent using Datamatrix.
233
+ * @public
234
+ */
235
+ public function __construct($code) {
236
+ $barcode_array = array();
237
+ if ((is_null($code)) OR ($code == '\0') OR ($code == '')) {
238
+ return false;
239
+ }
240
+ // get data codewords
241
+ $cw = $this->getHighLevelEncoding($code);
242
+ // number of data codewords
243
+ $nd = count($cw);
244
+ // check size
245
+ if ($nd > 1558) {
246
+ return false;
247
+ }
248
+ // get minimum required matrix size.
249
+ foreach ($this->symbattr as $params) {
250
+ if ($params[11] >= $nd) {
251
+ break;
252
+ }
253
+ }
254
+ if ($params[11] < $nd) {
255
+ // too much data
256
+ return false;
257
+ } elseif ($params[11] > $nd) {
258
+ // add padding
259
+ if ((($params[11] - $nd) > 1) AND ($cw[($nd - 1)] != 254)) {
260
+ if ($this->last_enc == ENC_EDF) {
261
+ // switch to ASCII encoding
262
+ $cw[] = 124;
263
+ ++$nd;
264
+ } elseif (($this->last_enc != ENC_ASCII) AND ($this->last_enc != ENC_BASE256)) {
265
+ // switch to ASCII encoding
266
+ $cw[] = 254;
267
+ ++$nd;
268
+ }
269
+ }
270
+ if ($params[11] > $nd) {
271
+ // add first pad
272
+ $cw[] = 129;
273
+ ++$nd;
274
+ // add remaining pads
275
+ for ($i = $nd; $i < $params[11]; ++$i) {
276
+ $cw[] = $this->get253StateCodeword(129, $i);
277
+ }
278
+ }
279
+ }
280
+ // add error correction codewords
281
+ $cw = $this->getErrorCorrection($cw, $params[13], $params[14], $params[15]);
282
+ // initialize empty arrays
283
+ $grid = array_fill(0, ($params[2] * $params[3]), 0);
284
+ // get placement map
285
+ $places = $this->getPlacementMap($params[2], $params[3]);
286
+ // fill the grid with data
287
+ $grid = array();
288
+ $i = 0;
289
+ // region data row max index
290
+ $rdri = ($params[4] - 1);
291
+ // region data column max index
292
+ $rdci = ($params[5] - 1);
293
+ // for each vertical region
294
+ for ($vr = 0; $vr < $params[9]; ++$vr) {
295
+ // for each row on region
296
+ for ($r = 0; $r < $params[4]; ++$r) {
297
+ // get row
298
+ $row = (($vr * $params[4]) + $r);
299
+ // for each horizontal region
300
+ for ($hr = 0; $hr < $params[8]; ++$hr) {
301
+ // for each column on region
302
+ for ($c = 0; $c < $params[5]; ++$c) {
303
+ // get column
304
+ $col = (($hr * $params[5]) + $c);
305
+ // braw bits by case
306
+ if ($r == 0) {
307
+ // top finder pattern
308
+ if ($c % 2) {
309
+ $grid[$row][$col] = 0;
310
+ } else {
311
+ $grid[$row][$col] = 1;
312
+ }
313
+ } elseif ($r == $rdri) {
314
+ // bottom finder pattern
315
+ $grid[$row][$col] = 1;
316
+ } elseif ($c == 0) {
317
+ // left finder pattern
318
+ $grid[$row][$col] = 1;
319
+ } elseif ($c == $rdci) {
320
+ // right finder pattern
321
+ if ($r % 2) {
322
+ $grid[$row][$col] = 1;
323
+ } else {
324
+ $grid[$row][$col] = 0;
325
+ }
326
+ } else { // data bit
327
+ if ($places[$i] < 2) {
328
+ $grid[$row][$col] = $places[$i];
329
+ } else {
330
+ // codeword ID
331
+ $cw_id = (floor($places[$i] / 10) - 1);
332
+ // codeword BIT mask
333
+ $cw_bit = pow(2, (8 - ($places[$i] % 10)));
334
+ $grid[$row][$col] = (($cw[$cw_id] & $cw_bit) == 0) ? 0 : 1;
335
+ }
336
+ ++$i;
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
342
+ $this->barcode_array['num_rows'] = $params[0];
343
+ $this->barcode_array['num_cols'] = $params[1];
344
+ $this->barcode_array['bcode'] = $grid;
345
+ }
346
+
347
+ /**
348
+ * Returns a barcode array which is readable by TCPDF
349
+ * @return array barcode array readable by TCPDF;
350
+ * @public
351
+ */
352
+ public function getBarcodeArray() {
353
+ return $this->barcode_array;
354
+ }
355
+
356
+ /**
357
+ * Product of two numbers in a Power-of-Two Galois Field
358
+ * @param $a (int) first number to multiply.
359
+ * @param $b (int) second number to multiply.
360
+ * @param $log (array) Log table.
361
+ * @param $alog (array) Anti-Log table.
362
+ * @param $gf (array) Number of Factors of the Reed-Solomon polynomial.
363
+ * @return int product
364
+ * @protected
365
+ */
366
+ protected function getGFProduct($a, $b, $log, $alog, $gf) {
367
+ if (($a == 0) OR ($b == 0)) {
368
+ return 0;
369
+ }
370
+ return ($alog[($log[$a] + $log[$b]) % ($gf - 1)]);
371
+ }
372
+
373
+ /**
374
+ * Add error correction codewords to data codewords array (ANNEX E).
375
+ * @param $wd (array) Array of datacodewords.
376
+ * @param $nb (int) Number of blocks.
377
+ * @param $nd (int) Number of data codewords per block.
378
+ * @param $nc (int) Number of correction codewords per block.
379
+ * @param $gf (int) numner of fields on log/antilog table (power of 2).
380
+ * @param $pp (int) The value of its prime modulus polynomial (301 for ECC200).
381
+ * @return array data codewords + error codewords
382
+ * @protected
383
+ */
384
+ protected function getErrorCorrection($wd, $nb, $nd, $nc, $gf=256, $pp=301) {
385
+ // generate the log ($log) and antilog ($alog) tables
386
+ $log[0] = 0;
387
+ $alog[0] = 1;
388
+ for ($i = 1; $i < $gf; ++$i) {
389
+ $alog[$i] = ($alog[($i - 1)] * 2);
390
+ if ($alog[$i] >= $gf) {
391
+ $alog[$i] ^= $pp;
392
+ }
393
+ $log[$alog[$i]] = $i;
394
+ }
395
+ ksort($log);
396
+ // generate the polynomial coefficients (c)
397
+ $c = array_fill(0, ($nc + 1), 0);
398
+ $c[0] = 1;
399
+ for ($i = 1; $i <= $nc; ++$i) {
400
+ $c[$i] = $c[($i-1)];
401
+ for ($j = ($i - 1); $j >= 1; --$j) {
402
+ $c[$j] = $c[($j - 1)] ^ $this->getGFProduct($c[$j], $alog[$i], $log, $alog, $gf);
403
+ }
404
+ $c[0] = $this->getGFProduct($c[0], $alog[$i], $log, $alog, $gf);
405
+ }
406
+ ksort($c);
407
+ // total number of data codewords
408
+ $num_wd = ($nb * $nd);
409
+ // total number of error codewords
410
+ $num_we = ($nb * $nc);
411
+ // for each block
412
+ for ($b = 0; $b < $nb; ++$b) {
413
+ // create interleaved data block
414
+ $block = array();
415
+ for ($n = $b; $n < $num_wd; $n += $nb) {
416
+ $block[] = $wd[$n];
417
+ }
418
+ // initialize error codewords
419
+ $we = array_fill(0, ($nc + 1), 0);
420
+ // calculate error correction codewords for this block
421
+ for ($i = 0; $i < $nd; ++$i) {
422
+ $k = ($we[0] ^ $block[$i]);
423
+ for ($j = 0; $j < $nc; ++$j) {
424
+ $we[$j] = ($we[($j + 1)] ^ $this->getGFProduct($k, $c[($nc - $j - 1)], $log, $alog, $gf));
425
+ }
426
+ }
427
+ // add error codewords at the end of data codewords
428
+ $j = 0;
429
+ for ($i = $b; $i < $num_we; $i += $nb) {
430
+ $wd[($num_wd + $i)] = $we[$j];
431
+ ++$j;
432
+ }
433
+ }
434
+ // reorder codewords
435
+ ksort($wd);
436
+ return $wd;
437
+ }
438
+
439
+ /**
440
+ * Return the 253-state codeword
441
+ * @param $cwpad (int) Pad codeword.
442
+ * @param $cwpos (int) Number of data codewords from the beginning of encoded data.
443
+ * @return pad codeword
444
+ * @protected
445
+ */
446
+ protected function get253StateCodeword($cwpad, $cwpos) {
447
+ $pad = ($cwpad + (((149 * $cwpos) % 253) + 1));
448
+ if ($pad > 254) {
449
+ $pad -= 254;
450
+ }
451
+ return $pad;
452
+ }
453
+
454
+ /**
455
+ * Return the 255-state codeword
456
+ * @param $cwpad (int) Pad codeword.
457
+ * @param $cwpos (int) Number of data codewords from the beginning of encoded data.
458
+ * @return pad codeword
459
+ * @protected
460
+ */
461
+ protected function get255StateCodeword($cwpad, $cwpos) {
462
+ $pad = ($cwpad + (((149 * $cwpos) % 255) + 1));
463
+ if ($pad > 255) {
464
+ $pad -= 256;
465
+ }
466
+ return $pad;
467
+ }
468
+
469
+ /**
470
+ * Returns true if the char belongs to the selected mode
471
+ * @param $chr (int) Character (byte) to check.
472
+ * @param $mode (int) Current encoding mode.
473
+ * @return boolean true if the char is of the selected mode.
474
+ * @protected
475
+ */
476
+ protected function isCharMode($chr, $mode) {
477
+ $status = false;
478
+ switch ($mode) {
479
+ case ENC_ASCII: { // ASCII character 0 to 127
480
+ $status = (($chr >= 0) AND ($chr <= 127));
481
+ break;
482
+ }
483
+ case ENC_C40: { // Upper-case alphanumeric
484
+ $status = (($chr == 32) OR (($chr >= 48) AND ($chr <= 57)) OR (($chr >= 65) AND ($chr <= 90)));
485
+ break;
486
+ }
487
+ case ENC_TXT: { // Lower-case alphanumeric
488
+ $status = (($chr == 32) OR (($chr >= 48) AND ($chr <= 57)) OR (($chr >= 97) AND ($chr <= 122)));
489
+ break;
490
+ }
491
+ case ENC_X12: { // ANSI X12
492
+ $status = (($chr == 13) OR ($chr == 42) OR ($chr == 62));
493
+ break;
494
+ }
495
+ case ENC_EDF: { // ASCII character 32 to 94
496
+ $status = (($chr >= 32) AND ($chr <= 94));
497
+ break;
498
+ }
499
+ case ENC_BASE256: { // Function character (FNC1, Structured Append, Reader Program, or Code Page)
500
+ $status = (($chr == 232) OR ($chr == 233) OR ($chr == 234) OR ($chr == 241));
501
+ break;
502
+ }
503
+ case ENC_ASCII_EXT: { // ASCII character 128 to 255
504
+ $status = (($chr >= 128) AND ($chr <= 255));
505
+ break;
506
+ }
507
+ case ENC_ASCII_NUM: { // ASCII digits
508
+ $status = (($chr >= 48) AND ($chr <= 57));
509
+ break;
510
+ }
511
+ }
512
+ return $status;
513
+ }
514
+
515
+ /**
516
+ * The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S).
517
+ * @param $data (string) data to encode
518
+ * @param $pos (int) current position
519
+ * @param $mode (int) current encoding mode
520
+ * @return int encoding mode
521
+ * @protected
522
+ */
523
+ protected function lookAheadTest($data, $pos, $mode) {
524
+ $data_length = strlen($data);
525
+ if ($pos >= $data_length) {
526
+ return $mode;
527
+ }
528
+ $charscount = 0; // count processed chars
529
+ // STEP J
530
+ if ($mode == ENC_ASCII) {
531
+ $numch = array(0, 1, 1, 1, 1, 1.25);
532
+ } else {
533
+ $numch = array(1, 2, 2, 2, 2, 2.25);
534
+ $numch[$mode] = 0;
535
+ }
536
+ while (true) {
537
+ // STEP K
538
+ if (($pos + $charscount) == $data_length) {
539
+ if ($numch[ENC_ASCII] <= ceil(min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256]))) {
540
+ return ENC_ASCII;
541
+ }
542
+ if ($numch[ENC_BASE256] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF]))) {
543
+ return ENC_BASE256;
544
+ }
545
+ if ($numch[ENC_EDF] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_BASE256]))) {
546
+ return ENC_EDF;
547
+ }
548
+ if ($numch[ENC_TXT] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256]))) {
549
+ return ENC_TXT;
550
+ }
551
+ if ($numch[ENC_X12] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256]))) {
552
+ return ENC_X12;
553
+ }
554
+ return ENC_C40;
555
+ }
556
+ // get char
557
+ $chr = ord($data[$pos + $charscount]);
558
+ $charscount++;
559
+ // STEP L
560
+ if ($this->isCharMode($chr, ENC_ASCII_NUM)) {
561
+ $numch[ENC_ASCII] += (1 / 2);
562
+ } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
563
+ $numch[ENC_ASCII] = ceil($numch[ENC_ASCII]);
564
+ $numch[ENC_ASCII] += 2;
565
+ } else {
566
+ $numch[ENC_ASCII] = ceil($numch[ENC_ASCII]);
567
+ $numch[ENC_ASCII] += 1;
568
+ }
569
+ // STEP M
570
+ if ($this->isCharMode($chr, ENC_C40)) {
571
+ $numch[ENC_C40] += (2 / 3);
572
+ } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
573
+ $numch[ENC_C40] += (8 / 3);
574
+ } else {
575
+ $numch[ENC_C40] += (4 / 3);
576
+ }
577
+ // STEP N
578
+ if ($this->isCharMode($chr, ENC_TXT)) {
579
+ $numch[ENC_TXT] += (2 / 3);
580
+ } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
581
+ $numch[ENC_TXT] += (8 / 3);
582
+ } else {
583
+ $numch[ENC_TXT] += (4 / 3);
584
+ }
585
+ // STEP O
586
+ if ($this->isCharMode($chr, ENC_X12) OR $this->isCharMode($chr, ENC_C40)) {
587
+ $numch[ENC_X12] += (2 / 3);
588
+ } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
589
+ $numch[ENC_X12] += (13 / 3);
590
+ } else {
591
+ $numch[ENC_X12] += (10 / 3);
592
+ }
593
+ // STEP P
594
+ if ($this->isCharMode($chr, ENC_EDF)) {
595
+ $numch[ENC_EDF] += (3 / 4);
596
+ } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) {
597
+ $numch[ENC_EDF] += (17 / 4);
598
+ } else {
599
+ $numch[ENC_EDF] += (13 / 4);
600
+ }
601
+ // STEP Q
602
+ if ($this->isCharMode($chr, ENC_BASE256)) {
603
+ $numch[ENC_BASE256] += 4;
604
+ } else {
605
+ $numch[ENC_BASE256] += 1;
606
+ }
607
+ // STEP R
608
+ if ($charscount >= 4) {
609
+ if (($numch[ENC_ASCII] + 1) <= min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256])) {
610
+ return ENC_ASCII;
611
+ }
612
+ if ((($numch[ENC_BASE256] + 1) <= $numch[ENC_ASCII])
613
+ OR (($numch[ENC_BASE256] + 1) < min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF]))) {
614
+ return ENC_BASE256;
615
+ }
616
+ if (($numch[ENC_EDF] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_BASE256])) {
617
+ return ENC_EDF;
618
+ }
619
+ if (($numch[ENC_TXT] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256])) {
620
+ return ENC_TXT;
621
+ }
622
+ if (($numch[ENC_X12] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256])) {
623
+ return ENC_X12;
624
+ }
625
+ if (($numch[ENC_C40] + 1) < min($numch[ENC_ASCII], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256])) {
626
+ if ($numch[ENC_C40] < $numch[ENC_X12]) {
627
+ return ENC_C40;
628
+ }
629
+ if ($numch[ENC_C40] == $numch[ENC_X12]) {
630
+ $k = ($pos + $charscount + 1);
631
+ while ($k < $data_length) {
632
+ $tmpchr = ord($data{$k});
633
+ if ($this->isCharMode($tmpchr, ENC_X12)) {
634
+ return ENC_X12;
635
+ } elseif (!($this->isCharMode($tmpchr, ENC_X12) OR $this->isCharMode($tmpchr, ENC_C40))) {
636
+ break;
637
+ }
638
+ ++$k;
639
+ }
640
+ return ENC_C40;
641
+ }
642
+ }
643
+ }
644
+ } // end of while
645
+ }
646
+
647
+ /**
648
+ * Get the switching codeword to a new encoding mode (latch codeword)
649
+ * @param $mode (int) New encoding mode.
650
+ * @return (int) Switch codeword.
651
+ * @protected
652
+ */
653
+ protected function getSwitchEncodingCodeword($mode) {
654
+ switch ($mode) {
655
+ case ENC_ASCII: { // ASCII character 0 to 127
656
+ $cw = 254;
657
+ if ($this->last_enc == ENC_EDF) {
658
+ $cw = 124;
659
+ }
660
+ break;
661
+ }
662
+ case ENC_C40: { // Upper-case alphanumeric
663
+ $cw = 230;
664
+ break;
665
+ }
666
+ case ENC_TXT: { // Lower-case alphanumeric
667
+ $cw = 239;
668
+ break;
669
+ }
670
+ case ENC_X12: { // ANSI X12
671
+ $cw = 238;
672
+ break;
673
+ }
674
+ case ENC_EDF: { // ASCII character 32 to 94
675
+ $cw = 240;
676
+ break;
677
+ }
678
+ case ENC_BASE256: { // Function character (FNC1, Structured Append, Reader Program, or Code Page)
679
+ $cw = 231;
680
+ break;
681
+ }
682
+ }
683
+ return $cw;
684
+ }
685
+
686
+ /**
687
+ * Choose the minimum matrix size and return the max number of data codewords.
688
+ * @param $numcw (int) Number of current codewords.
689
+ * @return number of data codewords in matrix
690
+ * @protected
691
+ */
692
+ protected function getMaxDataCodewords($numcw) {
693
+ foreach ($this->symbattr as $key => $matrix) {
694
+ if ($matrix[11] >= $numcw) {
695
+ return $matrix[11];
696
+ }
697
+ }
698
+ return 0;
699
+ }
700
+
701
+ /**
702
+ * Get high level encoding using the minimum symbol data characters for ECC 200
703
+ * @param $data (string) data to encode
704
+ * @return array of codewords
705
+ * @protected
706
+ */
707
+ protected function getHighLevelEncoding($data) {
708
+ // STEP A. Start in ASCII encodation.
709
+ $enc = ENC_ASCII; // current encoding mode
710
+ $pos = 0; // current position
711
+ $cw = array(); // array of codewords to be returned
712
+ $cw_num = 0; // number of data codewords
713
+ $data_length = strlen($data); // number of chars
714
+ while ($pos < $data_length) {
715
+ // set last used encoding
716
+ $this->last_enc = $enc;
717
+ switch ($enc) {
718
+ case ENC_ASCII: { // STEP B. While in ASCII encodation
719
+ if (($data_length > 1) AND ($pos < ($data_length - 1)) AND ($this->isCharMode(ord($data[$pos]), ENC_ASCII_NUM) AND $this->isCharMode(ord($data[$pos + 1]), ENC_ASCII_NUM))) {
720
+ // 1. If the next data sequence is at least 2 consecutive digits, encode the next two digits as a double digit in ASCII mode.
721
+ $cw[] = (intval(substr($data, $pos, 2)) + 130);
722
+ ++$cw_num;
723
+ $pos += 2;
724
+ } else {
725
+ // 2. If the look-ahead test (starting at step J) indicates another mode, switch to that mode.
726
+ $newenc = $this->lookAheadTest($data, $pos, $enc);
727
+ if ($newenc != $enc) {
728
+ // switch to new encoding
729
+ $enc = $newenc;
730
+ $cw[] = $this->getSwitchEncodingCodeword($enc);
731
+ ++$cw_num;
732
+ } else {
733
+ // get new byte
734
+ $chr = ord($data[$pos]);
735
+ ++$pos;
736
+ if ($this->isCharMode($chr, ENC_ASCII_EXT)) {
737
+ // 3. If the next data character is extended ASCII (greater than 127) encode it in ASCII mode first using the Upper Shift (value 235) character.
738
+ $cw[] = 235;
739
+ $cw[] = ($chr - 127);
740
+ $cw_num += 2;
741
+ } else {
742
+ // 4. Otherwise process the next data character in ASCII encodation.
743
+ $cw[] = ($chr + 1);
744
+ ++$cw_num;
745
+ }
746
+ }
747
+ }
748
+ break;
749
+ }
750
+ case ENC_C40 : // Upper-case alphanumeric
751
+ case ENC_TXT : // Lower-case alphanumeric
752
+ case ENC_X12 : { // ANSI X12
753
+ $temp_cw = array();
754
+ $p = 0;
755
+ $epos = $pos;
756
+ // get charset ID
757
+ $set_id = $this->chset_id[$enc];
758
+ // get basic charset for current encoding
759
+ $charset = $this->chset[$set_id];
760
+ do {
761
+ // 2. process the next character in C40 encodation.
762
+ $chr = ord($data[$epos]);
763
+ ++$epos;
764
+ // check for extended character
765
+ if ($chr & 0x80) {
766
+ if ($enc == ENC_X12) {
767
+ return false;
768
+ }
769
+ $chr = ($chr & 0x7f);
770
+ $temp_cw[] = 1; // shift 2
771
+ $temp_cw[] = 30; // upper shift
772
+ $p += 2;
773
+ }
774
+ if (isset($charset[$chr])) {
775
+ $temp_cw[] = $charset[$chr];
776
+ ++$p;
777
+ } else {
778
+ if (isset($this->chset['SH1'][$chr])) {
779
+ $temp_cw[] = 0; // shift 1
780
+ $shiftset = $this->chset['SH1'];
781
+ } elseif (isset($chr, $this->chset['SH2'][$chr])) {
782
+ $temp_cw[] = 1; // shift 2
783
+ $shiftset = $this->chset['SH2'];
784
+ } elseif (($enc == ENC_C40) AND isset($this->chset['S3C'][$chr])) {
785
+ $temp_cw[] = 2; // shift 3
786
+ $shiftset = $this->chset['S3C'];
787
+ } elseif (($enc == ENC_TXT) AND isset($this->chset['S3T'][$chr])) {
788
+ $temp_cw[] = 2; // shift 3
789
+ $shiftset = $this->chset['S3T'];
790
+ } else {
791
+ return false;
792
+ }
793
+ $temp_cw[] = $shiftset[$chr];
794
+ $p += 2;
795
+ }
796
+ if ($p >= 3) {
797
+ $c1 = array_shift($temp_cw);
798
+ $c2 = array_shift($temp_cw);
799
+ $c3 = array_shift($temp_cw);
800
+ $p -= 3;
801
+ $tmp = ((1600 * $c1) + (40 * $c2) + $c3 + 1);
802
+ $cw[] = ($tmp >> 8);
803
+ $cw[] = ($tmp % 256);
804
+ $cw_num += 2;
805
+ $pos = $epos;
806
+ // 1. If the C40 encoding is at the point of starting a new double symbol character and if the look-ahead test (starting at step J) indicates another mode, switch to that mode.
807
+ $newenc = $this->lookAheadTest($data, $pos, $enc);
808
+ if ($newenc != $enc) {
809
+ // switch to new encoding
810
+ $enc = $newenc;
811
+ if ($enc != ENC_ASCII) {
812
+ // set unlatch character
813
+ $cw[] = $this->getSwitchEncodingCodeword(ENC_ASCII);
814
+ ++$cw_num;
815
+ }
816
+ $cw[] = $this->getSwitchEncodingCodeword($enc);
817
+ ++$cw_num;
818
+ $pos -= $p;
819
+ $p = 0;
820
+ break;
821
+ }
822
+ }
823
+ } while (($p > 0) AND ($epos < $data_length));
824
+ // process last data (if any)
825
+ if ($p > 0) {
826
+ // get remaining number of data symbols
827
+ $cwr = ($this->getMaxDataCodewords($cw_num) - $cw_num);
828
+ if (($cwr == 1) AND ($p == 1)) {
829
+ // d. If one symbol character remains and one C40 value (data character) remains to be encoded
830
+ $c1 = array_shift($temp_cw);
831
+ --$p;
832
+ $cw[] = ($chr + 1);
833
+ ++$cw_num;
834
+ $pos = $epos;
835
+ $enc = ENC_ASCII;
836
+ $this->last_enc = $enc;
837
+ } elseif (($cwr == 2) AND ($p == 1)) {
838
+ // c. If two symbol characters remain and only one C40 value (data character) remains to be encoded
839
+ $c1 = array_shift($temp_cw);
840
+ --$p;
841
+ $cw[] = 254;
842
+ $cw[] = ($chr + 1);
843
+ $cw_num += 2;
844
+ $pos = $epos;
845
+ $enc = ENC_ASCII;
846
+ $this->last_enc = $enc;
847
+ } elseif (($cwr == 2) AND ($p == 2)) {
848
+ // b. If two symbol characters remain and two C40 values remain to be encoded
849
+ $c1 = array_shift($temp_cw);
850
+ $c2 = array_shift($temp_cw);
851
+ $p -= 2;
852
+ $tmp = ((1600 * $c1) + (40 * $c2) + 1);
853
+ $cw[] = ($tmp >> 8);
854
+ $cw[] = ($tmp % 256);
855
+ $cw_num += 2;
856
+ $pos = $epos;
857
+ $enc = ENC_ASCII;
858
+ $this->last_enc = $enc;
859
+ } else {
860
+ // switch to ASCII encoding
861
+ if ($enc != ENC_ASCII) {
862
+ $enc = ENC_ASCII;
863
+ $this->last_enc = $enc;
864
+ $cw[] = $this->getSwitchEncodingCodeword($enc);
865
+ ++$cw_num;
866
+ $pos = ($epos - $p);
867
+ }
868
+ }
869
+ }
870
+ break;
871
+ }
872
+ case ENC_EDF: { // F. While in EDIFACT (EDF) encodation
873
+ // initialize temporary array with 0 length
874
+ $temp_cw = array();
875
+ $epos = $pos;
876
+ $field_length = 0;
877
+ $newenc = $enc;
878
+ do {
879
+ // 2. process the next character in EDIFACT encodation.
880
+ $chr = ord($data[$epos]);
881
+ if ($this->isCharMode($chr, ENC_EDF)) {
882
+ ++$epos;
883
+ $temp_cw[] = $chr;
884
+ ++$field_length;
885
+ }
886
+ if (($field_length == 4) OR ($epos == $data_length) OR !$this->isCharMode($chr, ENC_EDF)) {
887
+ if (($epos == $data_length) AND ($field_length < 3)) {
888
+ $enc = ENC_ASCII;
889
+ $cw[] = $this->getSwitchEncodingCodeword($enc);
890
+ ++$cw_num;
891
+ break;
892
+ }
893
+ if ($field_length < 4) {
894
+ // set unlatch character
895
+ $temp_cw[] = 0x1f;
896
+ ++$field_length;
897
+ // fill empty characters
898
+ for ($i = $field_length; $i < 4; ++$i) {
899
+ $temp_cw[] = 0;
900
+ }
901
+ $enc = ENC_ASCII;
902
+ $this->last_enc = $enc;
903
+ }
904
+ // encodes four data characters in three codewords
905
+ $tcw = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4);
906
+ if ($tcw > 0) {
907
+ $cw[] = $tcw;
908
+ $cw_num++;
909
+ }
910
+ $tcw= (($temp_cw[1] & 0x0F) << 4) + (($temp_cw[2] & 0x3C) >> 2);
911
+ if ($tcw > 0) {
912
+ $cw[] = $tcw;
913
+ $cw_num++;
914
+ }
915
+ $tcw = (($temp_cw[2] & 0x03) << 6) + ($temp_cw[3] & 0x3F);
916
+ if ($tcw > 0) {
917
+ $cw[] = $tcw;
918
+ $cw_num++;
919
+ }
920
+ $temp_cw = array();
921
+ $pos = $epos;
922
+ $field_length = 0;
923
+ if ($enc == ENC_ASCII) {
924
+ break; // exit from EDIFACT mode
925
+ }
926
+ }
927
+ } while ($epos < $data_length);
928
+ break;
929
+ }
930
+ case ENC_BASE256: { // G. While in Base 256 (B256) encodation
931
+ // initialize temporary array with 0 length
932
+ $temp_cw = array();
933
+ $field_length = 0;
934
+ while (($pos < $data_length) AND ($field_length <= 1555)) {
935
+ $newenc = $this->lookAheadTest($data, $pos, $enc);
936
+ if ($newenc != $enc) {
937
+ // 1. If the look-ahead test (starting at step J) indicates another mode, switch to that mode.
938
+ $enc = $newenc;
939
+ break; // exit from B256 mode
940
+ } else {
941
+ // 2. Otherwise, process the next character in Base 256 encodation.
942
+ $chr = ord($data[$pos]);
943
+ ++$pos;
944
+ $temp_cw[] = $chr;
945
+ ++$field_length;
946
+ }
947
+ }
948
+ // set field length
949
+ if ($field_length <= 249) {
950
+ $cw[] = $this->get255StateCodeword($field_length, ($cw_num + 1));
951
+ ++$cw_num;
952
+ } else {
953
+ $cw[] = $this->get255StateCodeword((floor($field_length / 250) + 249), ($cw_num + 1));
954
+ $cw[] = $this->get255StateCodeword(($field_length % 250), ($cw_num + 2));
955
+ $cw_num += 2;
956
+ }
957
+ if (!empty($temp_cw)) {
958
+ // add B256 field
959
+ foreach ($temp_cw as $p => $cht) {
960
+ $cw[] = $this->get255StateCodeword($cht, ($cw_num + $p + 1));
961
+ }
962
+ }
963
+ break;
964
+ }
965
+ } // end of switch enc
966
+ } // end of while
967
+ return $cw;
968
+ }
969
+
970
+ /**
971
+ * Places "chr+bit" with appropriate wrapping within array[].
972
+ * (Annex F - ECC 200 symbol character placement)
973
+ * @param $marr (array) Array of symbols.
974
+ * @param $nrow (int) Number of rows.
975
+ * @param $ncol (int) Number of columns.
976
+ * @param $row (int) Row number.
977
+ * @param $col (int) Column number.
978
+ * @param $chr (int) Char byte.
979
+ * @param $bit (int) Bit.
980
+ * @return array
981
+ * @protected
982
+ */
983
+ protected function placeModule($marr, $nrow, $ncol, $row, $col, $chr, $bit) {
984
+ if ($row < 0) {
985
+ $row += $nrow;
986
+ $col += (4 - (($nrow + 4) % 8));
987
+ }
988
+ if ($col < 0) {
989
+ $col += $ncol;
990
+ $row += (4 - (($ncol + 4) % 8));
991
+ }
992
+ $marr[(($row * $ncol) + $col)] = ((10 * $chr) + $bit);
993
+ return $marr;
994
+ }
995
+
996
+ /**
997
+ * Places the 8 bits of a utah-shaped symbol character.
998
+ * (Annex F - ECC 200 symbol character placement)
999
+ * @param $marr (array) Array of symbols.
1000
+ * @param $nrow (int) Number of rows.
1001
+ * @param $ncol (int) Number of columns.
1002
+ * @param $row (int) Row number.
1003
+ * @param $col (int) Column number.
1004
+ * @param $chr (int) Char byte.
1005
+ * @return array
1006
+ * @protected
1007
+ */
1008
+ protected function placeUtah($marr, $nrow, $ncol, $row, $col, $chr) {
1009
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row-2, $col-2, $chr, 1);
1010
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row-2, $col-1, $chr, 2);
1011
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col-2, $chr, 3);
1012
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col-1, $chr, 4);
1013
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col, $chr, 5);
1014
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col-2, $chr, 6);
1015
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col-1, $chr, 7);
1016
+ $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col, $chr, 8);
1017
+ return $marr;
1018
+ }
1019
+
1020
+ /**
1021
+ * Places the 8 bits of the first special corner case.
1022
+ * (Annex F - ECC 200 symbol character placement)
1023
+ * @param $marr (array) Array of symbols.
1024
+ * @param $nrow (int) Number of rows.
1025
+ * @param $ncol (int) Number of columns.
1026
+ * @param $chr (int) Char byte.
1027
+ * @return array
1028
+ * @protected
1029
+ */
1030
+ protected function placeCornerA($marr, $nrow, $ncol, $chr) {
1031
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 1);
1032
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 1, $chr, 2);
1033
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 2, $chr, 3);
1034
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4);
1035
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5);
1036
+ $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 6);
1037
+ $marr = $this->placeModule($marr, $nrow, $ncol, 2, $ncol-1, $chr, 7);
1038
+ $marr = $this->placeModule($marr, $nrow, $ncol, 3, $ncol-1, $chr, 8);
1039
+ return $marr;
1040
+ }
1041
+
1042
+ /**
1043
+ * Places the 8 bits of the second special corner case.
1044
+ * (Annex F - ECC 200 symbol character placement)
1045
+ * @param $marr (array) Array of symbols.
1046
+ * @param $nrow (int) Number of rows.
1047
+ * @param $ncol (int) Number of columns.
1048
+ * @param $chr (int) Char byte.
1049
+ * @return array
1050
+ * @protected
1051
+ */
1052
+ protected function placeCornerB($marr, $nrow, $ncol, $chr) {
1053
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-3, 0, $chr, 1);
1054
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-2, 0, $chr, 2);
1055
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 3);
1056
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-4, $chr, 4);
1057
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-3, $chr, 5);
1058
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 6);
1059
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 7);
1060
+ $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 8);
1061
+ return $marr;
1062
+ }
1063
+
1064
+ /**
1065
+ * Places the 8 bits of the third special corner case.
1066
+ * (Annex F - ECC 200 symbol character placement)
1067
+ * @param $marr (array) Array of symbols.
1068
+ * @param $nrow (int) Number of rows.
1069
+ * @param $ncol (int) Number of columns.
1070
+ * @param $chr (int) Char byte.
1071
+ * @return array
1072
+ * @protected
1073
+ */
1074
+ protected function placeCornerC($marr, $nrow, $ncol, $chr) {
1075
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-3, 0, $chr, 1);
1076
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-2, 0, $chr, 2);
1077
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 3);
1078
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4);
1079
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5);
1080
+ $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 6);
1081
+ $marr = $this->placeModule($marr, $nrow, $ncol, 2, $ncol-1, $chr, 7);
1082
+ $marr = $this->placeModule($marr, $nrow, $ncol, 3, $ncol-1, $chr, 8);
1083
+ return $marr;
1084
+ }
1085
+
1086
+ /**
1087
+ * Places the 8 bits of the fourth special corner case.
1088
+ * (Annex F - ECC 200 symbol character placement)
1089
+ * @param $marr (array) Array of symbols.
1090
+ * @param $nrow (int) Number of rows.
1091
+ * @param $ncol (int) Number of columns.
1092
+ * @param $chr (int) Char byte.
1093
+ * @return array
1094
+ * @protected
1095
+ */
1096
+ protected function placeCornerD($marr, $nrow, $ncol, $chr) {
1097
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 1);
1098
+ $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, $ncol-1, $chr, 2);
1099
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-3, $chr, 3);
1100
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4);
1101
+ $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5);
1102
+ $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-3, $chr, 6);
1103
+ $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-2, $chr, 7);
1104
+ $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 8);
1105
+ return $marr;
1106
+ }
1107
+
1108
+ /**
1109
+ * Build a placement map.
1110
+ * (Annex F - ECC 200 symbol character placement)
1111
+ * @param $nrow (int) Number of rows.
1112
+ * @param $ncol (int) Number of columns.
1113
+ * @return array
1114
+ * @protected
1115
+ */
1116
+ protected function getPlacementMap($nrow, $ncol) {
1117
+ // initialize array with zeros
1118
+ $marr = array_fill(0, ($nrow * $ncol), 0);
1119
+ // set starting values
1120
+ $chr = 1;
1121
+ $row = 4;
1122
+ $col = 0;
1123
+ do {
1124
+ // repeatedly first check for one of the special corner cases, then
1125
+ if (($row == $nrow) AND ($col == 0)) {
1126
+ $marr = $this->placeCornerA($marr, $nrow, $ncol, $chr);
1127
+ ++$chr;
1128
+ }
1129
+ if (($row == ($nrow - 2)) AND ($col == 0) AND ($ncol % 4)) {
1130
+ $marr = $this->placeCornerB($marr, $nrow, $ncol, $chr);
1131
+ ++$chr;
1132
+ }
1133
+ if (($row == ($nrow - 2)) AND ($col == 0) AND (($ncol % 8) == 4)) {
1134
+ $marr = $this->placeCornerC($marr, $nrow, $ncol, $chr);
1135
+ ++$chr;
1136
+ }
1137
+ if (($row == ($nrow + 4)) AND ($col == 2) AND (!($ncol % 8))) {
1138
+ $marr = $this->placeCornerD($marr, $nrow, $ncol, $chr);
1139
+ ++$chr;
1140
+ }
1141
+ // sweep upward diagonally, inserting successive characters,
1142
+ do {
1143
+ if (($row < $nrow) AND ($col >= 0) AND (!$marr[(($row * $ncol) + $col)])) {
1144
+ $marr = $this->placeUtah($marr, $nrow, $ncol, $row, $col, $chr);
1145
+ ++$chr;
1146
+ }
1147
+ $row -= 2;
1148
+ $col += 2;
1149
+ } while (($row >= 0) AND ($col < $ncol));
1150
+ ++$row;
1151
+ $col += 3;
1152
+ // & then sweep downward diagonally, inserting successive characters,...
1153
+ do {
1154
+ if (($row >= 0) AND ($col < $ncol) AND (!$marr[(($row * $ncol) + $col)])) {
1155
+ $marr = $this->placeUtah($marr, $nrow, $ncol, $row, $col, $chr);
1156
+ ++$chr;
1157
+ }
1158
+ $row += 2;
1159
+ $col -= 2;
1160
+ } while (($row < $nrow) AND ($col >= 0));
1161
+ $row += 3;
1162
+ ++$col;
1163
+ // ... until the entire array is scanned
1164
+ } while (($row < $nrow) OR ($col < $ncol));
1165
+ // lastly, if the lower righthand corner is untouched, fill in fixed pattern
1166
+ if (!$marr[(($nrow * $ncol) - 1)]) {
1167
+ $marr[(($nrow * $ncol) - 1)] = 1;
1168
+ $marr[(($nrow * $ncol) - $ncol - 2)] = 1;
1169
+ }
1170
+ return $marr;
1171
+ }
1172
+
1173
+ } // end DataMatrix class
1174
+ //============================================================+
1175
+ // END OF FILE
1176
+ //============================================================+
includes/lib/{tcpdf_min → tcpdf}/include/barcodes/pdf417.php RENAMED
@@ -1,1002 +1,1007 @@
1
- <?php
2
- //============================================================+
3
- // File name : pdf417.php
4
- // Version : 1.0.005
5
- // Begin : 2010-06-03
6
- // Last Update : 2014-04-25
7
- // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
- // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
- // -------------------------------------------------------------------
10
- // Copyright (C) 2010-2013 Nicola Asuni - Tecnick.com LTD
11
- //
12
- // This file is part of TCPDF software library.
13
- //
14
- // TCPDF is free software: you can redistribute it and/or modify it
15
- // under the terms of the GNU Lesser General Public License as
16
- // published by the Free Software Foundation, either version 3 of the
17
- // License, or (at your option) any later version.
18
- //
19
- // TCPDF is distributed in the hope that it will be useful, but
20
- // WITHOUT ANY WARRANTY; without even the implied warranty of
21
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
- // See the GNU Lesser General Public License for more details.
23
- //
24
- // You should have received a copy of the GNU Lesser General Public License
25
- // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
- //
27
- // See LICENSE.TXT file for more information.
28
- // -------------------------------------------------------------------
29
- //
30
- // DESCRIPTION :
31
- //
32
- // Class to create PDF417 barcode arrays for TCPDF class.
33
- // PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991.
34
- // It is one of the most popular 2D codes because of its ability to be read with slightly modified handheld laser or linear CCD scanners.
35
- // TECHNICAL DATA / FEATURES OF PDF417:
36
- // Encodable Character Set: All 128 ASCII Characters (including extended)
37
- // Code Type: Continuous, Multi-Row
38
- // Symbol Height: 3 - 90 Rows
39
- // Symbol Width: 90X - 583X
40
- // Bidirectional Decoding: Yes
41
- // Error Correction Characters: 2 - 512
42
- // Maximum Data Characters: 1850 text, 2710 digits, 1108 bytes
43
- //
44
- //============================================================+
45
-
46
- /**
47
- * @file
48
- * Class to create PDF417 barcode arrays for TCPDF class.
49
- * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991.
50
- * (requires PHP bcmath extension)
51
- * @package com.tecnick.tcpdf
52
- * @author Nicola Asuni
53
- * @version 1.0.005
54
- */
55
-
56
- // definitions
57
- if (!defined('PDF417DEFS')) {
58
-
59
- /**
60
- * Indicate that definitions for this class are set
61
- */
62
- define('PDF417DEFS', true);
63
-
64
- // -----------------------------------------------------
65
-
66
- /**
67
- * Row height respect X dimension of single module
68
- */
69
- define('ROWHEIGHT', 4);
70
-
71
- /**
72
- * Horizontal quiet zone in modules
73
- */
74
- define('QUIETH', 2);
75
-
76
- /**
77
- * Vertical quiet zone in modules
78
- */
79
- define('QUIETV', 2);
80
-
81
- } // end of definitions
82
-
83
- // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
84
-
85
- /**
86
- * @class PDF417
87
- * Class to create PDF417 barcode arrays for TCPDF class.
88
- * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991.
89
- * @package com.tecnick.tcpdf
90
- * @author Nicola Asuni
91
- * @version 1.0.003
92
- */
93
- class PDF417 {
94
-
95
- /**
96
- * Barcode array to be returned which is readable by TCPDF.
97
- * @protected
98
- */
99
- protected $barcode_array = array();
100
-
101
- /**
102
- * Start pattern.
103
- * @protected
104
- */
105
- protected $start_pattern = '11111111010101000';
106
-
107
- /**
108
- * Stop pattern.
109
- * @protected
110
- */
111
- protected $stop_pattern = '111111101000101001';
112
-
113
- /**
114
- * Array of text Compaction Sub-Modes (values 0xFB - 0xFF are used for submode changers).
115
- * @protected
116
- */
117
- protected $textsubmodes = array(
118
- array(0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x20,0xFD,0xFE,0xFF), // Alpha
119
- array(0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x20,0xFD,0xFE,0xFF), // Lower
120
- array(0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x26,0x0d,0x09,0x2c,0x3a,0x23,0x2d,0x2e,0x24,0x2f,0x2b,0x25,0x2a,0x3d,0x5e,0xFB,0x20,0xFD,0xFE,0xFF), // Mixed
121
- array(0x3b,0x3c,0x3e,0x40,0x5b,0x5c,0x5d,0x5f,0x60,0x7e,0x21,0x0d,0x09,0x2c,0x3a,0x0a,0x2d,0x2e,0x24,0x2f,0x22,0x7c,0x2a,0x28,0x29,0x3f,0x7b,0x7d,0x27,0xFF) // Puntuaction
122
- );
123
-
124
- /**
125
- * Array of switching codes for Text Compaction Sub-Modes.
126
- * @protected
127
- */
128
- protected $textlatch = array(
129
- '01' => array(27), '02' => array(28), '03' => array(28,25), //
130
- '10' => array(28,28), '12' => array(28), '13' => array(28,25), //
131
- '20' => array(28), '21' => array(27), '23' => array(25), //
132
- '30' => array(29), '31' => array(29,27), '32' => array(29,28) //
133
- );
134
-
135
- /**
136
- * Clusters of codewords (0, 3, 6)<br/>
137
- * Values are hex equivalents of binary representation of bars (1 = bar, 0 = space).<br/>
138
- * The codewords numbered from 900 to 928 have special meaning, some enable to switch between modes in order to optimise the code:<ul>
139
- * <li>900 : Switch to "Text" mode</li>
140
- * <li>901 : Switch to "Byte" mode</li>
141
- * <li>902 : Switch to "Numeric" mode</li>
142
- * <li>903 - 912 : Reserved</li>
143
- * <li>913 : Switch to "Octet" only for the next codeword</li>
144
- * <li>914 - 920 : Reserved</li>
145
- * <li>921 : Initialization</li>
146
- * <li>922 : Terminator codeword for Macro PDF control block</li>
147
- * <li>923 : Sequence tag to identify the beginning of optional fields in the Macro PDF control block</li>
148
- * <li>924 : Switch to "Byte" mode (If the total number of byte is multiple of 6)</li>
149
- * <li>925 : Identifier for a user defined Extended Channel Interpretation (ECI)</li>
150
- * <li>926 : Identifier for a general purpose ECI format</li>
151
- * <li>927 : Identifier for an ECI of a character set or code page</li>
152
- * <li>928 : Macro marker codeword to indicate the beginning of a Macro PDF Control Block</li>
153
- * </ul>
154
- * @protected
155
- */
156
- protected $clusters = array(
157
- array( // cluster 0 -----------------------------------------------------------------------
158
- 0x1d5c0,0x1eaf0,0x1f57c,0x1d4e0,0x1ea78,0x1f53e,0x1a8c0,0x1d470,0x1a860,0x15040, // 10
159
- 0x1a830,0x15020,0x1adc0,0x1d6f0,0x1eb7c,0x1ace0,0x1d678,0x1eb3e,0x158c0,0x1ac70, // 20
160
- 0x15860,0x15dc0,0x1aef0,0x1d77c,0x15ce0,0x1ae78,0x1d73e,0x15c70,0x1ae3c,0x15ef0, // 30
161
- 0x1af7c,0x15e78,0x1af3e,0x15f7c,0x1f5fa,0x1d2e0,0x1e978,0x1f4be,0x1a4c0,0x1d270, // 40
162
- 0x1e93c,0x1a460,0x1d238,0x14840,0x1a430,0x1d21c,0x14820,0x1a418,0x14810,0x1a6e0, // 50
163
- 0x1d378,0x1e9be,0x14cc0,0x1a670,0x1d33c,0x14c60,0x1a638,0x1d31e,0x14c30,0x1a61c, // 60
164
- 0x14ee0,0x1a778,0x1d3be,0x14e70,0x1a73c,0x14e38,0x1a71e,0x14f78,0x1a7be,0x14f3c, // 70
165
- 0x14f1e,0x1a2c0,0x1d170,0x1e8bc,0x1a260,0x1d138,0x1e89e,0x14440,0x1a230,0x1d11c, // 80
166
- 0x14420,0x1a218,0x14410,0x14408,0x146c0,0x1a370,0x1d1bc,0x14660,0x1a338,0x1d19e, // 90
167
- 0x14630,0x1a31c,0x14618,0x1460c,0x14770,0x1a3bc,0x14738,0x1a39e,0x1471c,0x147bc, // 100
168
- 0x1a160,0x1d0b8,0x1e85e,0x14240,0x1a130,0x1d09c,0x14220,0x1a118,0x1d08e,0x14210, // 110
169
- 0x1a10c,0x14208,0x1a106,0x14360,0x1a1b8,0x1d0de,0x14330,0x1a19c,0x14318,0x1a18e, // 120
170
- 0x1430c,0x14306,0x1a1de,0x1438e,0x14140,0x1a0b0,0x1d05c,0x14120,0x1a098,0x1d04e, // 130
171
- 0x14110,0x1a08c,0x14108,0x1a086,0x14104,0x141b0,0x14198,0x1418c,0x140a0,0x1d02e, // 140
172
- 0x1a04c,0x1a046,0x14082,0x1cae0,0x1e578,0x1f2be,0x194c0,0x1ca70,0x1e53c,0x19460, // 150
173
- 0x1ca38,0x1e51e,0x12840,0x19430,0x12820,0x196e0,0x1cb78,0x1e5be,0x12cc0,0x19670, // 160
174
- 0x1cb3c,0x12c60,0x19638,0x12c30,0x12c18,0x12ee0,0x19778,0x1cbbe,0x12e70,0x1973c, // 170
175
- 0x12e38,0x12e1c,0x12f78,0x197be,0x12f3c,0x12fbe,0x1dac0,0x1ed70,0x1f6bc,0x1da60, // 180
176
- 0x1ed38,0x1f69e,0x1b440,0x1da30,0x1ed1c,0x1b420,0x1da18,0x1ed0e,0x1b410,0x1da0c, // 190
177
- 0x192c0,0x1c970,0x1e4bc,0x1b6c0,0x19260,0x1c938,0x1e49e,0x1b660,0x1db38,0x1ed9e, // 200
178
- 0x16c40,0x12420,0x19218,0x1c90e,0x16c20,0x1b618,0x16c10,0x126c0,0x19370,0x1c9bc, // 210
179
- 0x16ec0,0x12660,0x19338,0x1c99e,0x16e60,0x1b738,0x1db9e,0x16e30,0x12618,0x16e18, // 220
180
- 0x12770,0x193bc,0x16f70,0x12738,0x1939e,0x16f38,0x1b79e,0x16f1c,0x127bc,0x16fbc, // 230
181
- 0x1279e,0x16f9e,0x1d960,0x1ecb8,0x1f65e,0x1b240,0x1d930,0x1ec9c,0x1b220,0x1d918, // 240
182
- 0x1ec8e,0x1b210,0x1d90c,0x1b208,0x1b204,0x19160,0x1c8b8,0x1e45e,0x1b360,0x19130, // 250
183
- 0x1c89c,0x16640,0x12220,0x1d99c,0x1c88e,0x16620,0x12210,0x1910c,0x16610,0x1b30c, // 260
184
- 0x19106,0x12204,0x12360,0x191b8,0x1c8de,0x16760,0x12330,0x1919c,0x16730,0x1b39c, // 270
185
- 0x1918e,0x16718,0x1230c,0x12306,0x123b8,0x191de,0x167b8,0x1239c,0x1679c,0x1238e, // 280
186
- 0x1678e,0x167de,0x1b140,0x1d8b0,0x1ec5c,0x1b120,0x1d898,0x1ec4e,0x1b110,0x1d88c, // 290
187
- 0x1b108,0x1d886,0x1b104,0x1b102,0x12140,0x190b0,0x1c85c,0x16340,0x12120,0x19098, // 300
188
- 0x1c84e,0x16320,0x1b198,0x1d8ce,0x16310,0x12108,0x19086,0x16308,0x1b186,0x16304, // 310
189
- 0x121b0,0x190dc,0x163b0,0x12198,0x190ce,0x16398,0x1b1ce,0x1638c,0x12186,0x16386, // 320
190
- 0x163dc,0x163ce,0x1b0a0,0x1d858,0x1ec2e,0x1b090,0x1d84c,0x1b088,0x1d846,0x1b084, // 330
191
- 0x1b082,0x120a0,0x19058,0x1c82e,0x161a0,0x12090,0x1904c,0x16190,0x1b0cc,0x19046, // 340
192
- 0x16188,0x12084,0x16184,0x12082,0x120d8,0x161d8,0x161cc,0x161c6,0x1d82c,0x1d826, // 350
193
- 0x1b042,0x1902c,0x12048,0x160c8,0x160c4,0x160c2,0x18ac0,0x1c570,0x1e2bc,0x18a60, // 360
194
- 0x1c538,0x11440,0x18a30,0x1c51c,0x11420,0x18a18,0x11410,0x11408,0x116c0,0x18b70, // 370
195
- 0x1c5bc,0x11660,0x18b38,0x1c59e,0x11630,0x18b1c,0x11618,0x1160c,0x11770,0x18bbc, // 380
196
- 0x11738,0x18b9e,0x1171c,0x117bc,0x1179e,0x1cd60,0x1e6b8,0x1f35e,0x19a40,0x1cd30, // 390
197
- 0x1e69c,0x19a20,0x1cd18,0x1e68e,0x19a10,0x1cd0c,0x19a08,0x1cd06,0x18960,0x1c4b8, // 400
198
- 0x1e25e,0x19b60,0x18930,0x1c49c,0x13640,0x11220,0x1cd9c,0x1c48e,0x13620,0x19b18, // 410
199
- 0x1890c,0x13610,0x11208,0x13608,0x11360,0x189b8,0x1c4de,0x13760,0x11330,0x1cdde, // 420
200
- 0x13730,0x19b9c,0x1898e,0x13718,0x1130c,0x1370c,0x113b8,0x189de,0x137b8,0x1139c, // 430
201
- 0x1379c,0x1138e,0x113de,0x137de,0x1dd40,0x1eeb0,0x1f75c,0x1dd20,0x1ee98,0x1f74e, // 440
202
- 0x1dd10,0x1ee8c,0x1dd08,0x1ee86,0x1dd04,0x19940,0x1ccb0,0x1e65c,0x1bb40,0x19920, // 450
203
- 0x1eedc,0x1e64e,0x1bb20,0x1dd98,0x1eece,0x1bb10,0x19908,0x1cc86,0x1bb08,0x1dd86, // 460
204
- 0x19902,0x11140,0x188b0,0x1c45c,0x13340,0x11120,0x18898,0x1c44e,0x17740,0x13320, // 470
205
- 0x19998,0x1ccce,0x17720,0x1bb98,0x1ddce,0x18886,0x17710,0x13308,0x19986,0x17708, // 480
206
- 0x11102,0x111b0,0x188dc,0x133b0,0x11198,0x188ce,0x177b0,0x13398,0x199ce,0x17798, // 490
207
- 0x1bbce,0x11186,0x13386,0x111dc,0x133dc,0x111ce,0x177dc,0x133ce,0x1dca0,0x1ee58, // 500
208
- 0x1f72e,0x1dc90,0x1ee4c,0x1dc88,0x1ee46,0x1dc84,0x1dc82,0x198a0,0x1cc58,0x1e62e, // 510
209
- 0x1b9a0,0x19890,0x1ee6e,0x1b990,0x1dccc,0x1cc46,0x1b988,0x19884,0x1b984,0x19882, // 520
210
- 0x1b982,0x110a0,0x18858,0x1c42e,0x131a0,0x11090,0x1884c,0x173a0,0x13190,0x198cc, // 530
211
- 0x18846,0x17390,0x1b9cc,0x11084,0x17388,0x13184,0x11082,0x13182,0x110d8,0x1886e, // 540
212
- 0x131d8,0x110cc,0x173d8,0x131cc,0x110c6,0x173cc,0x131c6,0x110ee,0x173ee,0x1dc50, // 550
213
- 0x1ee2c,0x1dc48,0x1ee26,0x1dc44,0x1dc42,0x19850,0x1cc2c,0x1b8d0,0x19848,0x1cc26, // 560
214
- 0x1b8c8,0x1dc66,0x1b8c4,0x19842,0x1b8c2,0x11050,0x1882c,0x130d0,0x11048,0x18826, // 570
215
- 0x171d0,0x130c8,0x19866,0x171c8,0x1b8e6,0x11042,0x171c4,0x130c2,0x171c2,0x130ec, // 580
216
- 0x171ec,0x171e6,0x1ee16,0x1dc22,0x1cc16,0x19824,0x19822,0x11028,0x13068,0x170e8, // 590
217
- 0x11022,0x13062,0x18560,0x10a40,0x18530,0x10a20,0x18518,0x1c28e,0x10a10,0x1850c, // 600
218
- 0x10a08,0x18506,0x10b60,0x185b8,0x1c2de,0x10b30,0x1859c,0x10b18,0x1858e,0x10b0c, // 610
219
- 0x10b06,0x10bb8,0x185de,0x10b9c,0x10b8e,0x10bde,0x18d40,0x1c6b0,0x1e35c,0x18d20, // 620
220
- 0x1c698,0x18d10,0x1c68c,0x18d08,0x1c686,0x18d04,0x10940,0x184b0,0x1c25c,0x11b40, // 630
221
- 0x10920,0x1c6dc,0x1c24e,0x11b20,0x18d98,0x1c6ce,0x11b10,0x10908,0x18486,0x11b08, // 640
222
- 0x18d86,0x10902,0x109b0,0x184dc,0x11bb0,0x10998,0x184ce,0x11b98,0x18dce,0x11b8c, // 650
223
- 0x10986,0x109dc,0x11bdc,0x109ce,0x11bce,0x1cea0,0x1e758,0x1f3ae,0x1ce90,0x1e74c, // 660
224
- 0x1ce88,0x1e746,0x1ce84,0x1ce82,0x18ca0,0x1c658,0x19da0,0x18c90,0x1c64c,0x19d90, // 670
225
- 0x1cecc,0x1c646,0x19d88,0x18c84,0x19d84,0x18c82,0x19d82,0x108a0,0x18458,0x119a0, // 680
226
- 0x10890,0x1c66e,0x13ba0,0x11990,0x18ccc,0x18446,0x13b90,0x19dcc,0x10884,0x13b88, // 690
227
- 0x11984,0x10882,0x11982,0x108d8,0x1846e,0x119d8,0x108cc,0x13bd8,0x119cc,0x108c6, // 700
228
- 0x13bcc,0x119c6,0x108ee,0x119ee,0x13bee,0x1ef50,0x1f7ac,0x1ef48,0x1f7a6,0x1ef44, // 710
229
- 0x1ef42,0x1ce50,0x1e72c,0x1ded0,0x1ef6c,0x1e726,0x1dec8,0x1ef66,0x1dec4,0x1ce42, // 720
230
- 0x1dec2,0x18c50,0x1c62c,0x19cd0,0x18c48,0x1c626,0x1bdd0,0x19cc8,0x1ce66,0x1bdc8, // 730
231
- 0x1dee6,0x18c42,0x1bdc4,0x19cc2,0x1bdc2,0x10850,0x1842c,0x118d0,0x10848,0x18426, // 740
232
- 0x139d0,0x118c8,0x18c66,0x17bd0,0x139c8,0x19ce6,0x10842,0x17bc8,0x1bde6,0x118c2, // 750
233
- 0x17bc4,0x1086c,0x118ec,0x10866,0x139ec,0x118e6,0x17bec,0x139e6,0x17be6,0x1ef28, // 760
234
- 0x1f796,0x1ef24,0x1ef22,0x1ce28,0x1e716,0x1de68,0x1ef36,0x1de64,0x1ce22,0x1de62, // 770
235
- 0x18c28,0x1c616,0x19c68,0x18c24,0x1bce8,0x19c64,0x18c22,0x1bce4,0x19c62,0x1bce2, // 780
236
- 0x10828,0x18416,0x11868,0x18c36,0x138e8,0x11864,0x10822,0x179e8,0x138e4,0x11862, // 790
237
- 0x179e4,0x138e2,0x179e2,0x11876,0x179f6,0x1ef12,0x1de34,0x1de32,0x19c34,0x1bc74, // 800
238
- 0x1bc72,0x11834,0x13874,0x178f4,0x178f2,0x10540,0x10520,0x18298,0x10510,0x10508, // 810
239
- 0x10504,0x105b0,0x10598,0x1058c,0x10586,0x105dc,0x105ce,0x186a0,0x18690,0x1c34c, // 820
240
- 0x18688,0x1c346,0x18684,0x18682,0x104a0,0x18258,0x10da0,0x186d8,0x1824c,0x10d90, // 830
241
- 0x186cc,0x10d88,0x186c6,0x10d84,0x10482,0x10d82,0x104d8,0x1826e,0x10dd8,0x186ee, // 840
242
- 0x10dcc,0x104c6,0x10dc6,0x104ee,0x10dee,0x1c750,0x1c748,0x1c744,0x1c742,0x18650, // 850
243
- 0x18ed0,0x1c76c,0x1c326,0x18ec8,0x1c766,0x18ec4,0x18642,0x18ec2,0x10450,0x10cd0, // 860
244
- 0x10448,0x18226,0x11dd0,0x10cc8,0x10444,0x11dc8,0x10cc4,0x10442,0x11dc4,0x10cc2, // 870
245
- 0x1046c,0x10cec,0x10466,0x11dec,0x10ce6,0x11de6,0x1e7a8,0x1e7a4,0x1e7a2,0x1c728, // 880
246
- 0x1cf68,0x1e7b6,0x1cf64,0x1c722,0x1cf62,0x18628,0x1c316,0x18e68,0x1c736,0x19ee8, // 890
247
- 0x18e64,0x18622,0x19ee4,0x18e62,0x19ee2,0x10428,0x18216,0x10c68,0x18636,0x11ce8, // 900
248
- 0x10c64,0x10422,0x13de8,0x11ce4,0x10c62,0x13de4,0x11ce2,0x10436,0x10c76,0x11cf6, // 910
249
- 0x13df6,0x1f7d4,0x1f7d2,0x1e794,0x1efb4,0x1e792,0x1efb2,0x1c714,0x1cf34,0x1c712, // 920
250
- 0x1df74,0x1cf32,0x1df72,0x18614,0x18e34,0x18612,0x19e74,0x18e32,0x1bef4), // 929
251
- array( // cluster 3 -----------------------------------------------------------------------
252
- 0x1f560,0x1fab8,0x1ea40,0x1f530,0x1fa9c,0x1ea20,0x1f518,0x1fa8e,0x1ea10,0x1f50c, // 10
253
- 0x1ea08,0x1f506,0x1ea04,0x1eb60,0x1f5b8,0x1fade,0x1d640,0x1eb30,0x1f59c,0x1d620, // 20
254
- 0x1eb18,0x1f58e,0x1d610,0x1eb0c,0x1d608,0x1eb06,0x1d604,0x1d760,0x1ebb8,0x1f5de, // 30
255
- 0x1ae40,0x1d730,0x1eb9c,0x1ae20,0x1d718,0x1eb8e,0x1ae10,0x1d70c,0x1ae08,0x1d706, // 40
256
- 0x1ae04,0x1af60,0x1d7b8,0x1ebde,0x15e40,0x1af30,0x1d79c,0x15e20,0x1af18,0x1d78e, // 50
257
- 0x15e10,0x1af0c,0x15e08,0x1af06,0x15f60,0x1afb8,0x1d7de,0x15f30,0x1af9c,0x15f18, // 60
258
- 0x1af8e,0x15f0c,0x15fb8,0x1afde,0x15f9c,0x15f8e,0x1e940,0x1f4b0,0x1fa5c,0x1e920, // 70
259
- 0x1f498,0x1fa4e,0x1e910,0x1f48c,0x1e908,0x1f486,0x1e904,0x1e902,0x1d340,0x1e9b0, // 80
260
- 0x1f4dc,0x1d320,0x1e998,0x1f4ce,0x1d310,0x1e98c,0x1d308,0x1e986,0x1d304,0x1d302, // 90
261
- 0x1a740,0x1d3b0,0x1e9dc,0x1a720,0x1d398,0x1e9ce,0x1a710,0x1d38c,0x1a708,0x1d386, // 100
262
- 0x1a704,0x1a702,0x14f40,0x1a7b0,0x1d3dc,0x14f20,0x1a798,0x1d3ce,0x14f10,0x1a78c, // 110
263
- 0x14f08,0x1a786,0x14f04,0x14fb0,0x1a7dc,0x14f98,0x1a7ce,0x14f8c,0x14f86,0x14fdc, // 120
264
- 0x14fce,0x1e8a0,0x1f458,0x1fa2e,0x1e890,0x1f44c,0x1e888,0x1f446,0x1e884,0x1e882, // 130
265
- 0x1d1a0,0x1e8d8,0x1f46e,0x1d190,0x1e8cc,0x1d188,0x1e8c6,0x1d184,0x1d182,0x1a3a0, // 140
266
- 0x1d1d8,0x1e8ee,0x1a390,0x1d1cc,0x1a388,0x1d1c6,0x1a384,0x1a382,0x147a0,0x1a3d8, // 150
267
- 0x1d1ee,0x14790,0x1a3cc,0x14788,0x1a3c6,0x14784,0x14782,0x147d8,0x1a3ee,0x147cc, // 160
268
- 0x147c6,0x147ee,0x1e850,0x1f42c,0x1e848,0x1f426,0x1e844,0x1e842,0x1d0d0,0x1e86c, // 170
269
- 0x1d0c8,0x1e866,0x1d0c4,0x1d0c2,0x1a1d0,0x1d0ec,0x1a1c8,0x1d0e6,0x1a1c4,0x1a1c2, // 180
270
- 0x143d0,0x1a1ec,0x143c8,0x1a1e6,0x143c4,0x143c2,0x143ec,0x143e6,0x1e828,0x1f416, // 190
271
- 0x1e824,0x1e822,0x1d068,0x1e836,0x1d064,0x1d062,0x1a0e8,0x1d076,0x1a0e4,0x1a0e2, // 200
272
- 0x141e8,0x1a0f6,0x141e4,0x141e2,0x1e814,0x1e812,0x1d034,0x1d032,0x1a074,0x1a072, // 210
273
- 0x1e540,0x1f2b0,0x1f95c,0x1e520,0x1f298,0x1f94e,0x1e510,0x1f28c,0x1e508,0x1f286, // 220
274
- 0x1e504,0x1e502,0x1cb40,0x1e5b0,0x1f2dc,0x1cb20,0x1e598,0x1f2ce,0x1cb10,0x1e58c, // 230
275
- 0x1cb08,0x1e586,0x1cb04,0x1cb02,0x19740,0x1cbb0,0x1e5dc,0x19720,0x1cb98,0x1e5ce, // 240
276
- 0x19710,0x1cb8c,0x19708,0x1cb86,0x19704,0x19702,0x12f40,0x197b0,0x1cbdc,0x12f20, // 250
277
- 0x19798,0x1cbce,0x12f10,0x1978c,0x12f08,0x19786,0x12f04,0x12fb0,0x197dc,0x12f98, // 260
278
- 0x197ce,0x12f8c,0x12f86,0x12fdc,0x12fce,0x1f6a0,0x1fb58,0x16bf0,0x1f690,0x1fb4c, // 270
279
- 0x169f8,0x1f688,0x1fb46,0x168fc,0x1f684,0x1f682,0x1e4a0,0x1f258,0x1f92e,0x1eda0, // 280
280
- 0x1e490,0x1fb6e,0x1ed90,0x1f6cc,0x1f246,0x1ed88,0x1e484,0x1ed84,0x1e482,0x1ed82, // 290
281
- 0x1c9a0,0x1e4d8,0x1f26e,0x1dba0,0x1c990,0x1e4cc,0x1db90,0x1edcc,0x1e4c6,0x1db88, // 300
282
- 0x1c984,0x1db84,0x1c982,0x1db82,0x193a0,0x1c9d8,0x1e4ee,0x1b7a0,0x19390,0x1c9cc, // 310
283
- 0x1b790,0x1dbcc,0x1c9c6,0x1b788,0x19384,0x1b784,0x19382,0x1b782,0x127a0,0x193d8, // 320
284
- 0x1c9ee,0x16fa0,0x12790,0x193cc,0x16f90,0x1b7cc,0x193c6,0x16f88,0x12784,0x16f84, // 330
285
- 0x12782,0x127d8,0x193ee,0x16fd8,0x127cc,0x16fcc,0x127c6,0x16fc6,0x127ee,0x1f650, // 340
286
- 0x1fb2c,0x165f8,0x1f648,0x1fb26,0x164fc,0x1f644,0x1647e,0x1f642,0x1e450,0x1f22c, // 350
287
- 0x1ecd0,0x1e448,0x1f226,0x1ecc8,0x1f666,0x1ecc4,0x1e442,0x1ecc2,0x1c8d0,0x1e46c, // 360
288
- 0x1d9d0,0x1c8c8,0x1e466,0x1d9c8,0x1ece6,0x1d9c4,0x1c8c2,0x1d9c2,0x191d0,0x1c8ec, // 370
289
- 0x1b3d0,0x191c8,0x1c8e6,0x1b3c8,0x1d9e6,0x1b3c4,0x191c2,0x1b3c2,0x123d0,0x191ec, // 380
290
- 0x167d0,0x123c8,0x191e6,0x167c8,0x1b3e6,0x167c4,0x123c2,0x167c2,0x123ec,0x167ec, // 390
291
- 0x123e6,0x167e6,0x1f628,0x1fb16,0x162fc,0x1f624,0x1627e,0x1f622,0x1e428,0x1f216, // 400
292
- 0x1ec68,0x1f636,0x1ec64,0x1e422,0x1ec62,0x1c868,0x1e436,0x1d8e8,0x1c864,0x1d8e4, // 410
293
- 0x1c862,0x1d8e2,0x190e8,0x1c876,0x1b1e8,0x1d8f6,0x1b1e4,0x190e2,0x1b1e2,0x121e8, // 420
294
- 0x190f6,0x163e8,0x121e4,0x163e4,0x121e2,0x163e2,0x121f6,0x163f6,0x1f614,0x1617e, // 430
295
- 0x1f612,0x1e414,0x1ec34,0x1e412,0x1ec32,0x1c834,0x1d874,0x1c832,0x1d872,0x19074, // 440
296
- 0x1b0f4,0x19072,0x1b0f2,0x120f4,0x161f4,0x120f2,0x161f2,0x1f60a,0x1e40a,0x1ec1a, // 450
297
- 0x1c81a,0x1d83a,0x1903a,0x1b07a,0x1e2a0,0x1f158,0x1f8ae,0x1e290,0x1f14c,0x1e288, // 460
298
- 0x1f146,0x1e284,0x1e282,0x1c5a0,0x1e2d8,0x1f16e,0x1c590,0x1e2cc,0x1c588,0x1e2c6, // 470
299
- 0x1c584,0x1c582,0x18ba0,0x1c5d8,0x1e2ee,0x18b90,0x1c5cc,0x18b88,0x1c5c6,0x18b84, // 480
300
- 0x18b82,0x117a0,0x18bd8,0x1c5ee,0x11790,0x18bcc,0x11788,0x18bc6,0x11784,0x11782, // 490
301
- 0x117d8,0x18bee,0x117cc,0x117c6,0x117ee,0x1f350,0x1f9ac,0x135f8,0x1f348,0x1f9a6, // 500
302
- 0x134fc,0x1f344,0x1347e,0x1f342,0x1e250,0x1f12c,0x1e6d0,0x1e248,0x1f126,0x1e6c8, // 510
303
- 0x1f366,0x1e6c4,0x1e242,0x1e6c2,0x1c4d0,0x1e26c,0x1cdd0,0x1c4c8,0x1e266,0x1cdc8, // 520
304
- 0x1e6e6,0x1cdc4,0x1c4c2,0x1cdc2,0x189d0,0x1c4ec,0x19bd0,0x189c8,0x1c4e6,0x19bc8, // 530
305
- 0x1cde6,0x19bc4,0x189c2,0x19bc2,0x113d0,0x189ec,0x137d0,0x113c8,0x189e6,0x137c8, // 540
306
- 0x19be6,0x137c4,0x113c2,0x137c2,0x113ec,0x137ec,0x113e6,0x137e6,0x1fba8,0x175f0, // 550
307
- 0x1bafc,0x1fba4,0x174f8,0x1ba7e,0x1fba2,0x1747c,0x1743e,0x1f328,0x1f996,0x132fc, // 560
308
- 0x1f768,0x1fbb6,0x176fc,0x1327e,0x1f764,0x1f322,0x1767e,0x1f762,0x1e228,0x1f116, // 570
309
- 0x1e668,0x1e224,0x1eee8,0x1f776,0x1e222,0x1eee4,0x1e662,0x1eee2,0x1c468,0x1e236, // 580
310
- 0x1cce8,0x1c464,0x1dde8,0x1cce4,0x1c462,0x1dde4,0x1cce2,0x1dde2,0x188e8,0x1c476, // 590
311
- 0x199e8,0x188e4,0x1bbe8,0x199e4,0x188e2,0x1bbe4,0x199e2,0x1bbe2,0x111e8,0x188f6, // 600
312
- 0x133e8,0x111e4,0x177e8,0x133e4,0x111e2,0x177e4,0x133e2,0x177e2,0x111f6,0x133f6, // 610
313
- 0x1fb94,0x172f8,0x1b97e,0x1fb92,0x1727c,0x1723e,0x1f314,0x1317e,0x1f734,0x1f312, // 620
314
- 0x1737e,0x1f732,0x1e214,0x1e634,0x1e212,0x1ee74,0x1e632,0x1ee72,0x1c434,0x1cc74, // 630
315
- 0x1c432,0x1dcf4,0x1cc72,0x1dcf2,0x18874,0x198f4,0x18872,0x1b9f4,0x198f2,0x1b9f2, // 640
316
- 0x110f4,0x131f4,0x110f2,0x173f4,0x131f2,0x173f2,0x1fb8a,0x1717c,0x1713e,0x1f30a, // 650
317
- 0x1f71a,0x1e20a,0x1e61a,0x1ee3a,0x1c41a,0x1cc3a,0x1dc7a,0x1883a,0x1987a,0x1b8fa, // 660
318
- 0x1107a,0x130fa,0x171fa,0x170be,0x1e150,0x1f0ac,0x1e148,0x1f0a6,0x1e144,0x1e142, // 670
319
- 0x1c2d0,0x1e16c,0x1c2c8,0x1e166,0x1c2c4,0x1c2c2,0x185d0,0x1c2ec,0x185c8,0x1c2e6, // 680
320
- 0x185c4,0x185c2,0x10bd0,0x185ec,0x10bc8,0x185e6,0x10bc4,0x10bc2,0x10bec,0x10be6, // 690
321
- 0x1f1a8,0x1f8d6,0x11afc,0x1f1a4,0x11a7e,0x1f1a2,0x1e128,0x1f096,0x1e368,0x1e124, // 700
322
- 0x1e364,0x1e122,0x1e362,0x1c268,0x1e136,0x1c6e8,0x1c264,0x1c6e4,0x1c262,0x1c6e2, // 710
323
- 0x184e8,0x1c276,0x18de8,0x184e4,0x18de4,0x184e2,0x18de2,0x109e8,0x184f6,0x11be8, // 720
324
- 0x109e4,0x11be4,0x109e2,0x11be2,0x109f6,0x11bf6,0x1f9d4,0x13af8,0x19d7e,0x1f9d2, // 730
325
- 0x13a7c,0x13a3e,0x1f194,0x1197e,0x1f3b4,0x1f192,0x13b7e,0x1f3b2,0x1e114,0x1e334, // 740
326
- 0x1e112,0x1e774,0x1e332,0x1e772,0x1c234,0x1c674,0x1c232,0x1cef4,0x1c672,0x1cef2, // 750
327
- 0x18474,0x18cf4,0x18472,0x19df4,0x18cf2,0x19df2,0x108f4,0x119f4,0x108f2,0x13bf4, // 760
328
- 0x119f2,0x13bf2,0x17af0,0x1bd7c,0x17a78,0x1bd3e,0x17a3c,0x17a1e,0x1f9ca,0x1397c, // 770
329
- 0x1fbda,0x17b7c,0x1393e,0x17b3e,0x1f18a,0x1f39a,0x1f7ba,0x1e10a,0x1e31a,0x1e73a, // 780
330
- 0x1ef7a,0x1c21a,0x1c63a,0x1ce7a,0x1defa,0x1843a,0x18c7a,0x19cfa,0x1bdfa,0x1087a, // 790
331
- 0x118fa,0x139fa,0x17978,0x1bcbe,0x1793c,0x1791e,0x138be,0x179be,0x178bc,0x1789e, // 800
332
- 0x1785e,0x1e0a8,0x1e0a4,0x1e0a2,0x1c168,0x1e0b6,0x1c164,0x1c162,0x182e8,0x1c176, // 810
333
- 0x182e4,0x182e2,0x105e8,0x182f6,0x105e4,0x105e2,0x105f6,0x1f0d4,0x10d7e,0x1f0d2, // 820
334
- 0x1e094,0x1e1b4,0x1e092,0x1e1b2,0x1c134,0x1c374,0x1c132,0x1c372,0x18274,0x186f4, // 830
335
- 0x18272,0x186f2,0x104f4,0x10df4,0x104f2,0x10df2,0x1f8ea,0x11d7c,0x11d3e,0x1f0ca, // 840
336
- 0x1f1da,0x1e08a,0x1e19a,0x1e3ba,0x1c11a,0x1c33a,0x1c77a,0x1823a,0x1867a,0x18efa, // 850
337
- 0x1047a,0x10cfa,0x11dfa,0x13d78,0x19ebe,0x13d3c,0x13d1e,0x11cbe,0x13dbe,0x17d70, // 860
338
- 0x1bebc,0x17d38,0x1be9e,0x17d1c,0x17d0e,0x13cbc,0x17dbc,0x13c9e,0x17d9e,0x17cb8, // 870
339
- 0x1be5e,0x17c9c,0x17c8e,0x13c5e,0x17cde,0x17c5c,0x17c4e,0x17c2e,0x1c0b4,0x1c0b2, // 880
340
- 0x18174,0x18172,0x102f4,0x102f2,0x1e0da,0x1c09a,0x1c1ba,0x1813a,0x1837a,0x1027a, // 890
341
- 0x106fa,0x10ebe,0x11ebc,0x11e9e,0x13eb8,0x19f5e,0x13e9c,0x13e8e,0x11e5e,0x13ede, // 900
342
- 0x17eb0,0x1bf5c,0x17e98,0x1bf4e,0x17e8c,0x17e86,0x13e5c,0x17edc,0x13e4e,0x17ece, // 910
343
- 0x17e58,0x1bf2e,0x17e4c,0x17e46,0x13e2e,0x17e6e,0x17e2c,0x17e26,0x10f5e,0x11f5c, // 920
344
- 0x11f4e,0x13f58,0x19fae,0x13f4c,0x13f46,0x11f2e,0x13f6e,0x13f2c,0x13f26), // 929
345
- array( // cluster 6 -----------------------------------------------------------------------
346
- 0x1abe0,0x1d5f8,0x153c0,0x1a9f0,0x1d4fc,0x151e0,0x1a8f8,0x1d47e,0x150f0,0x1a87c, // 10
347
- 0x15078,0x1fad0,0x15be0,0x1adf8,0x1fac8,0x159f0,0x1acfc,0x1fac4,0x158f8,0x1ac7e, // 20
348
- 0x1fac2,0x1587c,0x1f5d0,0x1faec,0x15df8,0x1f5c8,0x1fae6,0x15cfc,0x1f5c4,0x15c7e, // 30
349
- 0x1f5c2,0x1ebd0,0x1f5ec,0x1ebc8,0x1f5e6,0x1ebc4,0x1ebc2,0x1d7d0,0x1ebec,0x1d7c8, // 40
350
- 0x1ebe6,0x1d7c4,0x1d7c2,0x1afd0,0x1d7ec,0x1afc8,0x1d7e6,0x1afc4,0x14bc0,0x1a5f0, // 50
351
- 0x1d2fc,0x149e0,0x1a4f8,0x1d27e,0x148f0,0x1a47c,0x14878,0x1a43e,0x1483c,0x1fa68, // 60
352
- 0x14df0,0x1a6fc,0x1fa64,0x14cf8,0x1a67e,0x1fa62,0x14c7c,0x14c3e,0x1f4e8,0x1fa76, // 70
353
- 0x14efc,0x1f4e4,0x14e7e,0x1f4e2,0x1e9e8,0x1f4f6,0x1e9e4,0x1e9e2,0x1d3e8,0x1e9f6, // 80
354
- 0x1d3e4,0x1d3e2,0x1a7e8,0x1d3f6,0x1a7e4,0x1a7e2,0x145e0,0x1a2f8,0x1d17e,0x144f0, // 90
355
- 0x1a27c,0x14478,0x1a23e,0x1443c,0x1441e,0x1fa34,0x146f8,0x1a37e,0x1fa32,0x1467c, // 100
356
- 0x1463e,0x1f474,0x1477e,0x1f472,0x1e8f4,0x1e8f2,0x1d1f4,0x1d1f2,0x1a3f4,0x1a3f2, // 110
357
- 0x142f0,0x1a17c,0x14278,0x1a13e,0x1423c,0x1421e,0x1fa1a,0x1437c,0x1433e,0x1f43a, // 120
358
- 0x1e87a,0x1d0fa,0x14178,0x1a0be,0x1413c,0x1411e,0x141be,0x140bc,0x1409e,0x12bc0, // 130
359
- 0x195f0,0x1cafc,0x129e0,0x194f8,0x1ca7e,0x128f0,0x1947c,0x12878,0x1943e,0x1283c, // 140
360
- 0x1f968,0x12df0,0x196fc,0x1f964,0x12cf8,0x1967e,0x1f962,0x12c7c,0x12c3e,0x1f2e8, // 150
361
- 0x1f976,0x12efc,0x1f2e4,0x12e7e,0x1f2e2,0x1e5e8,0x1f2f6,0x1e5e4,0x1e5e2,0x1cbe8, // 160
362
- 0x1e5f6,0x1cbe4,0x1cbe2,0x197e8,0x1cbf6,0x197e4,0x197e2,0x1b5e0,0x1daf8,0x1ed7e, // 170
363
- 0x169c0,0x1b4f0,0x1da7c,0x168e0,0x1b478,0x1da3e,0x16870,0x1b43c,0x16838,0x1b41e, // 180
364
- 0x1681c,0x125e0,0x192f8,0x1c97e,0x16de0,0x124f0,0x1927c,0x16cf0,0x1b67c,0x1923e, // 190
365
- 0x16c78,0x1243c,0x16c3c,0x1241e,0x16c1e,0x1f934,0x126f8,0x1937e,0x1fb74,0x1f932, // 200
366
- 0x16ef8,0x1267c,0x1fb72,0x16e7c,0x1263e,0x16e3e,0x1f274,0x1277e,0x1f6f4,0x1f272, // 210
367
- 0x16f7e,0x1f6f2,0x1e4f4,0x1edf4,0x1e4f2,0x1edf2,0x1c9f4,0x1dbf4,0x1c9f2,0x1dbf2, // 220
368
- 0x193f4,0x193f2,0x165c0,0x1b2f0,0x1d97c,0x164e0,0x1b278,0x1d93e,0x16470,0x1b23c, // 230
369
- 0x16438,0x1b21e,0x1641c,0x1640e,0x122f0,0x1917c,0x166f0,0x12278,0x1913e,0x16678, // 240
370
- 0x1b33e,0x1663c,0x1221e,0x1661e,0x1f91a,0x1237c,0x1fb3a,0x1677c,0x1233e,0x1673e, // 250
371
- 0x1f23a,0x1f67a,0x1e47a,0x1ecfa,0x1c8fa,0x1d9fa,0x191fa,0x162e0,0x1b178,0x1d8be, // 260
372
- 0x16270,0x1b13c,0x16238,0x1b11e,0x1621c,0x1620e,0x12178,0x190be,0x16378,0x1213c, // 270
373
- 0x1633c,0x1211e,0x1631e,0x121be,0x163be,0x16170,0x1b0bc,0x16138,0x1b09e,0x1611c, // 280
374
- 0x1610e,0x120bc,0x161bc,0x1209e,0x1619e,0x160b8,0x1b05e,0x1609c,0x1608e,0x1205e, // 290
375
- 0x160de,0x1605c,0x1604e,0x115e0,0x18af8,0x1c57e,0x114f0,0x18a7c,0x11478,0x18a3e, // 300
376
- 0x1143c,0x1141e,0x1f8b4,0x116f8,0x18b7e,0x1f8b2,0x1167c,0x1163e,0x1f174,0x1177e, // 310
377
- 0x1f172,0x1e2f4,0x1e2f2,0x1c5f4,0x1c5f2,0x18bf4,0x18bf2,0x135c0,0x19af0,0x1cd7c, // 320
378
- 0x134e0,0x19a78,0x1cd3e,0x13470,0x19a3c,0x13438,0x19a1e,0x1341c,0x1340e,0x112f0, // 330
379
- 0x1897c,0x136f0,0x11278,0x1893e,0x13678,0x19b3e,0x1363c,0x1121e,0x1361e,0x1f89a, // 340
380
- 0x1137c,0x1f9ba,0x1377c,0x1133e,0x1373e,0x1f13a,0x1f37a,0x1e27a,0x1e6fa,0x1c4fa, // 350
381
- 0x1cdfa,0x189fa,0x1bae0,0x1dd78,0x1eebe,0x174c0,0x1ba70,0x1dd3c,0x17460,0x1ba38, // 360
382
- 0x1dd1e,0x17430,0x1ba1c,0x17418,0x1ba0e,0x1740c,0x132e0,0x19978,0x1ccbe,0x176e0, // 370
383
- 0x13270,0x1993c,0x17670,0x1bb3c,0x1991e,0x17638,0x1321c,0x1761c,0x1320e,0x1760e, // 380
384
- 0x11178,0x188be,0x13378,0x1113c,0x17778,0x1333c,0x1111e,0x1773c,0x1331e,0x1771e, // 390
385
- 0x111be,0x133be,0x177be,0x172c0,0x1b970,0x1dcbc,0x17260,0x1b938,0x1dc9e,0x17230, // 400
386
- 0x1b91c,0x17218,0x1b90e,0x1720c,0x17206,0x13170,0x198bc,0x17370,0x13138,0x1989e, // 410
387
- 0x17338,0x1b99e,0x1731c,0x1310e,0x1730e,0x110bc,0x131bc,0x1109e,0x173bc,0x1319e, // 420
388
- 0x1739e,0x17160,0x1b8b8,0x1dc5e,0x17130,0x1b89c,0x17118,0x1b88e,0x1710c,0x17106, // 430
389
- 0x130b8,0x1985e,0x171b8,0x1309c,0x1719c,0x1308e,0x1718e,0x1105e,0x130de,0x171de, // 440
390
- 0x170b0,0x1b85c,0x17098,0x1b84e,0x1708c,0x17086,0x1305c,0x170dc,0x1304e,0x170ce, // 450
391
- 0x17058,0x1b82e,0x1704c,0x17046,0x1302e,0x1706e,0x1702c,0x17026,0x10af0,0x1857c, // 460
392
- 0x10a78,0x1853e,0x10a3c,0x10a1e,0x10b7c,0x10b3e,0x1f0ba,0x1e17a,0x1c2fa,0x185fa, // 470
393
- 0x11ae0,0x18d78,0x1c6be,0x11a70,0x18d3c,0x11a38,0x18d1e,0x11a1c,0x11a0e,0x10978, // 480
394
- 0x184be,0x11b78,0x1093c,0x11b3c,0x1091e,0x11b1e,0x109be,0x11bbe,0x13ac0,0x19d70, // 490
395
- 0x1cebc,0x13a60,0x19d38,0x1ce9e,0x13a30,0x19d1c,0x13a18,0x19d0e,0x13a0c,0x13a06, // 500
396
- 0x11970,0x18cbc,0x13b70,0x11938,0x18c9e,0x13b38,0x1191c,0x13b1c,0x1190e,0x13b0e, // 510
397
- 0x108bc,0x119bc,0x1089e,0x13bbc,0x1199e,0x13b9e,0x1bd60,0x1deb8,0x1ef5e,0x17a40, // 520
398
- 0x1bd30,0x1de9c,0x17a20,0x1bd18,0x1de8e,0x17a10,0x1bd0c,0x17a08,0x1bd06,0x17a04, // 530
399
- 0x13960,0x19cb8,0x1ce5e,0x17b60,0x13930,0x19c9c,0x17b30,0x1bd9c,0x19c8e,0x17b18, // 540
400
- 0x1390c,0x17b0c,0x13906,0x17b06,0x118b8,0x18c5e,0x139b8,0x1189c,0x17bb8,0x1399c, // 550
401
- 0x1188e,0x17b9c,0x1398e,0x17b8e,0x1085e,0x118de,0x139de,0x17bde,0x17940,0x1bcb0, // 560
402
- 0x1de5c,0x17920,0x1bc98,0x1de4e,0x17910,0x1bc8c,0x17908,0x1bc86,0x17904,0x17902, // 570
403
- 0x138b0,0x19c5c,0x179b0,0x13898,0x19c4e,0x17998,0x1bcce,0x1798c,0x13886,0x17986, // 580
404
- 0x1185c,0x138dc,0x1184e,0x179dc,0x138ce,0x179ce,0x178a0,0x1bc58,0x1de2e,0x17890, // 590
405
- 0x1bc4c,0x17888,0x1bc46,0x17884,0x17882,0x13858,0x19c2e,0x178d8,0x1384c,0x178cc, // 600
406
- 0x13846,0x178c6,0x1182e,0x1386e,0x178ee,0x17850,0x1bc2c,0x17848,0x1bc26,0x17844, // 610
407
- 0x17842,0x1382c,0x1786c,0x13826,0x17866,0x17828,0x1bc16,0x17824,0x17822,0x13816, // 620
408
- 0x17836,0x10578,0x182be,0x1053c,0x1051e,0x105be,0x10d70,0x186bc,0x10d38,0x1869e, // 630
409
- 0x10d1c,0x10d0e,0x104bc,0x10dbc,0x1049e,0x10d9e,0x11d60,0x18eb8,0x1c75e,0x11d30, // 640
410
- 0x18e9c,0x11d18,0x18e8e,0x11d0c,0x11d06,0x10cb8,0x1865e,0x11db8,0x10c9c,0x11d9c, // 650
411
- 0x10c8e,0x11d8e,0x1045e,0x10cde,0x11dde,0x13d40,0x19eb0,0x1cf5c,0x13d20,0x19e98, // 660
412
- 0x1cf4e,0x13d10,0x19e8c,0x13d08,0x19e86,0x13d04,0x13d02,0x11cb0,0x18e5c,0x13db0, // 670
413
- 0x11c98,0x18e4e,0x13d98,0x19ece,0x13d8c,0x11c86,0x13d86,0x10c5c,0x11cdc,0x10c4e, // 680
414
- 0x13ddc,0x11cce,0x13dce,0x1bea0,0x1df58,0x1efae,0x1be90,0x1df4c,0x1be88,0x1df46, // 690
415
- 0x1be84,0x1be82,0x13ca0,0x19e58,0x1cf2e,0x17da0,0x13c90,0x19e4c,0x17d90,0x1becc, // 700
416
- 0x19e46,0x17d88,0x13c84,0x17d84,0x13c82,0x17d82,0x11c58,0x18e2e,0x13cd8,0x11c4c, // 710
417
- 0x17dd8,0x13ccc,0x11c46,0x17dcc,0x13cc6,0x17dc6,0x10c2e,0x11c6e,0x13cee,0x17dee, // 720
418
- 0x1be50,0x1df2c,0x1be48,0x1df26,0x1be44,0x1be42,0x13c50,0x19e2c,0x17cd0,0x13c48, // 730
419
- 0x19e26,0x17cc8,0x1be66,0x17cc4,0x13c42,0x17cc2,0x11c2c,0x13c6c,0x11c26,0x17cec, // 740
420
- 0x13c66,0x17ce6,0x1be28,0x1df16,0x1be24,0x1be22,0x13c28,0x19e16,0x17c68,0x13c24, // 750
421
- 0x17c64,0x13c22,0x17c62,0x11c16,0x13c36,0x17c76,0x1be14,0x1be12,0x13c14,0x17c34, // 760
422
- 0x13c12,0x17c32,0x102bc,0x1029e,0x106b8,0x1835e,0x1069c,0x1068e,0x1025e,0x106de, // 770
423
- 0x10eb0,0x1875c,0x10e98,0x1874e,0x10e8c,0x10e86,0x1065c,0x10edc,0x1064e,0x10ece, // 780
424
- 0x11ea0,0x18f58,0x1c7ae,0x11e90,0x18f4c,0x11e88,0x18f46,0x11e84,0x11e82,0x10e58, // 790
425
- 0x1872e,0x11ed8,0x18f6e,0x11ecc,0x10e46,0x11ec6,0x1062e,0x10e6e,0x11eee,0x19f50, // 800
426
- 0x1cfac,0x19f48,0x1cfa6,0x19f44,0x19f42,0x11e50,0x18f2c,0x13ed0,0x19f6c,0x18f26, // 810
427
- 0x13ec8,0x11e44,0x13ec4,0x11e42,0x13ec2,0x10e2c,0x11e6c,0x10e26,0x13eec,0x11e66, // 820
428
- 0x13ee6,0x1dfa8,0x1efd6,0x1dfa4,0x1dfa2,0x19f28,0x1cf96,0x1bf68,0x19f24,0x1bf64, // 830
429
- 0x19f22,0x1bf62,0x11e28,0x18f16,0x13e68,0x11e24,0x17ee8,0x13e64,0x11e22,0x17ee4, // 840
430
- 0x13e62,0x17ee2,0x10e16,0x11e36,0x13e76,0x17ef6,0x1df94,0x1df92,0x19f14,0x1bf34, // 850
431
- 0x19f12,0x1bf32,0x11e14,0x13e34,0x11e12,0x17e74,0x13e32,0x17e72,0x1df8a,0x19f0a, // 860
432
- 0x1bf1a,0x11e0a,0x13e1a,0x17e3a,0x1035c,0x1034e,0x10758,0x183ae,0x1074c,0x10746, // 870
433
- 0x1032e,0x1076e,0x10f50,0x187ac,0x10f48,0x187a6,0x10f44,0x10f42,0x1072c,0x10f6c, // 880
434
- 0x10726,0x10f66,0x18fa8,0x1c7d6,0x18fa4,0x18fa2,0x10f28,0x18796,0x11f68,0x18fb6, // 890
435
- 0x11f64,0x10f22,0x11f62,0x10716,0x10f36,0x11f76,0x1cfd4,0x1cfd2,0x18f94,0x19fb4, // 900
436
- 0x18f92,0x19fb2,0x10f14,0x11f34,0x10f12,0x13f74,0x11f32,0x13f72,0x1cfca,0x18f8a, // 910
437
- 0x19f9a,0x10f0a,0x11f1a,0x13f3a,0x103ac,0x103a6,0x107a8,0x183d6,0x107a4,0x107a2, // 920
438
- 0x10396,0x107b6,0x187d4,0x187d2,0x10794,0x10fb4,0x10792,0x10fb2,0x1c7ea) // 929
439
- ); // end of $clusters array
440
-
441
- /**
442
- * Array of factors of the Reed-Solomon polynomial equations used for error correction; one sub array for each correction level (0-8).
443
- * @protected
444
- */
445
- protected $rsfactors = array(
446
- array( // ECL 0 (2 factors) -------------------------------------------------------------------------------
447
- 0x01b,0x395), // 2
448
- array( // ECL 1 (4 factors) -------------------------------------------------------------------------------
449
- 0x20a,0x238,0x2d3,0x329), // 4
450
- array( // ECL 2 (8 factors) -------------------------------------------------------------------------------
451
- 0x0ed,0x134,0x1b4,0x11c,0x286,0x28d,0x1ac,0x17b), // 8
452
- array( // ECL 3 (16 factors) ------------------------------------------------------------------------------
453
- 0x112,0x232,0x0e8,0x2f3,0x257,0x20c,0x321,0x084,0x127,0x074,0x1ba,0x1ac,0x127,0x02a,0x0b0,0x041),// 16
454
- array( // ECL 4 (32 factors) ------------------------------------------------------------------------------
455
- 0x169,0x23f,0x39a,0x20d,0x0b0,0x24a,0x280,0x141,0x218,0x2e6,0x2a5,0x2e6,0x2af,0x11c,0x0c1,0x205, // 16
456
- 0x111,0x1ee,0x107,0x093,0x251,0x320,0x23b,0x140,0x323,0x085,0x0e7,0x186,0x2ad,0x14a,0x03f,0x19a),// 32
457
- array( // ECL 5 (64 factors) ------------------------------------------------------------------------------
458
- 0x21b,0x1a6,0x006,0x05d,0x35e,0x303,0x1c5,0x06a,0x262,0x11f,0x06b,0x1f9,0x2dd,0x36d,0x17d,0x264, // 16
459
- 0x2d3,0x1dc,0x1ce,0x0ac,0x1ae,0x261,0x35a,0x336,0x21f,0x178,0x1ff,0x190,0x2a0,0x2fa,0x11b,0x0b8, // 32
460
- 0x1b8,0x023,0x207,0x01f,0x1cc,0x252,0x0e1,0x217,0x205,0x160,0x25d,0x09e,0x28b,0x0c9,0x1e8,0x1f6, // 48
461
- 0x288,0x2dd,0x2cd,0x053,0x194,0x061,0x118,0x303,0x348,0x275,0x004,0x17d,0x34b,0x26f,0x108,0x21f),// 64
462
- array( // ECL 6 (128 factors) -----------------------------------------------------------------------------
463
- 0x209,0x136,0x360,0x223,0x35a,0x244,0x128,0x17b,0x035,0x30b,0x381,0x1bc,0x190,0x39d,0x2ed,0x19f, // 16
464
- 0x336,0x05d,0x0d9,0x0d0,0x3a0,0x0f4,0x247,0x26c,0x0f6,0x094,0x1bf,0x277,0x124,0x38c,0x1ea,0x2c0, // 32
465
- 0x204,0x102,0x1c9,0x38b,0x252,0x2d3,0x2a2,0x124,0x110,0x060,0x2ac,0x1b0,0x2ae,0x25e,0x35c,0x239, // 48
466
- 0x0c1,0x0db,0x081,0x0ba,0x0ec,0x11f,0x0c0,0x307,0x116,0x0ad,0x028,0x17b,0x2c8,0x1cf,0x286,0x308, // 64
467
- 0x0ab,0x1eb,0x129,0x2fb,0x09c,0x2dc,0x05f,0x10e,0x1bf,0x05a,0x1fb,0x030,0x0e4,0x335,0x328,0x382, // 80
468
- 0x310,0x297,0x273,0x17a,0x17e,0x106,0x17c,0x25a,0x2f2,0x150,0x059,0x266,0x057,0x1b0,0x29e,0x268, // 96
469
- 0x09d,0x176,0x0f2,0x2d6,0x258,0x10d,0x177,0x382,0x34d,0x1c6,0x162,0x082,0x32e,0x24b,0x324,0x022, // 112
470
- 0x0d3,0x14a,0x21b,0x129,0x33b,0x361,0x025,0x205,0x342,0x13b,0x226,0x056,0x321,0x004,0x06c,0x21b),// 128
471
- array( // ECL 7 (256 factors) -----------------------------------------------------------------------------
472
- 0x20c,0x37e,0x04b,0x2fe,0x372,0x359,0x04a,0x0cc,0x052,0x24a,0x2c4,0x0fa,0x389,0x312,0x08a,0x2d0, // 16
473
- 0x35a,0x0c2,0x137,0x391,0x113,0x0be,0x177,0x352,0x1b6,0x2dd,0x0c2,0x118,0x0c9,0x118,0x33c,0x2f5, // 32
474
- 0x2c6,0x32e,0x397,0x059,0x044,0x239,0x00b,0x0cc,0x31c,0x25d,0x21c,0x391,0x321,0x2bc,0x31f,0x089, // 48
475
- 0x1b7,0x1a2,0x250,0x29c,0x161,0x35b,0x172,0x2b6,0x145,0x0f0,0x0d8,0x101,0x11c,0x225,0x0d1,0x374, // 64
476
- 0x13b,0x046,0x149,0x319,0x1ea,0x112,0x36d,0x0a2,0x2ed,0x32c,0x2ac,0x1cd,0x14e,0x178,0x351,0x209, // 80
477
- 0x133,0x123,0x323,0x2c8,0x013,0x166,0x18f,0x38c,0x067,0x1ff,0x033,0x008,0x205,0x0e1,0x121,0x1d6, // 96
478
- 0x27d,0x2db,0x042,0x0ff,0x395,0x10d,0x1cf,0x33e,0x2da,0x1b1,0x350,0x249,0x088,0x21a,0x38a,0x05a, // 112
479
- 0x002,0x122,0x2e7,0x0c7,0x28f,0x387,0x149,0x031,0x322,0x244,0x163,0x24c,0x0bc,0x1ce,0x00a,0x086, // 128
480
- 0x274,0x140,0x1df,0x082,0x2e3,0x047,0x107,0x13e,0x176,0x259,0x0c0,0x25d,0x08e,0x2a1,0x2af,0x0ea, // 144
481
- 0x2d2,0x180,0x0b1,0x2f0,0x25f,0x280,0x1c7,0x0c1,0x2b1,0x2c3,0x325,0x281,0x030,0x03c,0x2dc,0x26d, // 160
482
- 0x37f,0x220,0x105,0x354,0x28f,0x135,0x2b9,0x2f3,0x2f4,0x03c,0x0e7,0x305,0x1b2,0x1a5,0x2d6,0x210, // 176
483
- 0x1f7,0x076,0x031,0x31b,0x020,0x090,0x1f4,0x0ee,0x344,0x18a,0x118,0x236,0x13f,0x009,0x287,0x226, // 192
484
- 0x049,0x392,0x156,0x07e,0x020,0x2a9,0x14b,0x318,0x26c,0x03c,0x261,0x1b9,0x0b4,0x317,0x37d,0x2f2, // 208
485
- 0x25d,0x17f,0x0e4,0x2ed,0x2f8,0x0d5,0x036,0x129,0x086,0x036,0x342,0x12b,0x39a,0x0bf,0x38e,0x214, // 224
486
- 0x261,0x33d,0x0bd,0x014,0x0a7,0x01d,0x368,0x1c1,0x053,0x192,0x029,0x290,0x1f9,0x243,0x1e1,0x0ad, // 240
487
- 0x194,0x0fb,0x2b0,0x05f,0x1f1,0x22b,0x282,0x21f,0x133,0x09f,0x39c,0x22e,0x288,0x037,0x1f1,0x00a),// 256
488
- array( // ECL 8 (512 factors) -----------------------------------------------------------------------------
489
- 0x160,0x04d,0x175,0x1f8,0x023,0x257,0x1ac,0x0cf,0x199,0x23e,0x076,0x1f2,0x11d,0x17c,0x15e,0x1ec, // 16
490
- 0x0c5,0x109,0x398,0x09b,0x392,0x12b,0x0e5,0x283,0x126,0x367,0x132,0x058,0x057,0x0c1,0x160,0x30d, // 32
491
- 0x34e,0x04b,0x147,0x208,0x1b3,0x21f,0x0cb,0x29a,0x0f9,0x15a,0x30d,0x26d,0x280,0x10c,0x31a,0x216, // 48
492
- 0x21b,0x30d,0x198,0x186,0x284,0x066,0x1dc,0x1f3,0x122,0x278,0x221,0x025,0x35a,0x394,0x228,0x029, // 64
493
- 0x21e,0x121,0x07a,0x110,0x17f,0x320,0x1e5,0x062,0x2f0,0x1d8,0x2f9,0x06b,0x310,0x35c,0x292,0x2e5, // 80
494
- 0x122,0x0cc,0x2a9,0x197,0x357,0x055,0x063,0x03e,0x1e2,0x0b4,0x014,0x129,0x1c3,0x251,0x391,0x08e, // 96
495
- 0x328,0x2ac,0x11f,0x218,0x231,0x04c,0x28d,0x383,0x2d9,0x237,0x2e8,0x186,0x201,0x0c0,0x204,0x102, // 112
496
- 0x0f0,0x206,0x31a,0x18b,0x300,0x350,0x033,0x262,0x180,0x0a8,0x0be,0x33a,0x148,0x254,0x312,0x12f, // 128
497
- 0x23a,0x17d,0x19f,0x281,0x09c,0x0ed,0x097,0x1ad,0x213,0x0cf,0x2a4,0x2c6,0x059,0x0a8,0x130,0x192, // 144
498
- 0x028,0x2c4,0x23f,0x0a2,0x360,0x0e5,0x041,0x35d,0x349,0x200,0x0a4,0x1dd,0x0dd,0x05c,0x166,0x311, // 160
499
- 0x120,0x165,0x352,0x344,0x33b,0x2e0,0x2c3,0x05e,0x008,0x1ee,0x072,0x209,0x002,0x1f3,0x353,0x21f, // 176
500
- 0x098,0x2d9,0x303,0x05f,0x0f8,0x169,0x242,0x143,0x358,0x31d,0x121,0x033,0x2ac,0x1d2,0x215,0x334, // 192
501
- 0x29d,0x02d,0x386,0x1c4,0x0a7,0x156,0x0f4,0x0ad,0x023,0x1cf,0x28b,0x033,0x2bb,0x24f,0x1c4,0x242, // 208
502
- 0x025,0x07c,0x12a,0x14c,0x228,0x02b,0x1ab,0x077,0x296,0x309,0x1db,0x352,0x2fc,0x16c,0x242,0x38f, // 224
503
- 0x11b,0x2c7,0x1d8,0x1a4,0x0f5,0x120,0x252,0x18a,0x1ff,0x147,0x24d,0x309,0x2bb,0x2b0,0x02b,0x198, // 240
504
- 0x34a,0x17f,0x2d1,0x209,0x230,0x284,0x2ca,0x22f,0x03e,0x091,0x369,0x297,0x2c9,0x09f,0x2a0,0x2d9, // 256
505
- 0x270,0x03b,0x0c1,0x1a1,0x09e,0x0d1,0x233,0x234,0x157,0x2b5,0x06d,0x260,0x233,0x16d,0x0b5,0x304, // 272
506
- 0x2a5,0x136,0x0f8,0x161,0x2c4,0x19a,0x243,0x366,0x269,0x349,0x278,0x35c,0x121,0x218,0x023,0x309, // 288
507
- 0x26a,0x24a,0x1a8,0x341,0x04d,0x255,0x15a,0x10d,0x2f5,0x278,0x2b7,0x2ef,0x14b,0x0f7,0x0b8,0x02d, // 304
508
- 0x313,0x2a8,0x012,0x042,0x197,0x171,0x036,0x1ec,0x0e4,0x265,0x33e,0x39a,0x1b5,0x207,0x284,0x389, // 320
509
- 0x315,0x1a4,0x131,0x1b9,0x0cf,0x12c,0x37c,0x33b,0x08d,0x219,0x17d,0x296,0x201,0x038,0x0fc,0x155, // 336
510
- 0x0f2,0x31d,0x346,0x345,0x2d0,0x0e0,0x133,0x277,0x03d,0x057,0x230,0x136,0x2f4,0x299,0x18d,0x328, // 352
511
- 0x353,0x135,0x1d9,0x31b,0x17a,0x01f,0x287,0x393,0x1cb,0x326,0x24e,0x2db,0x1a9,0x0d8,0x224,0x0f9, // 368
512
- 0x141,0x371,0x2bb,0x217,0x2a1,0x30e,0x0d2,0x32f,0x389,0x12f,0x34b,0x39a,0x119,0x049,0x1d5,0x317, // 384
513
- 0x294,0x0a2,0x1f2,0x134,0x09b,0x1a6,0x38b,0x331,0x0bb,0x03e,0x010,0x1a9,0x217,0x150,0x11e,0x1b5, // 400
514
- 0x177,0x111,0x262,0x128,0x0b7,0x39b,0x074,0x29b,0x2ef,0x161,0x03e,0x16e,0x2b3,0x17b,0x2af,0x34a, // 416
515
- 0x025,0x165,0x2d0,0x2e6,0x14a,0x005,0x027,0x39b,0x137,0x1a8,0x0f2,0x2ed,0x141,0x036,0x29d,0x13c, // 432
516
- 0x156,0x12b,0x216,0x069,0x29b,0x1e8,0x280,0x2a0,0x240,0x21c,0x13c,0x1e6,0x2d1,0x262,0x02e,0x290, // 448
517
- 0x1bf,0x0ab,0x268,0x1d0,0x0be,0x213,0x129,0x141,0x2fa,0x2f0,0x215,0x0af,0x086,0x00e,0x17d,0x1b1, // 464
518
- 0x2cd,0x02d,0x06f,0x014,0x254,0x11c,0x2e0,0x08a,0x286,0x19b,0x36d,0x29d,0x08d,0x397,0x02d,0x30c, // 480
519
- 0x197,0x0a4,0x14c,0x383,0x0a5,0x2d6,0x258,0x145,0x1f2,0x28f,0x165,0x2f0,0x300,0x0df,0x351,0x287, // 496
520
- 0x03f,0x136,0x35f,0x0fb,0x16e,0x130,0x11a,0x2e2,0x2a3,0x19a,0x185,0x0f4,0x01f,0x079,0x12f,0x107) // 512
521
- );
522
-
523
- /**
524
- * This is the class constructor.
525
- * Creates a PDF417 object
526
- * @param $code (string) code to represent using PDF417
527
- * @param $ecl (int) error correction level (0-8); default -1 = automatic correction level
528
- * @param $aspectratio (float) the width to height of the symbol (excluding quiet zones)
529
- * @param $macro (array) information for macro block
530
- * @public
531
- */
532
- public function __construct($code, $ecl=-1, $aspectratio=2, $macro=array()) {
533
- $barcode_array = array();
534
- if ((is_null($code)) OR ($code == '\0') OR ($code == '')) {
535
- return false;
536
- }
537
- // get the input sequence array
538
- $sequence = $this->getInputSequences($code);
539
- $codewords = array(); // array of code-words
540
- foreach($sequence as $seq) {
541
- $cw = $this->getCompaction($seq[0], $seq[1], true);
542
- $codewords = array_merge($codewords, $cw);
543
- }
544
- if ($codewords[0] == 900) {
545
- // Text Alpha is the default mode, so remove the first code
546
- array_shift($codewords);
547
- }
548
- // count number of codewords
549
- $numcw = count($codewords);
550
- if ($numcw > 925) {
551
- // reached maximum data codeword capacity
552
- return false;
553
- }
554
- // build macro control block codewords
555
- if (!empty($macro)) {
556
- $macrocw = array();
557
- // beginning of macro control block
558
- $macrocw[] = 928;
559
- // segment index
560
- $cw = $this->getCompaction(902, sprintf('%05d', $macro['segment_index']), false);
561
- $macrocw = array_merge($macrocw, $cw);
562
- // file ID
563
- $cw = $this->getCompaction(900, $macro['file_id'], false);
564
- $macrocw = array_merge($macrocw, $cw);
565
- // optional fields
566
- $optmodes = array(900,902,902,900,900,902,902);
567
- $optsize = array(-1,2,4,-1,-1,-1,2);
568
- foreach ($optmodes as $k => $omode) {
569
- if (isset($macro['option_'.$k])) {
570
- $macrocw[] = 923;
571
- $macrocw[] = $k;
572
- if ($optsize[$k] == 2) {
573
- $macro['option_'.$k] = sprintf('%05d', $macro['option_'.$k]);
574
- } elseif ($optsize[$k] == 4) {
575
- $macro['option_'.$k] = sprintf('%010d', $macro['option_'.$k]);
576
- }
577
- $cw = $this->getCompaction($omode, $macro['option_'.$k], false);
578
- $macrocw = array_merge($macrocw, $cw);
579
- }
580
- }
581
- if ($macro['segment_index'] == ($macro['segment_total'] - 1)) {
582
- // end of control block
583
- $macrocw[] = 922;
584
- }
585
- // update total codewords
586
- $numcw += count($macrocw);
587
- }
588
- // set error correction level
589
- $ecl = $this->getErrorCorrectionLevel($ecl, $numcw);
590
- // number of codewords for error correction
591
- $errsize = (2 << $ecl);
592
- // calculate number of columns (number of codewords per row) and rows
593
- $nce = ($numcw + $errsize + 1);
594
- $cols = round((sqrt(4761 + (68 * $aspectratio * ROWHEIGHT * $nce)) - 69) / 34);
595
- // adjust cols
596
- if ($cols < 1) {
597
- $cols = 1;
598
- } elseif ($cols > 30) {
599
- $cols = 30;
600
- }
601
- $rows = ceil($nce / $cols);
602
- $size = ($cols * $rows);
603
- // adjust rows
604
- if (($rows < 3) OR ($rows > 90)) {
605
- if ($rows < 3) {
606
- $rows = 3;
607
- } elseif ($rows > 90) {
608
- $rows = 90;
609
- }
610
- $cols = ceil($size / $rows);
611
- $size = ($cols * $rows);
612
- }
613
- if ($size > 928) {
614
- // set dimensions to get maximum capacity
615
- if (abs($aspectratio - (17 * 29 / 32)) < abs($aspectratio - (17 * 16 / 58))) {
616
- $cols = 29;
617
- $rows = 32;
618
- } else {
619
- $cols = 16;
620
- $rows = 58;
621
- }
622
- $size = 928;
623
- }
624
- // calculate padding
625
- $pad = ($size - $nce);
626
- if ($pad > 0) {
627
- if (($size - $rows) == $nce) {
628
- --$rows;
629
- $size -= $rows;
630
- } else {
631
- // add pading
632
- $codewords = array_merge($codewords, array_fill(0, $pad, 900));
633
- }
634
- }
635
- if (!empty($macro)) {
636
- // add macro section
637
- $codewords = array_merge($codewords, $macrocw);
638
- }
639
- // Symbol Lenght Descriptor (number of data codewords including Symbol Lenght Descriptor and pad codewords)
640
- $sld = $size - $errsize;
641
- // add symbol length description
642
- array_unshift($codewords, $sld);
643
- // calculate error correction
644
- $ecw = $this->getErrorCorrection($codewords, $ecl);
645
- // add error correction codewords
646
- $codewords = array_merge($codewords, $ecw);
647
- // add horizontal quiet zones to start and stop patterns
648
- $pstart = str_repeat('0', QUIETH).$this->start_pattern;
649
- $pstop = $this->stop_pattern.str_repeat('0', QUIETH);
650
- $barcode_array['num_rows'] = ($rows * ROWHEIGHT) + (2 * QUIETV);
651
- $barcode_array['num_cols'] = (($cols + 2) * 17) + 35 + (2 * QUIETH);
652
- $barcode_array['bcode'] = array();
653
- // build rows for vertical quiet zone
654
- if (QUIETV > 0) {
655
- $empty_row = array_fill(0, $barcode_array['num_cols'], 0);
656
- for ($i = 0; $i < QUIETV; ++$i) {
657
- // add vertical quiet rows
658
- $barcode_array['bcode'][] = $empty_row;
659
- }
660
- }
661
- $k = 0; // codeword index
662
- $cid = 0; // initial cluster
663
- // for each row
664
- for ($r = 0; $r < $rows; ++$r) {
665
- // row start code
666
- $row = $pstart;
667
- switch ($cid) {
668
- case 0: {
669
- $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3));
670
- break;
671
- }
672
- case 1: {
673
- $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3));
674
- break;
675
- }
676
- case 2: {
677
- $L = ((30 * intval($r / 3)) + ($cols - 1));
678
- break;
679
- }
680
- }
681
- // left row indicator
682
- $row .= sprintf('%17b', $this->clusters[$cid][$L]);
683
- // for each column
684
- for ($c = 0; $c < $cols; ++$c) {
685
- $row .= sprintf('%17b', $this->clusters[$cid][$codewords[$k]]);
686
- ++$k;
687
- }
688
- switch ($cid) {
689
- case 0: {
690
- $L = ((30 * intval($r / 3)) + ($cols - 1));
691
- break;
692
- }
693
- case 1: {
694
- $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3));
695
- break;
696
- }
697
- case 2: {
698
- $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3));
699
- break;
700
- }
701
- }
702
- // right row indicator
703
- $row .= sprintf('%17b', $this->clusters[$cid][$L]);
704
- // row stop code
705
- $row .= $pstop;
706
- // convert the string to array
707
- $arow = preg_split('//', $row, -1, PREG_SPLIT_NO_EMPTY);
708
- // duplicate row to get the desired height
709
- for ($h = 0; $h < ROWHEIGHT; ++$h) {
710
- $barcode_array['bcode'][] = $arow;
711
- }
712
- ++$cid;
713
- if ($cid > 2) {
714
- $cid = 0;
715
- }
716
- }
717
- if (QUIETV > 0) {
718
- for ($i = 0; $i < QUIETV; ++$i) {
719
- // add vertical quiet rows
720
- $barcode_array['bcode'][] = $empty_row;
721
- }
722
- }
723
- $this->barcode_array = $barcode_array;
724
- }
725
-
726
- /**
727
- * Returns a barcode array which is readable by TCPDF
728
- * @return array barcode array readable by TCPDF;
729
- * @public
730
- */
731
- public function getBarcodeArray() {
732
- return $this->barcode_array;
733
- }
734
-
735
- /**
736
- * Returns the error correction level (0-8) to be used
737
- * @param $ecl (int) error correction level
738
- * @param $numcw (int) number of data codewords
739
- * @return int error correction level
740
- * @protected
741
- */
742
- protected function getErrorCorrectionLevel($ecl, $numcw) {
743
- // get maximum correction level
744
- $maxecl = 8; // starting error level
745
- $maxerrsize = (928 - $numcw); // available codewords for error
746
- while ($maxecl > 0) {
747
- /////////////////////////////
748
- // Algoritmika
749
- if ( version_compare( PHP_VERSION, '7.0.0' ) >= 0 && $ecl < 0 ) {
750
- $ecl = 0;
751
- }
752
- /////////////////////////////
753
- $errsize = (2 << $ecl);
754
- if ($maxerrsize >= $errsize) {
755
- break;
756
- }
757
- --$maxecl;
758
- }
759
- // check for automatic levels
760
- if (($ecl < 0) OR ($ecl > 8)) {
761
- if ($numcw < 41) {
762
- $ecl = 2;
763
- } elseif ($numcw < 161) {
764
- $ecl = 3;
765
- } elseif ($numcw < 321) {
766
- $ecl = 4;
767
- } elseif ($numcw < 864) {
768
- $ecl = 5;
769
- } else {
770
- $ecl = $maxecl;
771
- }
772
- }
773
- if ($ecl > $maxecl) {
774
- $ecl = $maxecl;
775
- }
776
- return $ecl;
777
- }
778
-
779
- /**
780
- * Returns the error correction codewords
781
- * @param $cw (array) array of codewords including Symbol Lenght Descriptor and pad
782
- * @param $ecl (int) error correction level 0-8
783
- * @return array of error correction codewords
784
- * @protected
785
- */
786
- protected function getErrorCorrection($cw, $ecl) {
787
- // get error correction coefficients
788
- $ecc = $this->rsfactors[$ecl];
789
- // number of error correction factors
790
- $eclsize = (2 << $ecl);
791
- // maximum index for $rsfactors[$ecl]
792
- $eclmaxid = ($eclsize - 1);
793
- // initialize array of error correction codewords
794
- $ecw = array_fill(0, $eclsize, 0);
795
- // for each data codeword
796
- foreach($cw as $k => $d) {
797
- $t1 = ($d + $ecw[$eclmaxid]) % 929;
798
- for ($j = $eclmaxid; $j > 0; --$j) {
799
- $t2 = ($t1 * $ecc[$j]) % 929;
800
- $t3 = 929 - $t2;
801
- $ecw[$j] = ($ecw[($j - 1)] + $t3) % 929;
802
- }
803
- $t2 = ($t1 * $ecc[0]) % 929;
804
- $t3 = 929 - $t2;
805
- $ecw[0] = $t3 % 929;
806
- }
807
- foreach($ecw as $j => $e) {
808
- if ($e != 0) {
809
- $ecw[$j] = 929 - $e;
810
- }
811
- }
812
- $ecw = array_reverse($ecw);
813
- return $ecw;
814
- }
815
-
816
- /**
817
- * Create array of sequences from input
818
- * @param $code (string) code
819
- * @return bidimensional array containing characters and classification
820
- * @protected
821
- */
822
- protected function getInputSequences($code) {
823
- $sequence_array = array(); // array to be returned
824
- $numseq = array();
825
- // get numeric sequences
826
- preg_match_all('/([0-9]{13,44})/', $code, $numseq, PREG_OFFSET_CAPTURE);
827
- $numseq[1][] = array('', strlen($code));
828
- $offset = 0;
829
- foreach($numseq[1] as $seq) {
830
- $seqlen = strlen($seq[0]);
831
- if ($seq[1] > 0) {
832
- // extract text sequence before the number sequence
833
- $prevseq = substr($code, $offset, ($seq[1] - $offset));
834
- $textseq = array();
835
- // get text sequences
836
- preg_match_all('/([\x09\x0a\x0d\x20-\x7e]{5,})/', $prevseq, $textseq, PREG_OFFSET_CAPTURE);
837
- $textseq[1][] = array('', strlen($prevseq));
838
- $txtoffset = 0;
839
- foreach($textseq[1] as $txtseq) {
840
- $txtseqlen = strlen($txtseq[0]);
841
- if ($txtseq[1] > 0) {
842
- // extract byte sequence before the text sequence
843
- $prevtxtseq = substr($prevseq, $txtoffset, ($txtseq[1] - $txtoffset));
844
- if (strlen($prevtxtseq) > 0) {
845
- // add BYTE sequence
846
- if ((strlen($prevtxtseq) == 1) AND ((count($sequence_array) > 0) AND ($sequence_array[(count($sequence_array) - 1)][0] == 900))) {
847
- $sequence_array[] = array(913, $prevtxtseq);
848
- } elseif ((strlen($prevtxtseq) % 6) == 0) {
849
- $sequence_array[] = array(924, $prevtxtseq);
850
- } else {
851
- $sequence_array[] = array(901, $prevtxtseq);
852
- }
853
- }
854
- }
855
- if ($txtseqlen > 0) {
856
- // add numeric sequence
857
- $sequence_array[] = array(900, $txtseq[0]);
858
- }
859
- $txtoffset = $txtseq[1] + $txtseqlen;
860
- }
861
- }
862
- if ($seqlen > 0) {
863
- // add numeric sequence
864
- $sequence_array[] = array(902, $seq[0]);
865
- }
866
- $offset = $seq[1] + $seqlen;
867
- }
868
- return $sequence_array;
869
- }
870
-
871
- /**
872
- * Compact data by mode.
873
- * @param $mode (int) compaction mode number
874
- * @param $code (string) data to compact
875
- * @param $addmode (boolean) if true add the mode codeword at first position
876
- * @return array of codewords
877
- * @protected
878
- */
879
- protected function getCompaction($mode, $code, $addmode=true) {
880
- $cw = array(); // array of codewords to return
881
- switch($mode) {
882
- case 900: { // Text Compaction mode latch
883
- $submode = 0; // default Alpha sub-mode
884
- $txtarr = array(); // array of characters and sub-mode switching characters
885
- $codelen = strlen($code);
886
- for ($i = 0; $i < $codelen; ++$i) {
887
- $chval = ord($code{$i});
888
- if (($k = array_search($chval, $this->textsubmodes[$submode])) !== false) {
889
- // we are on the same sub-mode
890
- $txtarr[] = $k;
891
- } else {
892
- // the sub-mode is changed
893
- for ($s = 0; $s < 4; ++$s) {
894
- // search new sub-mode
895
- if (($s != $submode) AND (($k = array_search($chval, $this->textsubmodes[$s])) !== false)) {
896
- // $s is the new submode
897
- if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code{($i + 1)}), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) {
898
- // shift (temporary change only for this char)
899
- if ($s == 3) {
900
- // shift to puntuaction
901
- $txtarr[] = 29;
902
- } else {
903
- // shift from lower to alpha
904
- $txtarr[] = 27;
905
- }
906
- } else {
907
- // latch
908
- $txtarr = array_merge($txtarr, $this->textlatch[''.$submode.$s]);
909
- // set new submode
910
- $submode = $s;
911
- }
912
- // add characted code to array
913
- $txtarr[] = $k;
914
- break;
915
- }
916
- }
917
- }
918
- }
919
- $txtarrlen = count($txtarr);
920
- if (($txtarrlen % 2) != 0) {
921
- // add padding
922
- $txtarr[] = 29;
923
- ++$txtarrlen;
924
- }
925
- // calculate codewords
926
- for ($i = 0; $i < $txtarrlen; $i += 2) {
927
- $cw[] = (30 * $txtarr[$i]) + $txtarr[($i + 1)];
928
- }
929
- break;
930
- }
931
- case 901:
932
- case 924: { // Byte Compaction mode latch
933
- while (($codelen = strlen($code)) > 0) {
934
- if ($codelen > 6) {
935
- $rest = substr($code, 6);
936
- $code = substr($code, 0, 6);
937
- $sublen = 6;
938
- } else {
939
- $rest = '';
940
- $sublen = strlen($code);
941
- }
942
- if ($sublen == 6) {
943
- $t = bcmul(''.ord($code[0]), '1099511627776');
944
- $t = bcadd($t, bcmul(''.ord($code[1]), '4294967296'));
945
- $t = bcadd($t, bcmul(''.ord($code[2]), '16777216'));
946
- $t = bcadd($t, bcmul(''.ord($code[3]), '65536'));
947
- $t = bcadd($t, bcmul(''.ord($code[4]), '256'));
948
- $t = bcadd($t, ''.ord($code[5]));
949
- // tmp array for the 6 bytes block
950
- $cw6 = array();
951
- do {
952
- $d = bcmod($t, '900');
953
- $t = bcdiv($t, '900');
954
- // prepend the value to the beginning of the array
955
- array_unshift($cw6, $d);
956
- } while ($t != '0');
957
- // append the result array at the end
958
- $cw = array_merge($cw, $cw6);
959
- } else {
960
- for ($i = 0; $i < $sublen; ++$i) {
961
- $cw[] = ord($code{$i});
962
- }
963
- }
964
- $code = $rest;
965
- }
966
- break;
967
- }
968
- case 902: { // Numeric Compaction mode latch
969
- while (($codelen = strlen($code)) > 0) {
970
- if ($codelen > 44) {
971
- $rest = substr($code, 44);
972
- $code = substr($code, 0, 44);
973
- } else {
974
- $rest = '';
975
- }
976
- $t = '1'.$code;
977
- do {
978
- $d = bcmod($t, '900');
979
- $t = bcdiv($t, '900');
980
- array_unshift($cw, $d);
981
- } while ($t != '0');
982
- $code = $rest;
983
- }
984
- break;
985
- }
986
- case 913: { // Byte Compaction mode shift
987
- $cw[] = ord($code);
988
- break;
989
- }
990
- }
991
- if ($addmode) {
992
- // add the compaction mode codeword at the beginning
993
- array_unshift($cw, $mode);
994
- }
995
- return $cw;
996
- }
997
-
998
- } // end PDF417 class
999
-
1000
- //============================================================+
1001
- // END OF FILE
1002
- //============================================================+
 
 
 
 
 
1
+ <?php
2
+ //============================================================+
3
+ // File name : pdf417.php
4
+ // Version : 1.0.005
5
+ // Begin : 2010-06-03
6
+ // Last Update : 2014-04-25
7
+ // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
+ // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
+ // -------------------------------------------------------------------
10
+ // Copyright (C) 2010-2013 Nicola Asuni - Tecnick.com LTD
11
+ //
12
+ // This file is part of TCPDF software library.
13
+ //
14
+ // TCPDF is free software: you can redistribute it and/or modify it
15
+ // under the terms of the GNU Lesser General Public License as
16
+ // published by the Free Software Foundation, either version 3 of the
17
+ // License, or (at your option) any later version.
18
+ //
19
+ // TCPDF is distributed in the hope that it will be useful, but
20
+ // WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
+ // See the GNU Lesser General Public License for more details.
23
+ //
24
+ // You should have received a copy of the GNU Lesser General Public License
25
+ // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
+ //
27
+ // See LICENSE.TXT file for more information.
28
+ // -------------------------------------------------------------------
29
+ //
30
+ // DESCRIPTION :
31
+ //
32
+ // Class to create PDF417 barcode arrays for TCPDF class.
33
+ // PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991.
34
+ // It is one of the most popular 2D codes because of its ability to be read with slightly modified handheld laser or linear CCD scanners.
35
+ // TECHNICAL DATA / FEATURES OF PDF417:
36
+ // Encodable Character Set: All 128 ASCII Characters (including extended)
37
+ // Code Type: Continuous, Multi-Row
38
+ // Symbol Height: 3 - 90 Rows
39
+ // Symbol Width: 90X - 583X
40
+ // Bidirectional Decoding: Yes
41
+ // Error Correction Characters: 2 - 512
42
+ // Maximum Data Characters: 1850 text, 2710 digits, 1108 bytes
43
+ //
44
+ //============================================================+
45
+
46
+ /**
47
+ * @file
48
+ * Class to create PDF417 barcode arrays for TCPDF class.
49
+ * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991.
50
+ * (requires PHP bcmath extension)
51
+ * @package com.tecnick.tcpdf
52
+ * @author Nicola Asuni
53
+ * @version 1.0.005
54
+ */
55
+
56
+ // definitions
57
+ if (!defined('PDF417DEFS')) {
58
+
59
+ /**
60
+ * Indicate that definitions for this class are set
61
+ */
62
+ define('PDF417DEFS', true);
63
+
64
+ // -----------------------------------------------------
65
+
66
+ /**
67
+ * Row height respect X dimension of single module
68
+ */
69
+ define('ROWHEIGHT', 4);
70
+
71
+ /**
72
+ * Horizontal quiet zone in modules
73
+ */
74
+ define('QUIETH', 2);
75
+
76
+ /**
77
+ * Vertical quiet zone in modules
78
+ */
79
+ define('QUIETV', 2);
80
+
81
+ } // end of definitions
82
+
83
+ // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
84
+
85
+ /**
86
+ * @class PDF417
87
+ * Class to create PDF417 barcode arrays for TCPDF class.
88
+ * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991.
89
+ * @package com.tecnick.tcpdf
90
+ * @author Nicola Asuni
91
+ * @version 1.0.003
92
+ */
93
+ class PDF417 {
94
+
95
+ /**
96
+ * Barcode array to be returned which is readable by TCPDF.
97
+ * @protected
98
+ */
99
+ protected $barcode_array = array();
100
+
101
+ /**
102
+ * Start pattern.
103
+ * @protected
104
+ */
105
+ protected $start_pattern = '11111111010101000';
106
+
107
+ /**
108
+ * Stop pattern.
109
+ * @protected
110
+ */
111
+ protected $stop_pattern = '111111101000101001';
112
+
113
+ /**
114
+ * Array of text Compaction Sub-Modes (values 0xFB - 0xFF are used for submode changers).
115
+ * @protected
116
+ */
117
+ protected $textsubmodes = array(
118
+ array(0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x20,0xFD,0xFE,0xFF), // Alpha
119
+ array(0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x20,0xFD,0xFE,0xFF), // Lower
120
+ array(0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x26,0x0d,0x09,0x2c,0x3a,0x23,0x2d,0x2e,0x24,0x2f,0x2b,0x25,0x2a,0x3d,0x5e,0xFB,0x20,0xFD,0xFE,0xFF), // Mixed
121
+ array(0x3b,0x3c,0x3e,0x40,0x5b,0x5c,0x5d,0x5f,0x60,0x7e,0x21,0x0d,0x09,0x2c,0x3a,0x0a,0x2d,0x2e,0x24,0x2f,0x22,0x7c,0x2a,0x28,0x29,0x3f,0x7b,0x7d,0x27,0xFF) // Puntuaction
122
+ );
123
+
124
+ /**
125
+ * Array of switching codes for Text Compaction Sub-Modes.
126
+ * @protected
127
+ */
128
+ protected $textlatch = array(
129
+ '01' => array(27), '02' => array(28), '03' => array(28,25), //
130
+ '10' => array(28,28), '12' => array(28), '13' => array(28,25), //
131
+ '20' => array(28), '21' => array(27), '23' => array(25), //
132
+ '30' => array(29), '31' => array(29,27), '32' => array(29,28) //
133
+ );
134
+
135
+ /**
136
+ * Clusters of codewords (0, 3, 6)<br/>
137
+ * Values are hex equivalents of binary representation of bars (1 = bar, 0 = space).<br/>
138
+ * The codewords numbered from 900 to 928 have special meaning, some enable to switch between modes in order to optimise the code:<ul>
139
+ * <li>900 : Switch to "Text" mode</li>
140
+ * <li>901 : Switch to "Byte" mode</li>
141
+ * <li>902 : Switch to "Numeric" mode</li>
142
+ * <li>903 - 912 : Reserved</li>
143
+ * <li>913 : Switch to "Octet" only for the next codeword</li>
144
+ * <li>914 - 920 : Reserved</li>
145
+ * <li>921 : Initialization</li>
146
+ * <li>922 : Terminator codeword for Macro PDF control block</li>
147
+ * <li>923 : Sequence tag to identify the beginning of optional fields in the Macro PDF control block</li>
148
+ * <li>924 : Switch to "Byte" mode (If the total number of byte is multiple of 6)</li>
149
+ * <li>925 : Identifier for a user defined Extended Channel Interpretation (ECI)</li>
150
+ * <li>926 : Identifier for a general purpose ECI format</li>
151
+ * <li>927 : Identifier for an ECI of a character set or code page</li>
152
+ * <li>928 : Macro marker codeword to indicate the beginning of a Macro PDF Control Block</li>
153
+ * </ul>
154
+ * @protected
155
+ */
156
+ protected $clusters = array(
157
+ array( // cluster 0 -----------------------------------------------------------------------
158
+ 0x1d5c0,0x1eaf0,0x1f57c,0x1d4e0,0x1ea78,0x1f53e,0x1a8c0,0x1d470,0x1a860,0x15040, // 10
159
+ 0x1a830,0x15020,0x1adc0,0x1d6f0,0x1eb7c,0x1ace0,0x1d678,0x1eb3e,0x158c0,0x1ac70, // 20
160
+ 0x15860,0x15dc0,0x1aef0,0x1d77c,0x15ce0,0x1ae78,0x1d73e,0x15c70,0x1ae3c,0x15ef0, // 30
161
+ 0x1af7c,0x15e78,0x1af3e,0x15f7c,0x1f5fa,0x1d2e0,0x1e978,0x1f4be,0x1a4c0,0x1d270, // 40
162
+ 0x1e93c,0x1a460,0x1d238,0x14840,0x1a430,0x1d21c,0x14820,0x1a418,0x14810,0x1a6e0, // 50
163
+ 0x1d378,0x1e9be,0x14cc0,0x1a670,0x1d33c,0x14c60,0x1a638,0x1d31e,0x14c30,0x1a61c, // 60
164
+ 0x14ee0,0x1a778,0x1d3be,0x14e70,0x1a73c,0x14e38,0x1a71e,0x14f78,0x1a7be,0x14f3c, // 70
165
+ 0x14f1e,0x1a2c0,0x1d170,0x1e8bc,0x1a260,0x1d138,0x1e89e,0x14440,0x1a230,0x1d11c, // 80
166
+ 0x14420,0x1a218,0x14410,0x14408,0x146c0,0x1a370,0x1d1bc,0x14660,0x1a338,0x1d19e, // 90
167
+ 0x14630,0x1a31c,0x14618,0x1460c,0x14770,0x1a3bc,0x14738,0x1a39e,0x1471c,0x147bc, // 100
168
+ 0x1a160,0x1d0b8,0x1e85e,0x14240,0x1a130,0x1d09c,0x14220,0x1a118,0x1d08e,0x14210, // 110
169
+ 0x1a10c,0x14208,0x1a106,0x14360,0x1a1b8,0x1d0de,0x14330,0x1a19c,0x14318,0x1a18e, // 120
170
+ 0x1430c,0x14306,0x1a1de,0x1438e,0x14140,0x1a0b0,0x1d05c,0x14120,0x1a098,0x1d04e, // 130
171
+ 0x14110,0x1a08c,0x14108,0x1a086,0x14104,0x141b0,0x14198,0x1418c,0x140a0,0x1d02e, // 140
172
+ 0x1a04c,0x1a046,0x14082,0x1cae0,0x1e578,0x1f2be,0x194c0,0x1ca70,0x1e53c,0x19460, // 150
173
+ 0x1ca38,0x1e51e,0x12840,0x19430,0x12820,0x196e0,0x1cb78,0x1e5be,0x12cc0,0x19670, // 160
174
+ 0x1cb3c,0x12c60,0x19638,0x12c30,0x12c18,0x12ee0,0x19778,0x1cbbe,0x12e70,0x1973c, // 170
175
+ 0x12e38,0x12e1c,0x12f78,0x197be,0x12f3c,0x12fbe,0x1dac0,0x1ed70,0x1f6bc,0x1da60, // 180
176
+ 0x1ed38,0x1f69e,0x1b440,0x1da30,0x1ed1c,0x1b420,0x1da18,0x1ed0e,0x1b410,0x1da0c, // 190
177
+ 0x192c0,0x1c970,0x1e4bc,0x1b6c0,0x19260,0x1c938,0x1e49e,0x1b660,0x1db38,0x1ed9e, // 200
178
+ 0x16c40,0x12420,0x19218,0x1c90e,0x16c20,0x1b618,0x16c10,0x126c0,0x19370,0x1c9bc, // 210
179
+ 0x16ec0,0x12660,0x19338,0x1c99e,0x16e60,0x1b738,0x1db9e,0x16e30,0x12618,0x16e18, // 220
180
+ 0x12770,0x193bc,0x16f70,0x12738,0x1939e,0x16f38,0x1b79e,0x16f1c,0x127bc,0x16fbc, // 230
181
+ 0x1279e,0x16f9e,0x1d960,0x1ecb8,0x1f65e,0x1b240,0x1d930,0x1ec9c,0x1b220,0x1d918, // 240
182
+ 0x1ec8e,0x1b210,0x1d90c,0x1b208,0x1b204,0x19160,0x1c8b8,0x1e45e,0x1b360,0x19130, // 250
183
+ 0x1c89c,0x16640,0x12220,0x1d99c,0x1c88e,0x16620,0x12210,0x1910c,0x16610,0x1b30c, // 260
184
+ 0x19106,0x12204,0x12360,0x191b8,0x1c8de,0x16760,0x12330,0x1919c,0x16730,0x1b39c, // 270
185
+ 0x1918e,0x16718,0x1230c,0x12306,0x123b8,0x191de,0x167b8,0x1239c,0x1679c,0x1238e, // 280
186
+ 0x1678e,0x167de,0x1b140,0x1d8b0,0x1ec5c,0x1b120,0x1d898,0x1ec4e,0x1b110,0x1d88c, // 290
187
+ 0x1b108,0x1d886,0x1b104,0x1b102,0x12140,0x190b0,0x1c85c,0x16340,0x12120,0x19098, // 300
188
+ 0x1c84e,0x16320,0x1b198,0x1d8ce,0x16310,0x12108,0x19086,0x16308,0x1b186,0x16304, // 310
189
+ 0x121b0,0x190dc,0x163b0,0x12198,0x190ce,0x16398,0x1b1ce,0x1638c,0x12186,0x16386, // 320
190
+ 0x163dc,0x163ce,0x1b0a0,0x1d858,0x1ec2e,0x1b090,0x1d84c,0x1b088,0x1d846,0x1b084, // 330
191
+ 0x1b082,0x120a0,0x19058,0x1c82e,0x161a0,0x12090,0x1904c,0x16190,0x1b0cc,0x19046, // 340
192
+ 0x16188,0x12084,0x16184,0x12082,0x120d8,0x161d8,0x161cc,0x161c6,0x1d82c,0x1d826, // 350
193
+ 0x1b042,0x1902c,0x12048,0x160c8,0x160c4,0x160c2,0x18ac0,0x1c570,0x1e2bc,0x18a60, // 360
194
+ 0x1c538,0x11440,0x18a30,0x1c51c,0x11420,0x18a18,0x11410,0x11408,0x116c0,0x18b70, // 370
195
+ 0x1c5bc,0x11660,0x18b38,0x1c59e,0x11630,0x18b1c,0x11618,0x1160c,0x11770,0x18bbc, // 380
196
+ 0x11738,0x18b9e,0x1171c,0x117bc,0x1179e,0x1cd60,0x1e6b8,0x1f35e,0x19a40,0x1cd30, // 390
197
+ 0x1e69c,0x19a20,0x1cd18,0x1e68e,0x19a10,0x1cd0c,0x19a08,0x1cd06,0x18960,0x1c4b8, // 400
198
+ 0x1e25e,0x19b60,0x18930,0x1c49c,0x13640,0x11220,0x1cd9c,0x1c48e,0x13620,0x19b18, // 410
199
+ 0x1890c,0x13610,0x11208,0x13608,0x11360,0x189b8,0x1c4de,0x13760,0x11330,0x1cdde, // 420
200
+ 0x13730,0x19b9c,0x1898e,0x13718,0x1130c,0x1370c,0x113b8,0x189de,0x137b8,0x1139c, // 430
201
+ 0x1379c,0x1138e,0x113de,0x137de,0x1dd40,0x1eeb0,0x1f75c,0x1dd20,0x1ee98,0x1f74e, // 440
202
+ 0x1dd10,0x1ee8c,0x1dd08,0x1ee86,0x1dd04,0x19940,0x1ccb0,0x1e65c,0x1bb40,0x19920, // 450
203
+ 0x1eedc,0x1e64e,0x1bb20,0x1dd98,0x1eece,0x1bb10,0x19908,0x1cc86,0x1bb08,0x1dd86, // 460
204
+ 0x19902,0x11140,0x188b0,0x1c45c,0x13340,0x11120,0x18898,0x1c44e,0x17740,0x13320, // 470
205
+ 0x19998,0x1ccce,0x17720,0x1bb98,0x1ddce,0x18886,0x17710,0x13308,0x19986,0x17708, // 480
206
+ 0x11102,0x111b0,0x188dc,0x133b0,0x11198,0x188ce,0x177b0,0x13398,0x199ce,0x17798, // 490
207
+ 0x1bbce,0x11186,0x13386,0x111dc,0x133dc,0x111ce,0x177dc,0x133ce,0x1dca0,0x1ee58, // 500
208
+ 0x1f72e,0x1dc90,0x1ee4c,0x1dc88,0x1ee46,0x1dc84,0x1dc82,0x198a0,0x1cc58,0x1e62e, // 510
209
+ 0x1b9a0,0x19890,0x1ee6e,0x1b990,0x1dccc,0x1cc46,0x1b988,0x19884,0x1b984,0x19882, // 520
210
+ 0x1b982,0x110a0,0x18858,0x1c42e,0x131a0,0x11090,0x1884c,0x173a0,0x13190,0x198cc, // 530
211
+ 0x18846,0x17390,0x1b9cc,0x11084,0x17388,0x13184,0x11082,0x13182,0x110d8,0x1886e, // 540
212
+ 0x131d8,0x110cc,0x173d8,0x131cc,0x110c6,0x173cc,0x131c6,0x110ee,0x173ee,0x1dc50, // 550
213
+ 0x1ee2c,0x1dc48,0x1ee26,0x1dc44,0x1dc42,0x19850,0x1cc2c,0x1b8d0,0x19848,0x1cc26, // 560
214
+ 0x1b8c8,0x1dc66,0x1b8c4,0x19842,0x1b8c2,0x11050,0x1882c,0x130d0,0x11048,0x18826, // 570
215
+ 0x171d0,0x130c8,0x19866,0x171c8,0x1b8e6,0x11042,0x171c4,0x130c2,0x171c2,0x130ec, // 580
216
+ 0x171ec,0x171e6,0x1ee16,0x1dc22,0x1cc16,0x19824,0x19822,0x11028,0x13068,0x170e8, // 590
217
+ 0x11022,0x13062,0x18560,0x10a40,0x18530,0x10a20,0x18518,0x1c28e,0x10a10,0x1850c, // 600
218
+ 0x10a08,0x18506,0x10b60,0x185b8,0x1c2de,0x10b30,0x1859c,0x10b18,0x1858e,0x10b0c, // 610
219
+ 0x10b06,0x10bb8,0x185de,0x10b9c,0x10b8e,0x10bde,0x18d40,0x1c6b0,0x1e35c,0x18d20, // 620
220
+ 0x1c698,0x18d10,0x1c68c,0x18d08,0x1c686,0x18d04,0x10940,0x184b0,0x1c25c,0x11b40, // 630
221
+ 0x10920,0x1c6dc,0x1c24e,0x11b20,0x18d98,0x1c6ce,0x11b10,0x10908,0x18486,0x11b08, // 640
222
+ 0x18d86,0x10902,0x109b0,0x184dc,0x11bb0,0x10998,0x184ce,0x11b98,0x18dce,0x11b8c, // 650
223
+ 0x10986,0x109dc,0x11bdc,0x109ce,0x11bce,0x1cea0,0x1e758,0x1f3ae,0x1ce90,0x1e74c, // 660
224
+ 0x1ce88,0x1e746,0x1ce84,0x1ce82,0x18ca0,0x1c658,0x19da0,0x18c90,0x1c64c,0x19d90, // 670
225
+ 0x1cecc,0x1c646,0x19d88,0x18c84,0x19d84,0x18c82,0x19d82,0x108a0,0x18458,0x119a0, // 680
226
+ 0x10890,0x1c66e,0x13ba0,0x11990,0x18ccc,0x18446,0x13b90,0x19dcc,0x10884,0x13b88, // 690
227
+ 0x11984,0x10882,0x11982,0x108d8,0x1846e,0x119d8,0x108cc,0x13bd8,0x119cc,0x108c6, // 700
228
+ 0x13bcc,0x119c6,0x108ee,0x119ee,0x13bee,0x1ef50,0x1f7ac,0x1ef48,0x1f7a6,0x1ef44, // 710
229
+ 0x1ef42,0x1ce50,0x1e72c,0x1ded0,0x1ef6c,0x1e726,0x1dec8,0x1ef66,0x1dec4,0x1ce42, // 720
230
+ 0x1dec2,0x18c50,0x1c62c,0x19cd0,0x18c48,0x1c626,0x1bdd0,0x19cc8,0x1ce66,0x1bdc8, // 730
231
+ 0x1dee6,0x18c42,0x1bdc4,0x19cc2,0x1bdc2,0x10850,0x1842c,0x118d0,0x10848,0x18426, // 740
232
+ 0x139d0,0x118c8,0x18c66,0x17bd0,0x139c8,0x19ce6,0x10842,0x17bc8,0x1bde6,0x118c2, // 750
233
+ 0x17bc4,0x1086c,0x118ec,0x10866,0x139ec,0x118e6,0x17bec,0x139e6,0x17be6,0x1ef28, // 760
234
+ 0x1f796,0x1ef24,0x1ef22,0x1ce28,0x1e716,0x1de68,0x1ef36,0x1de64,0x1ce22,0x1de62, // 770
235
+ 0x18c28,0x1c616,0x19c68,0x18c24,0x1bce8,0x19c64,0x18c22,0x1bce4,0x19c62,0x1bce2, // 780
236
+ 0x10828,0x18416,0x11868,0x18c36,0x138e8,0x11864,0x10822,0x179e8,0x138e4,0x11862, // 790
237
+ 0x179e4,0x138e2,0x179e2,0x11876,0x179f6,0x1ef12,0x1de34,0x1de32,0x19c34,0x1bc74, // 800
238
+ 0x1bc72,0x11834,0x13874,0x178f4,0x178f2,0x10540,0x10520,0x18298,0x10510,0x10508, // 810
239
+ 0x10504,0x105b0,0x10598,0x1058c,0x10586,0x105dc,0x105ce,0x186a0,0x18690,0x1c34c, // 820
240
+ 0x18688,0x1c346,0x18684,0x18682,0x104a0,0x18258,0x10da0,0x186d8,0x1824c,0x10d90, // 830
241
+ 0x186cc,0x10d88,0x186c6,0x10d84,0x10482,0x10d82,0x104d8,0x1826e,0x10dd8,0x186ee, // 840
242
+ 0x10dcc,0x104c6,0x10dc6,0x104ee,0x10dee,0x1c750,0x1c748,0x1c744,0x1c742,0x18650, // 850
243
+ 0x18ed0,0x1c76c,0x1c326,0x18ec8,0x1c766,0x18ec4,0x18642,0x18ec2,0x10450,0x10cd0, // 860
244
+ 0x10448,0x18226,0x11dd0,0x10cc8,0x10444,0x11dc8,0x10cc4,0x10442,0x11dc4,0x10cc2, // 870
245
+ 0x1046c,0x10cec,0x10466,0x11dec,0x10ce6,0x11de6,0x1e7a8,0x1e7a4,0x1e7a2,0x1c728, // 880
246
+ 0x1cf68,0x1e7b6,0x1cf64,0x1c722,0x1cf62,0x18628,0x1c316,0x18e68,0x1c736,0x19ee8, // 890
247
+ 0x18e64,0x18622,0x19ee4,0x18e62,0x19ee2,0x10428,0x18216,0x10c68,0x18636,0x11ce8, // 900
248
+ 0x10c64,0x10422,0x13de8,0x11ce4,0x10c62,0x13de4,0x11ce2,0x10436,0x10c76,0x11cf6, // 910
249
+ 0x13df6,0x1f7d4,0x1f7d2,0x1e794,0x1efb4,0x1e792,0x1efb2,0x1c714,0x1cf34,0x1c712, // 920
250
+ 0x1df74,0x1cf32,0x1df72,0x18614,0x18e34,0x18612,0x19e74,0x18e32,0x1bef4), // 929
251
+ array( // cluster 3 -----------------------------------------------------------------------
252
+ 0x1f560,0x1fab8,0x1ea40,0x1f530,0x1fa9c,0x1ea20,0x1f518,0x1fa8e,0x1ea10,0x1f50c, // 10
253
+ 0x1ea08,0x1f506,0x1ea04,0x1eb60,0x1f5b8,0x1fade,0x1d640,0x1eb30,0x1f59c,0x1d620, // 20
254
+ 0x1eb18,0x1f58e,0x1d610,0x1eb0c,0x1d608,0x1eb06,0x1d604,0x1d760,0x1ebb8,0x1f5de, // 30
255
+ 0x1ae40,0x1d730,0x1eb9c,0x1ae20,0x1d718,0x1eb8e,0x1ae10,0x1d70c,0x1ae08,0x1d706, // 40
256
+ 0x1ae04,0x1af60,0x1d7b8,0x1ebde,0x15e40,0x1af30,0x1d79c,0x15e20,0x1af18,0x1d78e, // 50
257
+ 0x15e10,0x1af0c,0x15e08,0x1af06,0x15f60,0x1afb8,0x1d7de,0x15f30,0x1af9c,0x15f18, // 60
258
+ 0x1af8e,0x15f0c,0x15fb8,0x1afde,0x15f9c,0x15f8e,0x1e940,0x1f4b0,0x1fa5c,0x1e920, // 70
259
+ 0x1f498,0x1fa4e,0x1e910,0x1f48c,0x1e908,0x1f486,0x1e904,0x1e902,0x1d340,0x1e9b0, // 80
260
+ 0x1f4dc,0x1d320,0x1e998,0x1f4ce,0x1d310,0x1e98c,0x1d308,0x1e986,0x1d304,0x1d302, // 90
261
+ 0x1a740,0x1d3b0,0x1e9dc,0x1a720,0x1d398,0x1e9ce,0x1a710,0x1d38c,0x1a708,0x1d386, // 100
262
+ 0x1a704,0x1a702,0x14f40,0x1a7b0,0x1d3dc,0x14f20,0x1a798,0x1d3ce,0x14f10,0x1a78c, // 110
263
+ 0x14f08,0x1a786,0x14f04,0x14fb0,0x1a7dc,0x14f98,0x1a7ce,0x14f8c,0x14f86,0x14fdc, // 120
264
+ 0x14fce,0x1e8a0,0x1f458,0x1fa2e,0x1e890,0x1f44c,0x1e888,0x1f446,0x1e884,0x1e882, // 130
265
+ 0x1d1a0,0x1e8d8,0x1f46e,0x1d190,0x1e8cc,0x1d188,0x1e8c6,0x1d184,0x1d182,0x1a3a0, // 140
266
+ 0x1d1d8,0x1e8ee,0x1a390,0x1d1cc,0x1a388,0x1d1c6,0x1a384,0x1a382,0x147a0,0x1a3d8, // 150
267
+ 0x1d1ee,0x14790,0x1a3cc,0x14788,0x1a3c6,0x14784,0x14782,0x147d8,0x1a3ee,0x147cc, // 160
268
+ 0x147c6,0x147ee,0x1e850,0x1f42c,0x1e848,0x1f426,0x1e844,0x1e842,0x1d0d0,0x1e86c, // 170
269
+ 0x1d0c8,0x1e866,0x1d0c4,0x1d0c2,0x1a1d0,0x1d0ec,0x1a1c8,0x1d0e6,0x1a1c4,0x1a1c2, // 180
270
+ 0x143d0,0x1a1ec,0x143c8,0x1a1e6,0x143c4,0x143c2,0x143ec,0x143e6,0x1e828,0x1f416, // 190
271
+ 0x1e824,0x1e822,0x1d068,0x1e836,0x1d064,0x1d062,0x1a0e8,0x1d076,0x1a0e4,0x1a0e2, // 200
272
+ 0x141e8,0x1a0f6,0x141e4,0x141e2,0x1e814,0x1e812,0x1d034,0x1d032,0x1a074,0x1a072, // 210
273
+ 0x1e540,0x1f2b0,0x1f95c,0x1e520,0x1f298,0x1f94e,0x1e510,0x1f28c,0x1e508,0x1f286, // 220
274
+ 0x1e504,0x1e502,0x1cb40,0x1e5b0,0x1f2dc,0x1cb20,0x1e598,0x1f2ce,0x1cb10,0x1e58c, // 230
275
+ 0x1cb08,0x1e586,0x1cb04,0x1cb02,0x19740,0x1cbb0,0x1e5dc,0x19720,0x1cb98,0x1e5ce, // 240
276
+ 0x19710,0x1cb8c,0x19708,0x1cb86,0x19704,0x19702,0x12f40,0x197b0,0x1cbdc,0x12f20, // 250
277
+ 0x19798,0x1cbce,0x12f10,0x1978c,0x12f08,0x19786,0x12f04,0x12fb0,0x197dc,0x12f98, // 260
278
+ 0x197ce,0x12f8c,0x12f86,0x12fdc,0x12fce,0x1f6a0,0x1fb58,0x16bf0,0x1f690,0x1fb4c, // 270
279
+ 0x169f8,0x1f688,0x1fb46,0x168fc,0x1f684,0x1f682,0x1e4a0,0x1f258,0x1f92e,0x1eda0, // 280
280
+ 0x1e490,0x1fb6e,0x1ed90,0x1f6cc,0x1f246,0x1ed88,0x1e484,0x1ed84,0x1e482,0x1ed82, // 290
281
+ 0x1c9a0,0x1e4d8,0x1f26e,0x1dba0,0x1c990,0x1e4cc,0x1db90,0x1edcc,0x1e4c6,0x1db88, // 300
282
+ 0x1c984,0x1db84,0x1c982,0x1db82,0x193a0,0x1c9d8,0x1e4ee,0x1b7a0,0x19390,0x1c9cc, // 310
283
+ 0x1b790,0x1dbcc,0x1c9c6,0x1b788,0x19384,0x1b784,0x19382,0x1b782,0x127a0,0x193d8, // 320
284
+ 0x1c9ee,0x16fa0,0x12790,0x193cc,0x16f90,0x1b7cc,0x193c6,0x16f88,0x12784,0x16f84, // 330
285
+ 0x12782,0x127d8,0x193ee,0x16fd8,0x127cc,0x16fcc,0x127c6,0x16fc6,0x127ee,0x1f650, // 340
286
+ 0x1fb2c,0x165f8,0x1f648,0x1fb26,0x164fc,0x1f644,0x1647e,0x1f642,0x1e450,0x1f22c, // 350
287
+ 0x1ecd0,0x1e448,0x1f226,0x1ecc8,0x1f666,0x1ecc4,0x1e442,0x1ecc2,0x1c8d0,0x1e46c, // 360
288
+ 0x1d9d0,0x1c8c8,0x1e466,0x1d9c8,0x1ece6,0x1d9c4,0x1c8c2,0x1d9c2,0x191d0,0x1c8ec, // 370
289
+ 0x1b3d0,0x191c8,0x1c8e6,0x1b3c8,0x1d9e6,0x1b3c4,0x191c2,0x1b3c2,0x123d0,0x191ec, // 380
290
+ 0x167d0,0x123c8,0x191e6,0x167c8,0x1b3e6,0x167c4,0x123c2,0x167c2,0x123ec,0x167ec, // 390
291
+ 0x123e6,0x167e6,0x1f628,0x1fb16,0x162fc,0x1f624,0x1627e,0x1f622,0x1e428,0x1f216, // 400
292
+ 0x1ec68,0x1f636,0x1ec64,0x1e422,0x1ec62,0x1c868,0x1e436,0x1d8e8,0x1c864,0x1d8e4, // 410
293
+ 0x1c862,0x1d8e2,0x190e8,0x1c876,0x1b1e8,0x1d8f6,0x1b1e4,0x190e2,0x1b1e2,0x121e8, // 420
294
+ 0x190f6,0x163e8,0x121e4,0x163e4,0x121e2,0x163e2,0x121f6,0x163f6,0x1f614,0x1617e, // 430
295
+ 0x1f612,0x1e414,0x1ec34,0x1e412,0x1ec32,0x1c834,0x1d874,0x1c832,0x1d872,0x19074, // 440
296
+ 0x1b0f4,0x19072,0x1b0f2,0x120f4,0x161f4,0x120f2,0x161f2,0x1f60a,0x1e40a,0x1ec1a, // 450
297
+ 0x1c81a,0x1d83a,0x1903a,0x1b07a,0x1e2a0,0x1f158,0x1f8ae,0x1e290,0x1f14c,0x1e288, // 460
298
+ 0x1f146,0x1e284,0x1e282,0x1c5a0,0x1e2d8,0x1f16e,0x1c590,0x1e2cc,0x1c588,0x1e2c6, // 470
299
+ 0x1c584,0x1c582,0x18ba0,0x1c5d8,0x1e2ee,0x18b90,0x1c5cc,0x18b88,0x1c5c6,0x18b84, // 480
300
+ 0x18b82,0x117a0,0x18bd8,0x1c5ee,0x11790,0x18bcc,0x11788,0x18bc6,0x11784,0x11782, // 490
301
+ 0x117d8,0x18bee,0x117cc,0x117c6,0x117ee,0x1f350,0x1f9ac,0x135f8,0x1f348,0x1f9a6, // 500
302
+ 0x134fc,0x1f344,0x1347e,0x1f342,0x1e250,0x1f12c,0x1e6d0,0x1e248,0x1f126,0x1e6c8, // 510
303
+ 0x1f366,0x1e6c4,0x1e242,0x1e6c2,0x1c4d0,0x1e26c,0x1cdd0,0x1c4c8,0x1e266,0x1cdc8, // 520
304
+ 0x1e6e6,0x1cdc4,0x1c4c2,0x1cdc2,0x189d0,0x1c4ec,0x19bd0,0x189c8,0x1c4e6,0x19bc8, // 530
305
+ 0x1cde6,0x19bc4,0x189c2,0x19bc2,0x113d0,0x189ec,0x137d0,0x113c8,0x189e6,0x137c8, // 540
306
+ 0x19be6,0x137c4,0x113c2,0x137c2,0x113ec,0x137ec,0x113e6,0x137e6,0x1fba8,0x175f0, // 550
307
+ 0x1bafc,0x1fba4,0x174f8,0x1ba7e,0x1fba2,0x1747c,0x1743e,0x1f328,0x1f996,0x132fc, // 560
308
+ 0x1f768,0x1fbb6,0x176fc,0x1327e,0x1f764,0x1f322,0x1767e,0x1f762,0x1e228,0x1f116, // 570
309
+ 0x1e668,0x1e224,0x1eee8,0x1f776,0x1e222,0x1eee4,0x1e662,0x1eee2,0x1c468,0x1e236, // 580
310
+ 0x1cce8,0x1c464,0x1dde8,0x1cce4,0x1c462,0x1dde4,0x1cce2,0x1dde2,0x188e8,0x1c476, // 590
311
+ 0x199e8,0x188e4,0x1bbe8,0x199e4,0x188e2,0x1bbe4,0x199e2,0x1bbe2,0x111e8,0x188f6, // 600
312
+ 0x133e8,0x111e4,0x177e8,0x133e4,0x111e2,0x177e4,0x133e2,0x177e2,0x111f6,0x133f6, // 610
313
+ 0x1fb94,0x172f8,0x1b97e,0x1fb92,0x1727c,0x1723e,0x1f314,0x1317e,0x1f734,0x1f312, // 620
314
+ 0x1737e,0x1f732,0x1e214,0x1e634,0x1e212,0x1ee74,0x1e632,0x1ee72,0x1c434,0x1cc74, // 630
315
+ 0x1c432,0x1dcf4,0x1cc72,0x1dcf2,0x18874,0x198f4,0x18872,0x1b9f4,0x198f2,0x1b9f2, // 640
316
+ 0x110f4,0x131f4,0x110f2,0x173f4,0x131f2,0x173f2,0x1fb8a,0x1717c,0x1713e,0x1f30a, // 650
317
+ 0x1f71a,0x1e20a,0x1e61a,0x1ee3a,0x1c41a,0x1cc3a,0x1dc7a,0x1883a,0x1987a,0x1b8fa, // 660
318
+ 0x1107a,0x130fa,0x171fa,0x170be,0x1e150,0x1f0ac,0x1e148,0x1f0a6,0x1e144,0x1e142, // 670
319
+ 0x1c2d0,0x1e16c,0x1c2c8,0x1e166,0x1c2c4,0x1c2c2,0x185d0,0x1c2ec,0x185c8,0x1c2e6, // 680
320
+ 0x185c4,0x185c2,0x10bd0,0x185ec,0x10bc8,0x185e6,0x10bc4,0x10bc2,0x10bec,0x10be6, // 690
321
+ 0x1f1a8,0x1f8d6,0x11afc,0x1f1a4,0x11a7e,0x1f1a2,0x1e128,0x1f096,0x1e368,0x1e124, // 700
322
+ 0x1e364,0x1e122,0x1e362,0x1c268,0x1e136,0x1c6e8,0x1c264,0x1c6e4,0x1c262,0x1c6e2, // 710
323
+ 0x184e8,0x1c276,0x18de8,0x184e4,0x18de4,0x184e2,0x18de2,0x109e8,0x184f6,0x11be8, // 720
324
+ 0x109e4,0x11be4,0x109e2,0x11be2,0x109f6,0x11bf6,0x1f9d4,0x13af8,0x19d7e,0x1f9d2, // 730
325
+ 0x13a7c,0x13a3e,0x1f194,0x1197e,0x1f3b4,0x1f192,0x13b7e,0x1f3b2,0x1e114,0x1e334, // 740
326
+ 0x1e112,0x1e774,0x1e332,0x1e772,0x1c234,0x1c674,0x1c232,0x1cef4,0x1c672,0x1cef2, // 750
327
+ 0x18474,0x18cf4,0x18472,0x19df4,0x18cf2,0x19df2,0x108f4,0x119f4,0x108f2,0x13bf4, // 760
328
+ 0x119f2,0x13bf2,0x17af0,0x1bd7c,0x17a78,0x1bd3e,0x17a3c,0x17a1e,0x1f9ca,0x1397c, // 770
329
+ 0x1fbda,0x17b7c,0x1393e,0x17b3e,0x1f18a,0x1f39a,0x1f7ba,0x1e10a,0x1e31a,0x1e73a, // 780
330
+ 0x1ef7a,0x1c21a,0x1c63a,0x1ce7a,0x1defa,0x1843a,0x18c7a,0x19cfa,0x1bdfa,0x1087a, // 790
331
+ 0x118fa,0x139fa,0x17978,0x1bcbe,0x1793c,0x1791e,0x138be,0x179be,0x178bc,0x1789e, // 800
332
+ 0x1785e,0x1e0a8,0x1e0a4,0x1e0a2,0x1c168,0x1e0b6,0x1c164,0x1c162,0x182e8,0x1c176, // 810
333
+ 0x182e4,0x182e2,0x105e8,0x182f6,0x105e4,0x105e2,0x105f6,0x1f0d4,0x10d7e,0x1f0d2, // 820
334
+ 0x1e094,0x1e1b4,0x1e092,0x1e1b2,0x1c134,0x1c374,0x1c132,0x1c372,0x18274,0x186f4, // 830
335
+ 0x18272,0x186f2,0x104f4,0x10df4,0x104f2,0x10df2,0x1f8ea,0x11d7c,0x11d3e,0x1f0ca, // 840
336
+ 0x1f1da,0x1e08a,0x1e19a,0x1e3ba,0x1c11a,0x1c33a,0x1c77a,0x1823a,0x1867a,0x18efa, // 850
337
+ 0x1047a,0x10cfa,0x11dfa,0x13d78,0x19ebe,0x13d3c,0x13d1e,0x11cbe,0x13dbe,0x17d70, // 860
338
+ 0x1bebc,0x17d38,0x1be9e,0x17d1c,0x17d0e,0x13cbc,0x17dbc,0x13c9e,0x17d9e,0x17cb8, // 870
339
+ 0x1be5e,0x17c9c,0x17c8e,0x13c5e,0x17cde,0x17c5c,0x17c4e,0x17c2e,0x1c0b4,0x1c0b2, // 880
340
+ 0x18174,0x18172,0x102f4,0x102f2,0x1e0da,0x1c09a,0x1c1ba,0x1813a,0x1837a,0x1027a, // 890
341
+ 0x106fa,0x10ebe,0x11ebc,0x11e9e,0x13eb8,0x19f5e,0x13e9c,0x13e8e,0x11e5e,0x13ede, // 900
342
+ 0x17eb0,0x1bf5c,0x17e98,0x1bf4e,0x17e8c,0x17e86,0x13e5c,0x17edc,0x13e4e,0x17ece, // 910
343
+ 0x17e58,0x1bf2e,0x17e4c,0x17e46,0x13e2e,0x17e6e,0x17e2c,0x17e26,0x10f5e,0x11f5c, // 920
344
+ 0x11f4e,0x13f58,0x19fae,0x13f4c,0x13f46,0x11f2e,0x13f6e,0x13f2c,0x13f26), // 929
345
+ array( // cluster 6 -----------------------------------------------------------------------
346
+ 0x1abe0,0x1d5f8,0x153c0,0x1a9f0,0x1d4fc,0x151e0,0x1a8f8,0x1d47e,0x150f0,0x1a87c, // 10
347
+ 0x15078,0x1fad0,0x15be0,0x1adf8,0x1fac8,0x159f0,0x1acfc,0x1fac4,0x158f8,0x1ac7e, // 20
348
+ 0x1fac2,0x1587c,0x1f5d0,0x1faec,0x15df8,0x1f5c8,0x1fae6,0x15cfc,0x1f5c4,0x15c7e, // 30
349
+ 0x1f5c2,0x1ebd0,0x1f5ec,0x1ebc8,0x1f5e6,0x1ebc4,0x1ebc2,0x1d7d0,0x1ebec,0x1d7c8, // 40
350
+ 0x1ebe6,0x1d7c4,0x1d7c2,0x1afd0,0x1d7ec,0x1afc8,0x1d7e6,0x1afc4,0x14bc0,0x1a5f0, // 50
351
+ 0x1d2fc,0x149e0,0x1a4f8,0x1d27e,0x148f0,0x1a47c,0x14878,0x1a43e,0x1483c,0x1fa68, // 60
352
+ 0x14df0,0x1a6fc,0x1fa64,0x14cf8,0x1a67e,0x1fa62,0x14c7c,0x14c3e,0x1f4e8,0x1fa76, // 70
353
+ 0x14efc,0x1f4e4,0x14e7e,0x1f4e2,0x1e9e8,0x1f4f6,0x1e9e4,0x1e9e2,0x1d3e8,0x1e9f6, // 80
354
+ 0x1d3e4,0x1d3e2,0x1a7e8,0x1d3f6,0x1a7e4,0x1a7e2,0x145e0,0x1a2f8,0x1d17e,0x144f0, // 90
355
+ 0x1a27c,0x14478,0x1a23e,0x1443c,0x1441e,0x1fa34,0x146f8,0x1a37e,0x1fa32,0x1467c, // 100
356
+ 0x1463e,0x1f474,0x1477e,0x1f472,0x1e8f4,0x1e8f2,0x1d1f4,0x1d1f2,0x1a3f4,0x1a3f2, // 110
357
+ 0x142f0,0x1a17c,0x14278,0x1a13e,0x1423c,0x1421e,0x1fa1a,0x1437c,0x1433e,0x1f43a, // 120
358
+ 0x1e87a,0x1d0fa,0x14178,0x1a0be,0x1413c,0x1411e,0x141be,0x140bc,0x1409e,0x12bc0, // 130
359
+ 0x195f0,0x1cafc,0x129e0,0x194f8,0x1ca7e,0x128f0,0x1947c,0x12878,0x1943e,0x1283c, // 140
360
+ 0x1f968,0x12df0,0x196fc,0x1f964,0x12cf8,0x1967e,0x1f962,0x12c7c,0x12c3e,0x1f2e8, // 150
361
+ 0x1f976,0x12efc,0x1f2e4,0x12e7e,0x1f2e2,0x1e5e8,0x1f2f6,0x1e5e4,0x1e5e2,0x1cbe8, // 160
362
+ 0x1e5f6,0x1cbe4,0x1cbe2,0x197e8,0x1cbf6,0x197e4,0x197e2,0x1b5e0,0x1daf8,0x1ed7e, // 170
363
+ 0x169c0,0x1b4f0,0x1da7c,0x168e0,0x1b478,0x1da3e,0x16870,0x1b43c,0x16838,0x1b41e, // 180
364
+ 0x1681c,0x125e0,0x192f8,0x1c97e,0x16de0,0x124f0,0x1927c,0x16cf0,0x1b67c,0x1923e, // 190
365
+ 0x16c78,0x1243c,0x16c3c,0x1241e,0x16c1e,0x1f934,0x126f8,0x1937e,0x1fb74,0x1f932, // 200
366
+ 0x16ef8,0x1267c,0x1fb72,0x16e7c,0x1263e,0x16e3e,0x1f274,0x1277e,0x1f6f4,0x1f272, // 210
367
+ 0x16f7e,0x1f6f2,0x1e4f4,0x1edf4,0x1e4f2,0x1edf2,0x1c9f4,0x1dbf4,0x1c9f2,0x1dbf2, // 220
368
+ 0x193f4,0x193f2,0x165c0,0x1b2f0,0x1d97c,0x164e0,0x1b278,0x1d93e,0x16470,0x1b23c, // 230
369
+ 0x16438,0x1b21e,0x1641c,0x1640e,0x122f0,0x1917c,0x166f0,0x12278,0x1913e,0x16678, // 240
370
+ 0x1b33e,0x1663c,0x1221e,0x1661e,0x1f91a,0x1237c,0x1fb3a,0x1677c,0x1233e,0x1673e, // 250
371
+ 0x1f23a,0x1f67a,0x1e47a,0x1ecfa,0x1c8fa,0x1d9fa,0x191fa,0x162e0,0x1b178,0x1d8be, // 260
372
+ 0x16270,0x1b13c,0x16238,0x1b11e,0x1621c,0x1620e,0x12178,0x190be,0x16378,0x1213c, // 270
373
+ 0x1633c,0x1211e,0x1631e,0x121be,0x163be,0x16170,0x1b0bc,0x16138,0x1b09e,0x1611c, // 280
374
+ 0x1610e,0x120bc,0x161bc,0x1209e,0x1619e,0x160b8,0x1b05e,0x1609c,0x1608e,0x1205e, // 290
375
+ 0x160de,0x1605c,0x1604e,0x115e0,0x18af8,0x1c57e,0x114f0,0x18a7c,0x11478,0x18a3e, // 300
376
+ 0x1143c,0x1141e,0x1f8b4,0x116f8,0x18b7e,0x1f8b2,0x1167c,0x1163e,0x1f174,0x1177e, // 310
377
+ 0x1f172,0x1e2f4,0x1e2f2,0x1c5f4,0x1c5f2,0x18bf4,0x18bf2,0x135c0,0x19af0,0x1cd7c, // 320
378
+ 0x134e0,0x19a78,0x1cd3e,0x13470,0x19a3c,0x13438,0x19a1e,0x1341c,0x1340e,0x112f0, // 330
379
+ 0x1897c,0x136f0,0x11278,0x1893e,0x13678,0x19b3e,0x1363c,0x1121e,0x1361e,0x1f89a, // 340
380
+ 0x1137c,0x1f9ba,0x1377c,0x1133e,0x1373e,0x1f13a,0x1f37a,0x1e27a,0x1e6fa,0x1c4fa, // 350
381
+ 0x1cdfa,0x189fa,0x1bae0,0x1dd78,0x1eebe,0x174c0,0x1ba70,0x1dd3c,0x17460,0x1ba38, // 360
382
+ 0x1dd1e,0x17430,0x1ba1c,0x17418,0x1ba0e,0x1740c,0x132e0,0x19978,0x1ccbe,0x176e0, // 370
383
+ 0x13270,0x1993c,0x17670,0x1bb3c,0x1991e,0x17638,0x1321c,0x1761c,0x1320e,0x1760e, // 380
384
+ 0x11178,0x188be,0x13378,0x1113c,0x17778,0x1333c,0x1111e,0x1773c,0x1331e,0x1771e, // 390
385
+ 0x111be,0x133be,0x177be,0x172c0,0x1b970,0x1dcbc,0x17260,0x1b938,0x1dc9e,0x17230, // 400
386
+ 0x1b91c,0x17218,0x1b90e,0x1720c,0x17206,0x13170,0x198bc,0x17370,0x13138,0x1989e, // 410
387
+ 0x17338,0x1b99e,0x1731c,0x1310e,0x1730e,0x110bc,0x131bc,0x1109e,0x173bc,0x1319e, // 420
388
+ 0x1739e,0x17160,0x1b8b8,0x1dc5e,0x17130,0x1b89c,0x17118,0x1b88e,0x1710c,0x17106, // 430
389
+ 0x130b8,0x1985e,0x171b8,0x1309c,0x1719c,0x1308e,0x1718e,0x1105e,0x130de,0x171de, // 440
390
+ 0x170b0,0x1b85c,0x17098,0x1b84e,0x1708c,0x17086,0x1305c,0x170dc,0x1304e,0x170ce, // 450
391
+ 0x17058,0x1b82e,0x1704c,0x17046,0x1302e,0x1706e,0x1702c,0x17026,0x10af0,0x1857c, // 460
392
+ 0x10a78,0x1853e,0x10a3c,0x10a1e,0x10b7c,0x10b3e,0x1f0ba,0x1e17a,0x1c2fa,0x185fa, // 470
393
+ 0x11ae0,0x18d78,0x1c6be,0x11a70,0x18d3c,0x11a38,0x18d1e,0x11a1c,0x11a0e,0x10978, // 480
394
+ 0x184be,0x11b78,0x1093c,0x11b3c,0x1091e,0x11b1e,0x109be,0x11bbe,0x13ac0,0x19d70, // 490
395
+ 0x1cebc,0x13a60,0x19d38,0x1ce9e,0x13a30,0x19d1c,0x13a18,0x19d0e,0x13a0c,0x13a06, // 500
396
+ 0x11970,0x18cbc,0x13b70,0x11938,0x18c9e,0x13b38,0x1191c,0x13b1c,0x1190e,0x13b0e, // 510
397
+ 0x108bc,0x119bc,0x1089e,0x13bbc,0x1199e,0x13b9e,0x1bd60,0x1deb8,0x1ef5e,0x17a40, // 520
398
+ 0x1bd30,0x1de9c,0x17a20,0x1bd18,0x1de8e,0x17a10,0x1bd0c,0x17a08,0x1bd06,0x17a04, // 530
399
+ 0x13960,0x19cb8,0x1ce5e,0x17b60,0x13930,0x19c9c,0x17b30,0x1bd9c,0x19c8e,0x17b18, // 540
400
+ 0x1390c,0x17b0c,0x13906,0x17b06,0x118b8,0x18c5e,0x139b8,0x1189c,0x17bb8,0x1399c, // 550
401
+ 0x1188e,0x17b9c,0x1398e,0x17b8e,0x1085e,0x118de,0x139de,0x17bde,0x17940,0x1bcb0, // 560
402
+ 0x1de5c,0x17920,0x1bc98,0x1de4e,0x17910,0x1bc8c,0x17908,0x1bc86,0x17904,0x17902, // 570
403
+ 0x138b0,0x19c5c,0x179b0,0x13898,0x19c4e,0x17998,0x1bcce,0x1798c,0x13886,0x17986, // 580
404
+ 0x1185c,0x138dc,0x1184e,0x179dc,0x138ce,0x179ce,0x178a0,0x1bc58,0x1de2e,0x17890, // 590
405
+ 0x1bc4c,0x17888,0x1bc46,0x17884,0x17882,0x13858,0x19c2e,0x178d8,0x1384c,0x178cc, // 600
406
+ 0x13846,0x178c6,0x1182e,0x1386e,0x178ee,0x17850,0x1bc2c,0x17848,0x1bc26,0x17844, // 610
407
+ 0x17842,0x1382c,0x1786c,0x13826,0x17866,0x17828,0x1bc16,0x17824,0x17822,0x13816, // 620
408
+ 0x17836,0x10578,0x182be,0x1053c,0x1051e,0x105be,0x10d70,0x186bc,0x10d38,0x1869e, // 630
409
+ 0x10d1c,0x10d0e,0x104bc,0x10dbc,0x1049e,0x10d9e,0x11d60,0x18eb8,0x1c75e,0x11d30, // 640
410
+ 0x18e9c,0x11d18,0x18e8e,0x11d0c,0x11d06,0x10cb8,0x1865e,0x11db8,0x10c9c,0x11d9c, // 650
411
+ 0x10c8e,0x11d8e,0x1045e,0x10cde,0x11dde,0x13d40,0x19eb0,0x1cf5c,0x13d20,0x19e98, // 660
412
+ 0x1cf4e,0x13d10,0x19e8c,0x13d08,0x19e86,0x13d04,0x13d02,0x11cb0,0x18e5c,0x13db0, // 670
413
+ 0x11c98,0x18e4e,0x13d98,0x19ece,0x13d8c,0x11c86,0x13d86,0x10c5c,0x11cdc,0x10c4e, // 680
414
+ 0x13ddc,0x11cce,0x13dce,0x1bea0,0x1df58,0x1efae,0x1be90,0x1df4c,0x1be88,0x1df46, // 690
415
+ 0x1be84,0x1be82,0x13ca0,0x19e58,0x1cf2e,0x17da0,0x13c90,0x19e4c,0x17d90,0x1becc, // 700
416
+ 0x19e46,0x17d88,0x13c84,0x17d84,0x13c82,0x17d82,0x11c58,0x18e2e,0x13cd8,0x11c4c, // 710
417
+ 0x17dd8,0x13ccc,0x11c46,0x17dcc,0x13cc6,0x17dc6,0x10c2e,0x11c6e,0x13cee,0x17dee, // 720
418
+ 0x1be50,0x1df2c,0x1be48,0x1df26,0x1be44,0x1be42,0x13c50,0x19e2c,0x17cd0,0x13c48, // 730
419
+ 0x19e26,0x17cc8,0x1be66,0x17cc4,0x13c42,0x17cc2,0x11c2c,0x13c6c,0x11c26,0x17cec, // 740
420
+ 0x13c66,0x17ce6,0x1be28,0x1df16,0x1be24,0x1be22,0x13c28,0x19e16,0x17c68,0x13c24, // 750
421
+ 0x17c64,0x13c22,0x17c62,0x11c16,0x13c36,0x17c76,0x1be14,0x1be12,0x13c14,0x17c34, // 760
422
+ 0x13c12,0x17c32,0x102bc,0x1029e,0x106b8,0x1835e,0x1069c,0x1068e,0x1025e,0x106de, // 770
423
+ 0x10eb0,0x1875c,0x10e98,0x1874e,0x10e8c,0x10e86,0x1065c,0x10edc,0x1064e,0x10ece, // 780
424
+ 0x11ea0,0x18f58,0x1c7ae,0x11e90,0x18f4c,0x11e88,0x18f46,0x11e84,0x11e82,0x10e58, // 790
425
+ 0x1872e,0x11ed8,0x18f6e,0x11ecc,0x10e46,0x11ec6,0x1062e,0x10e6e,0x11eee,0x19f50, // 800
426
+ 0x1cfac,0x19f48,0x1cfa6,0x19f44,0x19f42,0x11e50,0x18f2c,0x13ed0,0x19f6c,0x18f26, // 810
427
+ 0x13ec8,0x11e44,0x13ec4,0x11e42,0x13ec2,0x10e2c,0x11e6c,0x10e26,0x13eec,0x11e66, // 820
428
+ 0x13ee6,0x1dfa8,0x1efd6,0x1dfa4,0x1dfa2,0x19f28,0x1cf96,0x1bf68,0x19f24,0x1bf64, // 830
429
+ 0x19f22,0x1bf62,0x11e28,0x18f16,0x13e68,0x11e24,0x17ee8,0x13e64,0x11e22,0x17ee4, // 840
430
+ 0x13e62,0x17ee2,0x10e16,0x11e36,0x13e76,0x17ef6,0x1df94,0x1df92,0x19f14,0x1bf34, // 850
431
+ 0x19f12,0x1bf32,0x11e14,0x13e34,0x11e12,0x17e74,0x13e32,0x17e72,0x1df8a,0x19f0a, // 860
432
+ 0x1bf1a,0x11e0a,0x13e1a,0x17e3a,0x1035c,0x1034e,0x10758,0x183ae,0x1074c,0x10746, // 870
433
+ 0x1032e,0x1076e,0x10f50,0x187ac,0x10f48,0x187a6,0x10f44,0x10f42,0x1072c,0x10f6c, // 880
434
+ 0x10726,0x10f66,0x18fa8,0x1c7d6,0x18fa4,0x18fa2,0x10f28,0x18796,0x11f68,0x18fb6, // 890
435
+ 0x11f64,0x10f22,0x11f62,0x10716,0x10f36,0x11f76,0x1cfd4,0x1cfd2,0x18f94,0x19fb4, // 900
436
+ 0x18f92,0x19fb2,0x10f14,0x11f34,0x10f12,0x13f74,0x11f32,0x13f72,0x1cfca,0x18f8a, // 910
437
+ 0x19f9a,0x10f0a,0x11f1a,0x13f3a,0x103ac,0x103a6,0x107a8,0x183d6,0x107a4,0x107a2, // 920
438
+ 0x10396,0x107b6,0x187d4,0x187d2,0x10794,0x10fb4,0x10792,0x10fb2,0x1c7ea) // 929
439
+ ); // end of $clusters array
440
+
441
+ /**
442
+ * Array of factors of the Reed-Solomon polynomial equations used for error correction; one sub array for each correction level (0-8).
443
+ * @protected
444
+ */
445
+ protected $rsfactors = array(
446
+ array( // ECL 0 (2 factors) -------------------------------------------------------------------------------
447
+ 0x01b,0x395), // 2
448
+ array( // ECL 1 (4 factors) -------------------------------------------------------------------------------
449
+ 0x20a,0x238,0x2d3,0x329), // 4
450
+ array( // ECL 2 (8 factors) -------------------------------------------------------------------------------
451
+ 0x0ed,0x134,0x1b4,0x11c,0x286,0x28d,0x1ac,0x17b), // 8
452
+ array( // ECL 3 (16 factors) ------------------------------------------------------------------------------
453
+ 0x112,0x232,0x0e8,0x2f3,0x257,0x20c,0x321,0x084,0x127,0x074,0x1ba,0x1ac,0x127,0x02a,0x0b0,0x041),// 16
454
+ array( // ECL 4 (32 factors) ------------------------------------------------------------------------------
455
+ 0x169,0x23f,0x39a,0x20d,0x0b0,0x24a,0x280,0x141,0x218,0x2e6,0x2a5,0x2e6,0x2af,0x11c,0x0c1,0x205, // 16
456
+ 0x111,0x1ee,0x107,0x093,0x251,0x320,0x23b,0x140,0x323,0x085,0x0e7,0x186,0x2ad,0x14a,0x03f,0x19a),// 32
457
+ array( // ECL 5 (64 factors) ------------------------------------------------------------------------------
458
+ 0x21b,0x1a6,0x006,0x05d,0x35e,0x303,0x1c5,0x06a,0x262,0x11f,0x06b,0x1f9,0x2dd,0x36d,0x17d,0x264, // 16
459
+ 0x2d3,0x1dc,0x1ce,0x0ac,0x1ae,0x261,0x35a,0x336,0x21f,0x178,0x1ff,0x190,0x2a0,0x2fa,0x11b,0x0b8, // 32
460
+ 0x1b8,0x023,0x207,0x01f,0x1cc,0x252,0x0e1,0x217,0x205,0x160,0x25d,0x09e,0x28b,0x0c9,0x1e8,0x1f6, // 48
461
+ 0x288,0x2dd,0x2cd,0x053,0x194,0x061,0x118,0x303,0x348,0x275,0x004,0x17d,0x34b,0x26f,0x108,0x21f),// 64
462
+ array( // ECL 6 (128 factors) -----------------------------------------------------------------------------
463
+ 0x209,0x136,0x360,0x223,0x35a,0x244,0x128,0x17b,0x035,0x30b,0x381,0x1bc,0x190,0x39d,0x2ed,0x19f, // 16
464
+ 0x336,0x05d,0x0d9,0x0d0,0x3a0,0x0f4,0x247,0x26c,0x0f6,0x094,0x1bf,0x277,0x124,0x38c,0x1ea,0x2c0, // 32
465
+ 0x204,0x102,0x1c9,0x38b,0x252,0x2d3,0x2a2,0x124,0x110,0x060,0x2ac,0x1b0,0x2ae,0x25e,0x35c,0x239, // 48
466
+ 0x0c1,0x0db,0x081,0x0ba,0x0ec,0x11f,0x0c0,0x307,0x116,0x0ad,0x028,0x17b,0x2c8,0x1cf,0x286,0x308, // 64
467
+ 0x0ab,0x1eb,0x129,0x2fb,0x09c,0x2dc,0x05f,0x10e,0x1bf,0x05a,0x1fb,0x030,0x0e4,0x335,0x328,0x382, // 80
468
+ 0x310,0x297,0x273,0x17a,0x17e,0x106,0x17c,0x25a,0x2f2,0x150,0x059,0x266,0x057,0x1b0,0x29e,0x268, // 96
469
+ 0x09d,0x176,0x0f2,0x2d6,0x258,0x10d,0x177,0x382,0x34d,0x1c6,0x162,0x082,0x32e,0x24b,0x324,0x022, // 112
470
+ 0x0d3,0x14a,0x21b,0x129,0x33b,0x361,0x025,0x205,0x342,0x13b,0x226,0x056,0x321,0x004,0x06c,0x21b),// 128
471
+ array( // ECL 7 (256 factors) -----------------------------------------------------------------------------
472
+ 0x20c,0x37e,0x04b,0x2fe,0x372,0x359,0x04a,0x0cc,0x052,0x24a,0x2c4,0x0fa,0x389,0x312,0x08a,0x2d0, // 16
473
+ 0x35a,0x0c2,0x137,0x391,0x113,0x0be,0x177,0x352,0x1b6,0x2dd,0x0c2,0x118,0x0c9,0x118,0x33c,0x2f5, // 32
474
+ 0x2c6,0x32e,0x397,0x059,0x044,0x239,0x00b,0x0cc,0x31c,0x25d,0x21c,0x391,0x321,0x2bc,0x31f,0x089, // 48
475
+ 0x1b7,0x1a2,0x250,0x29c,0x161,0x35b,0x172,0x2b6,0x145,0x0f0,0x0d8,0x101,0x11c,0x225,0x0d1,0x374, // 64
476
+ 0x13b,0x046,0x149,0x319,0x1ea,0x112,0x36d,0x0a2,0x2ed,0x32c,0x2ac,0x1cd,0x14e,0x178,0x351,0x209, // 80
477
+ 0x133,0x123,0x323,0x2c8,0x013,0x166,0x18f,0x38c,0x067,0x1ff,0x033,0x008,0x205,0x0e1,0x121,0x1d6, // 96
478
+ 0x27d,0x2db,0x042,0x0ff,0x395,0x10d,0x1cf,0x33e,0x2da,0x1b1,0x350,0x249,0x088,0x21a,0x38a,0x05a, // 112
479
+ 0x002,0x122,0x2e7,0x0c7,0x28f,0x387,0x149,0x031,0x322,0x244,0x163,0x24c,0x0bc,0x1ce,0x00a,0x086, // 128
480
+ 0x274,0x140,0x1df,0x082,0x2e3,0x047,0x107,0x13e,0x176,0x259,0x0c0,0x25d,0x08e,0x2a1,0x2af,0x0ea, // 144
481
+ 0x2d2,0x180,0x0b1,0x2f0,0x25f,0x280,0x1c7,0x0c1,0x2b1,0x2c3,0x325,0x281,0x030,0x03c,0x2dc,0x26d, // 160
482
+ 0x37f,0x220,0x105,0x354,0x28f,0x135,0x2b9,0x2f3,0x2f4,0x03c,0x0e7,0x305,0x1b2,0x1a5,0x2d6,0x210, // 176
483
+ 0x1f7,0x076,0x031,0x31b,0x020,0x090,0x1f4,0x0ee,0x344,0x18a,0x118,0x236,0x13f,0x009,0x287,0x226, // 192
484
+ 0x049,0x392,0x156,0x07e,0x020,0x2a9,0x14b,0x318,0x26c,0x03c,0x261,0x1b9,0x0b4,0x317,0x37d,0x2f2, // 208
485
+ 0x25d,0x17f,0x0e4,0x2ed,0x2f8,0x0d5,0x036,0x129,0x086,0x036,0x342,0x12b,0x39a,0x0bf,0x38e,0x214, // 224
486
+ 0x261,0x33d,0x0bd,0x014,0x0a7,0x01d,0x368,0x1c1,0x053,0x192,0x029,0x290,0x1f9,0x243,0x1e1,0x0ad, // 240
487
+ 0x194,0x0fb,0x2b0,0x05f,0x1f1,0x22b,0x282,0x21f,0x133,0x09f,0x39c,0x22e,0x288,0x037,0x1f1,0x00a),// 256
488
+ array( // ECL 8 (512 factors) -----------------------------------------------------------------------------
489
+ 0x160,0x04d,0x175,0x1f8,0x023,0x257,0x1ac,0x0cf,0x199,0x23e,0x076,0x1f2,0x11d,0x17c,0x15e,0x1ec, // 16
490
+ 0x0c5,0x109,0x398,0x09b,0x392,0x12b,0x0e5,0x283,0x126,0x367,0x132,0x058,0x057,0x0c1,0x160,0x30d, // 32
491
+ 0x34e,0x04b,0x147,0x208,0x1b3,0x21f,0x0cb,0x29a,0x0f9,0x15a,0x30d,0x26d,0x280,0x10c,0x31a,0x216, // 48
492
+ 0x21b,0x30d,0x198,0x186,0x284,0x066,0x1dc,0x1f3,0x122,0x278,0x221,0x025,0x35a,0x394,0x228,0x029, // 64
493
+ 0x21e,0x121,0x07a,0x110,0x17f,0x320,0x1e5,0x062,0x2f0,0x1d8,0x2f9,0x06b,0x310,0x35c,0x292,0x2e5, // 80
494
+ 0x122,0x0cc,0x2a9,0x197,0x357,0x055,0x063,0x03e,0x1e2,0x0b4,0x014,0x129,0x1c3,0x251,0x391,0x08e, // 96
495
+ 0x328,0x2ac,0x11f,0x218,0x231,0x04c,0x28d,0x383,0x2d9,0x237,0x2e8,0x186,0x201,0x0c0,0x204,0x102, // 112
496
+ 0x0f0,0x206,0x31a,0x18b,0x300,0x350,0x033,0x262,0x180,0x0a8,0x0be,0x33a,0x148,0x254,0x312,0x12f, // 128
497
+ 0x23a,0x17d,0x19f,0x281,0x09c,0x0ed,0x097,0x1ad,0x213,0x0cf,0x2a4,0x2c6,0x059,0x0a8,0x130,0x192, // 144
498
+ 0x028,0x2c4,0x23f,0x0a2,0x360,0x0e5,0x041,0x35d,0x349,0x200,0x0a4,0x1dd,0x0dd,0x05c,0x166,0x311, // 160
499
+ 0x120,0x165,0x352,0x344,0x33b,0x2e0,0x2c3,0x05e,0x008,0x1ee,0x072,0x209,0x002,0x1f3,0x353,0x21f, // 176
500
+ 0x098,0x2d9,0x303,0x05f,0x0f8,0x169,0x242,0x143,0x358,0x31d,0x121,0x033,0x2ac,0x1d2,0x215,0x334, // 192
501
+ 0x29d,0x02d,0x386,0x1c4,0x0a7,0x156,0x0f4,0x0ad,0x023,0x1cf,0x28b,0x033,0x2bb,0x24f,0x1c4,0x242, // 208
502
+ 0x025,0x07c,0x12a,0x14c,0x228,0x02b,0x1ab,0x077,0x296,0x309,0x1db,0x352,0x2fc,0x16c,0x242,0x38f, // 224
503
+ 0x11b,0x2c7,0x1d8,0x1a4,0x0f5,0x120,0x252,0x18a,0x1ff,0x147,0x24d,0x309,0x2bb,0x2b0,0x02b,0x198, // 240
504
+ 0x34a,0x17f,0x2d1,0x209,0x230,0x284,0x2ca,0x22f,0x03e,0x091,0x369,0x297,0x2c9,0x09f,0x2a0,0x2d9, // 256
505
+ 0x270,0x03b,0x0c1,0x1a1,0x09e,0x0d1,0x233,0x234,0x157,0x2b5,0x06d,0x260,0x233,0x16d,0x0b5,0x304, // 272
506
+ 0x2a5,0x136,0x0f8,0x161,0x2c4,0x19a,0x243,0x366,0x269,0x349,0x278,0x35c,0x121,0x218,0x023,0x309, // 288
507
+ 0x26a,0x24a,0x1a8,0x341,0x04d,0x255,0x15a,0x10d,0x2f5,0x278,0x2b7,0x2ef,0x14b,0x0f7,0x0b8,0x02d, // 304
508
+ 0x313,0x2a8,0x012,0x042,0x197,0x171,0x036,0x1ec,0x0e4,0x265,0x33e,0x39a,0x1b5,0x207,0x284,0x389, // 320
509
+ 0x315,0x1a4,0x131,0x1b9,0x0cf,0x12c,0x37c,0x33b,0x08d,0x219,0x17d,0x296,0x201,0x038,0x0fc,0x155, // 336
510
+ 0x0f2,0x31d,0x346,0x345,0x2d0,0x0e0,0x133,0x277,0x03d,0x057,0x230,0x136,0x2f4,0x299,0x18d,0x328, // 352
511
+ 0x353,0x135,0x1d9,0x31b,0x17a,0x01f,0x287,0x393,0x1cb,0x326,0x24e,0x2db,0x1a9,0x0d8,0x224,0x0f9, // 368
512
+ 0x141,0x371,0x2bb,0x217,0x2a1,0x30e,0x0d2,0x32f,0x389,0x12f,0x34b,0x39a,0x119,0x049,0x1d5,0x317, // 384
513
+ 0x294,0x0a2,0x1f2,0x134,0x09b,0x1a6,0x38b,0x331,0x0bb,0x03e,0x010,0x1a9,0x217,0x150,0x11e,0x1b5, // 400
514
+ 0x177,0x111,0x262,0x128,0x0b7,0x39b,0x074,0x29b,0x2ef,0x161,0x03e,0x16e,0x2b3,0x17b,0x2af,0x34a, // 416
515
+ 0x025,0x165,0x2d0,0x2e6,0x14a,0x005,0x027,0x39b,0x137,0x1a8,0x0f2,0x2ed,0x141,0x036,0x29d,0x13c, // 432
516
+ 0x156,0x12b,0x216,0x069,0x29b,0x1e8,0x280,0x2a0,0x240,0x21c,0x13c,0x1e6,0x2d1,0x262,0x02e,0x290, // 448
517
+ 0x1bf,0x0ab,0x268,0x1d0,0x0be,0x213,0x129,0x141,0x2fa,0x2f0,0x215,0x0af,0x086,0x00e,0x17d,0x1b1, // 464
518
+ 0x2cd,0x02d,0x06f,0x014,0x254,0x11c,0x2e0,0x08a,0x286,0x19b,0x36d,0x29d,0x08d,0x397,0x02d,0x30c, // 480
519
+ 0x197,0x0a4,0x14c,0x383,0x0a5,0x2d6,0x258,0x145,0x1f2,0x28f,0x165,0x2f0,0x300,0x0df,0x351,0x287, // 496
520
+ 0x03f,0x136,0x35f,0x0fb,0x16e,0x130,0x11a,0x2e2,0x2a3,0x19a,0x185,0x0f4,0x01f,0x079,0x12f,0x107) // 512
521
+ );
522
+
523
+ /**
524
+ * This is the class constructor.
525
+ * Creates a PDF417 object
526
+ * @param $code (string) code to represent using PDF417
527
+ * @param $ecl (int) error correction level (0-8); default -1 = automatic correction level
528
+ * @param $aspectratio (float) the width to height of the symbol (excluding quiet zones)
529
+ * @param $macro (array) information for macro block
530
+ * @public
531
+ */
532
+ public function __construct($code, $ecl=-1, $aspectratio=2, $macro=array()) {
533
+ $barcode_array = array();
534
+ if ((is_null($code)) OR ($code == '\0') OR ($code == '')) {
535
+ return false;
536
+ }
537
+ // get the input sequence array
538
+ $sequence = $this->getInputSequences($code);
539
+ $codewords = array(); // array of code-words
540
+ foreach($sequence as $seq) {
541
+ $cw = $this->getCompaction($seq[0], $seq[1], true);
542
+ $codewords = array_merge($codewords, $cw);
543
+ }
544
+ if ($codewords[0] == 900) {
545
+ // Text Alpha is the default mode, so remove the first code
546
+ array_shift($codewords);
547
+ }
548
+ // count number of codewords
549
+ $numcw = count($codewords);
550
+ if ($numcw > 925) {
551
+ // reached maximum data codeword capacity
552
+ return false;
553
+ }
554
+ // build macro control block codewords
555
+ if (!empty($macro)) {
556
+ $macrocw = array();
557
+ // beginning of macro control block
558
+ $macrocw[] = 928;
559
+ // segment index
560
+ $cw = $this->getCompaction(902, sprintf('%05d', $macro['segment_index']), false);
561
+ $macrocw = array_merge($macrocw, $cw);
562
+ // file ID
563
+ $cw = $this->getCompaction(900, $macro['file_id'], false);
564
+ $macrocw = array_merge($macrocw, $cw);
565
+ // optional fields
566
+ $optmodes = array(900,902,902,900,900,902,902);
567
+ $optsize = array(-1,2,4,-1,-1,-1,2);
568
+ foreach ($optmodes as $k => $omode) {
569
+ if (isset($macro['option_'.$k])) {
570
+ $macrocw[] = 923;
571
+ $macrocw[] = $k;
572
+ if ($optsize[$k] == 2) {
573
+ $macro['option_'.$k] = sprintf('%05d', $macro['option_'.$k]);
574
+ } elseif ($optsize[$k] == 4) {
575
+ $macro['option_'.$k] = sprintf('%010d', $macro['option_'.$k]);
576
+ }
577
+ $cw = $this->getCompaction($omode, $macro['option_'.$k], false);
578
+ $macrocw = array_merge($macrocw, $cw);
579
+ }
580
+ }
581
+ if ($macro['segment_index'] == ($macro['segment_total'] - 1)) {
582
+ // end of control block
583
+ $macrocw[] = 922;
584
+ }
585
+ // update total codewords
586
+ $numcw += count($macrocw);
587
+ }
588
+ // set error correction level
589
+ $ecl = $this->getErrorCorrectionLevel($ecl, $numcw);
590
+ // number of codewords for error correction
591
+ $errsize = (2 << $ecl);
592
+ // calculate number of columns (number of codewords per row) and rows
593
+ $nce = ($numcw + $errsize + 1);
594
+ $cols = round((sqrt(4761 + (68 * $aspectratio * ROWHEIGHT * $nce)) - 69) / 34);
595
+ // adjust cols
596
+ if ($cols < 1) {
597
+ $cols = 1;
598
+ } elseif ($cols > 30) {
599
+ $cols = 30;
600
+ }
601
+ $rows = ceil($nce / $cols);
602
+ $size = ($cols * $rows);
603
+ // adjust rows
604
+ if (($rows < 3) OR ($rows > 90)) {
605
+ if ($rows < 3) {
606
+ $rows = 3;
607
+ } elseif ($rows > 90) {
608
+ $rows = 90;
609
+ }
610
+ $cols = ceil($size / $rows);
611
+ $size = ($cols * $rows);
612
+ }
613
+ if ($size > 928) {
614
+ // set dimensions to get maximum capacity
615
+ if (abs($aspectratio - (17 * 29 / 32)) < abs($aspectratio - (17 * 16 / 58))) {
616
+ $cols = 29;
617
+ $rows = 32;
618
+ } else {
619
+ $cols = 16;
620
+ $rows = 58;
621
+ }
622
+ $size = 928;
623
+ }
624
+ // calculate padding
625
+ $pad = ($size - $nce);
626
+ if ($pad > 0) {
627
+ if (($size - $rows) == $nce) {
628
+ --$rows;
629
+ $size -= $rows;
630
+ } else {
631
+ // add pading
632
+ $codewords = array_merge($codewords, array_fill(0, $pad, 900));
633
+ }
634
+ }
635
+ if (!empty($macro)) {
636
+ // add macro section
637
+ $codewords = array_merge($codewords, $macrocw);
638
+ }
639
+ // Symbol Length Descriptor (number of data codewords including Symbol Length Descriptor and pad codewords)
640
+ $sld = $size - $errsize;
641
+ // add symbol length description
642
+ array_unshift($codewords, $sld);
643
+ // calculate error correction
644
+ $ecw = $this->getErrorCorrection($codewords, $ecl);
645
+ // add error correction codewords
646
+ $codewords = array_merge($codewords, $ecw);
647
+ // add horizontal quiet zones to start and stop patterns
648
+ $pstart = str_repeat('0', QUIETH).$this->start_pattern;
649
+ $pstop = $this->stop_pattern.str_repeat('0', QUIETH);
650
+ $barcode_array['num_rows'] = ($rows * ROWHEIGHT) + (2 * QUIETV);
651
+ $barcode_array['num_cols'] = (($cols + 2) * 17) + 35 + (2 * QUIETH);
652
+ $barcode_array['bcode'] = array();
653
+ // build rows for vertical quiet zone
654
+ if (QUIETV > 0) {
655
+ $empty_row = array_fill(0, $barcode_array['num_cols'], 0);
656
+ for ($i = 0; $i < QUIETV; ++$i) {
657
+ // add vertical quiet rows
658
+ $barcode_array['bcode'][] = $empty_row;
659
+ }
660
+ }
661
+ $k = 0; // codeword index
662
+ $cid = 0; // initial cluster
663
+ // for each row
664
+ for ($r = 0; $r < $rows; ++$r) {
665
+ // row start code
666
+ $row = $pstart;
667
+ switch ($cid) {
668
+ case 0: {
669
+ $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3));
670
+ break;
671
+ }
672
+ case 1: {
673
+ $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3));
674
+ break;
675
+ }
676
+ case 2: {
677
+ $L = ((30 * intval($r / 3)) + ($cols - 1));
678
+ break;
679
+ }
680
+ }
681
+ // left row indicator
682
+ $row .= sprintf('%17b', $this->clusters[$cid][$L]);
683
+ // for each column
684
+ for ($c = 0; $c < $cols; ++$c) {
685
+ $row .= sprintf('%17b', $this->clusters[$cid][$codewords[$k]]);
686
+ ++$k;
687
+ }
688
+ switch ($cid) {
689
+ case 0: {
690
+ $L = ((30 * intval($r / 3)) + ($cols - 1));
691
+ break;
692
+ }
693
+ case 1: {
694
+ $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3));
695
+ break;
696
+ }
697
+ case 2: {
698
+ $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3));
699
+ break;
700
+ }
701
+ }
702
+ // right row indicator
703
+ $row .= sprintf('%17b', $this->clusters[$cid][$L]);
704
+ // row stop code
705
+ $row .= $pstop;
706
+ // convert the string to array
707
+ $arow = preg_split('//', $row, -1, PREG_SPLIT_NO_EMPTY);
708
+ // duplicate row to get the desired height
709
+ for ($h = 0; $h < ROWHEIGHT; ++$h) {
710
+ $barcode_array['bcode'][] = $arow;
711
+ }
712
+ ++$cid;
713
+ if ($cid > 2) {
714
+ $cid = 0;
715
+ }
716
+ }
717
+ if (QUIETV > 0) {
718
+ for ($i = 0; $i < QUIETV; ++$i) {
719
+ // add vertical quiet rows
720
+ $barcode_array['bcode'][] = $empty_row;
721
+ }
722
+ }
723
+ $this->barcode_array = $barcode_array;
724
+ }
725
+
726
+ /**
727
+ * Returns a barcode array which is readable by TCPDF
728
+ * @return array barcode array readable by TCPDF;
729
+ * @public
730
+ */
731
+ public function getBarcodeArray() {
732
+ return $this->barcode_array;
733
+ }
734
+
735
+ /**
736
+ * Returns the error correction level (0-8) to be used
737
+ * @param $ecl (int) error correction level
738
+ * @param $numcw (int) number of data codewords
739
+ * @return int error correction level
740
+ * @protected
741
+ */
742
+ protected function getErrorCorrectionLevel($ecl, $numcw) {
743
+ // get maximum correction level
744
+ $maxecl = 8; // starting error level
745
+ $maxerrsize = (928 - $numcw); // available codewords for error
746
+ while ($maxecl > 0) {
747
+
748
+ /*
749
+ * Booster modification (Algoritmika)
750
+ *
751
+ * @version 3.4.0
752
+ * @since 3.4.0
753
+ */
754
+ if ( version_compare( PHP_VERSION, '7.0.0' ) >= 0 && $ecl < 0 ) {
755
+ $ecl = 0;
756
+ }
757
+
758
+ $errsize = (2 << $ecl);
759
+ if ($maxerrsize >= $errsize) {
760
+ break;
761
+ }
762
+ --$maxecl;
763
+ }
764
+ // check for automatic levels
765
+ if (($ecl < 0) OR ($ecl > 8)) {
766
+ if ($numcw < 41) {
767
+ $ecl = 2;
768
+ } elseif ($numcw < 161) {
769
+ $ecl = 3;
770
+ } elseif ($numcw < 321) {
771
+ $ecl = 4;
772
+ } elseif ($numcw < 864) {
773
+ $ecl = 5;
774
+ } else {
775
+ $ecl = $maxecl;
776
+ }
777
+ }
778
+ if ($ecl > $maxecl) {
779
+ $ecl = $maxecl;
780
+ }
781
+ return $ecl;
782
+ }
783
+
784
+ /**
785
+ * Returns the error correction codewords
786
+ * @param $cw (array) array of codewords including Symbol Length Descriptor and pad
787
+ * @param $ecl (int) error correction level 0-8
788
+ * @return array of error correction codewords
789
+ * @protected
790
+ */
791
+ protected function getErrorCorrection($cw, $ecl) {
792
+ // get error correction coefficients
793
+ $ecc = $this->rsfactors[$ecl];
794
+ // number of error correction factors
795
+ $eclsize = (2 << $ecl);
796
+ // maximum index for $rsfactors[$ecl]
797
+ $eclmaxid = ($eclsize - 1);
798
+ // initialize array of error correction codewords
799
+ $ecw = array_fill(0, $eclsize, 0);
800
+ // for each data codeword
801
+ foreach($cw as $k => $d) {
802
+ $t1 = ($d + $ecw[$eclmaxid]) % 929;
803
+ for ($j = $eclmaxid; $j > 0; --$j) {
804
+ $t2 = ($t1 * $ecc[$j]) % 929;
805
+ $t3 = 929 - $t2;
806
+ $ecw[$j] = ($ecw[($j - 1)] + $t3) % 929;
807
+ }
808
+ $t2 = ($t1 * $ecc[0]) % 929;
809
+ $t3 = 929 - $t2;
810
+ $ecw[0] = $t3 % 929;
811
+ }
812
+ foreach($ecw as $j => $e) {
813
+ if ($e != 0) {
814
+ $ecw[$j] = 929 - $e;
815
+ }
816
+ }
817
+ $ecw = array_reverse($ecw);
818
+ return $ecw;
819
+ }
820
+
821
+ /**
822
+ * Create array of sequences from input
823
+ * @param $code (string) code
824
+ * @return bidimensional array containing characters and classification
825
+ * @protected
826
+ */
827
+ protected function getInputSequences($code) {
828
+ $sequence_array = array(); // array to be returned
829
+ $numseq = array();
830
+ // get numeric sequences
831
+ preg_match_all('/([0-9]{13,44})/', $code, $numseq, PREG_OFFSET_CAPTURE);
832
+ $numseq[1][] = array('', strlen($code));
833
+ $offset = 0;
834
+ foreach($numseq[1] as $seq) {
835
+ $seqlen = strlen($seq[0]);
836
+ if ($seq[1] > 0) {
837
+ // extract text sequence before the number sequence
838
+ $prevseq = substr($code, $offset, ($seq[1] - $offset));
839
+ $textseq = array();
840
+ // get text sequences
841
+ preg_match_all('/([\x09\x0a\x0d\x20-\x7e]{5,})/', $prevseq, $textseq, PREG_OFFSET_CAPTURE);
842
+ $textseq[1][] = array('', strlen($prevseq));
843
+ $txtoffset = 0;
844
+ foreach($textseq[1] as $txtseq) {
845
+ $txtseqlen = strlen($txtseq[0]);
846
+ if ($txtseq[1] > 0) {
847
+ // extract byte sequence before the text sequence
848
+ $prevtxtseq = substr($prevseq, $txtoffset, ($txtseq[1] - $txtoffset));
849
+ if (strlen($prevtxtseq) > 0) {
850
+ // add BYTE sequence
851
+ if ((strlen($prevtxtseq) == 1) AND ((count($sequence_array) > 0) AND ($sequence_array[(count($sequence_array) - 1)][0] == 900))) {
852
+ $sequence_array[] = array(913, $prevtxtseq);
853
+ } elseif ((strlen($prevtxtseq) % 6) == 0) {
854
+ $sequence_array[] = array(924, $prevtxtseq);
855
+ } else {
856
+ $sequence_array[] = array(901, $prevtxtseq);
857
+ }
858
+ }
859
+ }
860
+ if ($txtseqlen > 0) {
861
+ // add numeric sequence
862
+ $sequence_array[] = array(900, $txtseq[0]);
863
+ }
864
+ $txtoffset = $txtseq[1] + $txtseqlen;
865
+ }
866
+ }
867
+ if ($seqlen > 0) {
868
+ // add numeric sequence
869
+ $sequence_array[] = array(902, $seq[0]);
870
+ }
871
+ $offset = $seq[1] + $seqlen;
872
+ }
873
+ return $sequence_array;
874
+ }
875
+
876
+ /**
877
+ * Compact data by mode.
878
+ * @param $mode (int) compaction mode number
879
+ * @param $code (string) data to compact
880
+ * @param $addmode (boolean) if true add the mode codeword at first position
881
+ * @return array of codewords
882
+ * @protected
883
+ */
884
+ protected function getCompaction($mode, $code, $addmode=true) {
885
+ $cw = array(); // array of codewords to return
886
+ switch($mode) {
887
+ case 900: { // Text Compaction mode latch
888
+ $submode = 0; // default Alpha sub-mode
889
+ $txtarr = array(); // array of characters and sub-mode switching characters
890
+ $codelen = strlen($code);
891
+ for ($i = 0; $i < $codelen; ++$i) {
892
+ $chval = ord($code{$i});
893
+ if (($k = array_search($chval, $this->textsubmodes[$submode])) !== false) {
894
+ // we are on the same sub-mode
895
+ $txtarr[] = $k;
896
+ } else {
897
+ // the sub-mode is changed
898
+ for ($s = 0; $s < 4; ++$s) {
899
+ // search new sub-mode
900
+ if (($s != $submode) AND (($k = array_search($chval, $this->textsubmodes[$s])) !== false)) {
901
+ // $s is the new submode
902
+ if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code{($i + 1)}), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) {
903
+ // shift (temporary change only for this char)
904
+ if ($s == 3) {
905
+ // shift to puntuaction
906
+ $txtarr[] = 29;
907
+ } else {
908
+ // shift from lower to alpha
909
+ $txtarr[] = 27;
910
+ }
911
+ } else {
912
+ // latch
913
+ $txtarr = array_merge($txtarr, $this->textlatch[''.$submode.$s]);
914
+ // set new submode
915
+ $submode = $s;
916
+ }
917
+ // add characted code to array
918
+ $txtarr[] = $k;
919
+ break;
920
+ }
921
+ }
922
+ }
923
+ }
924
+ $txtarrlen = count($txtarr);
925
+ if (($txtarrlen % 2) != 0) {
926
+ // add padding
927
+ $txtarr[] = 29;
928
+ ++$txtarrlen;
929
+ }
930
+ // calculate codewords
931
+ for ($i = 0; $i < $txtarrlen; $i += 2) {
932
+ $cw[] = (30 * $txtarr[$i]) + $txtarr[($i + 1)];
933
+ }
934
+ break;
935
+ }
936
+ case 901:
937
+ case 924: { // Byte Compaction mode latch
938
+ while (($codelen = strlen($code)) > 0) {
939
+ if ($codelen > 6) {
940
+ $rest = substr($code, 6);
941
+ $code = substr($code, 0, 6);
942
+ $sublen = 6;
943
+ } else {
944
+ $rest = '';
945
+ $sublen = strlen($code);
946
+ }
947
+ if ($sublen == 6) {
948
+ $t = bcmul(''.ord($code[0]), '1099511627776');
949
+ $t = bcadd($t, bcmul(''.ord($code[1]), '4294967296'));
950
+ $t = bcadd($t, bcmul(''.ord($code[2]), '16777216'));
951
+ $t = bcadd($t, bcmul(''.ord($code[3]), '65536'));
952
+ $t = bcadd($t, bcmul(''.ord($code[4]), '256'));
953
+ $t = bcadd($t, ''.ord($code[5]));
954
+ // tmp array for the 6 bytes block
955
+ $cw6 = array();
956
+ do {
957
+ $d = bcmod($t, '900');
958
+ $t = bcdiv($t, '900');
959
+ // prepend the value to the beginning of the array
960
+ array_unshift($cw6, $d);
961
+ } while ($t != '0');
962
+ // append the result array at the end
963
+ $cw = array_merge($cw, $cw6);
964
+ } else {
965
+ for ($i = 0; $i < $sublen; ++$i) {
966
+ $cw[] = ord($code{$i});
967
+ }
968
+ }
969
+ $code = $rest;
970
+ }
971
+ break;
972
+ }
973
+ case 902: { // Numeric Compaction mode latch
974
+ while (($codelen = strlen($code)) > 0) {
975
+ if ($codelen > 44) {
976
+ $rest = substr($code, 44);
977
+ $code = substr($code, 0, 44);
978
+ } else {
979
+ $rest = '';
980
+ }
981
+ $t = '1'.$code;
982
+ do {
983
+ $d = bcmod($t, '900');
984
+ $t = bcdiv($t, '900');
985
+ array_unshift($cw, $d);
986
+ } while ($t != '0');
987
+ $code = $rest;
988
+ }
989
+ break;
990
+ }
991
+ case 913: { // Byte Compaction mode shift
992
+ $cw[] = ord($code);
993
+ break;
994
+ }
995
+ }
996
+ if ($addmode) {
997
+ // add the compaction mode codeword at the beginning
998
+ array_unshift($cw, $mode);
999
+ }
1000
+ return $cw;
1001
+ }
1002
+
1003
+ } // end PDF417 class
1004
+
1005
+ //============================================================+
1006
+ // END OF FILE
1007
+ //============================================================+
includes/lib/{tcpdf_min → tcpdf}/include/barcodes/qrcode.php RENAMED
@@ -1,2866 +1,2867 @@
1
- <?php
2
- //============================================================+
3
- // File name : qrcode.php
4
- // Version : 1.0.010
5
- // Begin : 2010-03-22
6
- // Last Update : 2012-07-25
7
- // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
- // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
- // -------------------------------------------------------------------
10
- // Copyright (C) 2010-2012 Nicola Asuni - Tecnick.com LTD
11
- //
12
- // This file is part of TCPDF software library.
13
- //
14
- // TCPDF is free software: you can redistribute it and/or modify it
15
- // under the terms of the GNU Lesser General Public License as
16
- // published by the Free Software Foundation, either version 3 of the
17
- // License, or (at your option) any later version.
18
- //
19
- // TCPDF is distributed in the hope that it will be useful, but
20
- // WITHOUT ANY WARRANTY; without even the implied warranty of
21
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
- // See the GNU Lesser General Public License for more details.
23
- //
24
- // You should have received a copy of the GNU Lesser General Public License
25
- // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
- //
27
- // See LICENSE.TXT file for more information.
28
- // -------------------------------------------------------------------
29
- //
30
- // DESCRIPTION :
31
- //
32
- // Class to create QR-code arrays for TCPDF class.
33
- // QR Code symbol is a 2D barcode that can be scanned by
34
- // handy terminals such as a mobile phone with CCD.
35
- // The capacity of QR Code is up to 7000 digits or 4000
36
- // characters, and has high robustness.
37
- // This class supports QR Code model 2, described in
38
- // JIS (Japanese Industrial Standards) X0510:2004
39
- // or ISO/IEC 18004.
40
- // Currently the following features are not supported:
41
- // ECI and FNC1 mode, Micro QR Code, QR Code model 1,
42
- // Structured mode.
43
- //
44
- // This class is derived from the following projects:
45
- // ---------------------------------------------------------
46
- // "PHP QR Code encoder"
47
- // License: GNU-LGPLv3
48
- // Copyright (C) 2010 by Dominik Dzienia <deltalab at poczta dot fm>
49
- // http://phpqrcode.sourceforge.net/
50
- // https://sourceforge.net/projects/phpqrcode/
51
- //
52
- // The "PHP QR Code encoder" is based on
53
- // "C libqrencode library" (ver. 3.1.1)
54
- // License: GNU-LGPL 2.1
55
- // Copyright (C) 2006-2010 by Kentaro Fukuchi
56
- // http://megaui.net/fukuchi/works/qrencode/index.en.html
57
- //
58
- // Reed-Solomon code encoder is written by Phil Karn, KA9Q.
59
- // Copyright (C) 2002-2006 Phil Karn, KA9Q
60
- //
61
- // QR Code is registered trademark of DENSO WAVE INCORPORATED
62
- // http://www.denso-wave.com/qrcode/index-e.html
63
- // ---------------------------------------------------------
64
- //============================================================+
65
-
66
- /**
67
- * @file
68
- * Class to create QR-code arrays for TCPDF class.
69
- * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD.
70
- * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness.
71
- * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004.
72
- * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.
73
- *
74
- * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html).
75
- * Please read comments on this class source file for full copyright and license information.
76
- *
77
- * @package com.tecnick.tcpdf
78
- * @author Nicola Asuni
79
- * @version 1.0.010
80
- */
81
-
82
- // definitions
83
- if (!defined('QRCODEDEFS')) {
84
-
85
- /**
86
- * Indicate that definitions for this class are set
87
- */
88
- define('QRCODEDEFS', true);
89
-
90
- // -----------------------------------------------------
91
-
92
- // Encoding modes (characters which can be encoded in QRcode)
93
-
94
- /**
95
- * Encoding mode
96
- */
97
- define('QR_MODE_NL', -1);
98
-
99
- /**
100
- * Encoding mode numeric (0-9). 3 characters are encoded to 10bit length. In theory, 7089 characters or less can be stored in a QRcode.
101
- */
102
- define('QR_MODE_NM', 0);
103
-
104
- /**
105
- * Encoding mode alphanumeric (0-9A-Z $%*+-./:) 45characters. 2 characters are encoded to 11bit length. In theory, 4296 characters or less can be stored in a QRcode.
106
- */
107
- define('QR_MODE_AN', 1);
108
-
109
- /**
110
- * Encoding mode 8bit byte data. In theory, 2953 characters or less can be stored in a QRcode.
111
- */
112
- define('QR_MODE_8B', 2);
113
-
114
- /**
115
- * Encoding mode KANJI. A KANJI character (multibyte character) is encoded to 13bit length. In theory, 1817 characters or less can be stored in a QRcode.
116
- */
117
- define('QR_MODE_KJ', 3);
118
-
119
- /**
120
- * Encoding mode STRUCTURED (currently unsupported)
121
- */
122
- define('QR_MODE_ST', 4);
123
-
124
- // -----------------------------------------------------
125
-
126
- // Levels of error correction.
127
- // QRcode has a function of an error correcting for miss reading that white is black.
128
- // Error correcting is defined in 4 level as below.
129
-
130
- /**
131
- * Error correction level L : About 7% or less errors can be corrected.
132
- */
133
- define('QR_ECLEVEL_L', 0);
134
-
135
- /**
136
- * Error correction level M : About 15% or less errors can be corrected.
137
- */
138
- define('QR_ECLEVEL_M', 1);
139
-
140
- /**
141
- * Error correction level Q : About 25% or less errors can be corrected.
142
- */
143
- define('QR_ECLEVEL_Q', 2);
144
-
145
- /**
146
- * Error correction level H : About 30% or less errors can be corrected.
147
- */
148
- define('QR_ECLEVEL_H', 3);
149
-
150
- // -----------------------------------------------------
151
-
152
- // Version. Size of QRcode is defined as version.
153
- // Version is from 1 to 40.
154
- // Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases.
155
- // So version 40 is 177*177 matrix.
156
-
157
- /**
158
- * Maximum QR Code version.
159
- */
160
- define('QRSPEC_VERSION_MAX', 40);
161
-
162
- /**
163
- * Maximum matrix size for maximum version (version 40 is 177*177 matrix).
164
- */
165
- define('QRSPEC_WIDTH_MAX', 177);
166
-
167
- // -----------------------------------------------------
168
-
169
- /**
170
- * Matrix index to get width from $capacity array.
171
- */
172
- define('QRCAP_WIDTH', 0);
173
-
174
- /**
175
- * Matrix index to get number of words from $capacity array.
176
- */
177
- define('QRCAP_WORDS', 1);
178
-
179
- /**
180
- * Matrix index to get remainder from $capacity array.
181
- */
182
- define('QRCAP_REMINDER', 2);
183
-
184
- /**
185
- * Matrix index to get error correction level from $capacity array.
186
- */
187
- define('QRCAP_EC', 3);
188
-
189
- // -----------------------------------------------------
190
-
191
- // Structure (currently usupported)
192
-
193
- /**
194
- * Number of header bits for structured mode
195
- */
196
- define('STRUCTURE_HEADER_BITS', 20);
197
-
198
- /**
199
- * Max number of symbols for structured mode
200
- */
201
- define('MAX_STRUCTURED_SYMBOLS', 16);
202
-
203
- // -----------------------------------------------------
204
-
205
- // Masks
206
-
207
- /**
208
- * Down point base value for case 1 mask pattern (concatenation of same color in a line or a column)
209
- */
210
- define('N1', 3);
211
-
212
- /**
213
- * Down point base value for case 2 mask pattern (module block of same color)
214
- */
215
- define('N2', 3);
216
-
217
- /**
218
- * Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column)
219
- */
220
- define('N3', 40);
221
-
222
- /**
223
- * Down point base value for case 4 mask pattern (ration of dark modules in whole)
224
- */
225
- define('N4', 10);
226
-
227
- // -----------------------------------------------------
228
-
229
- // Optimization settings
230
-
231
- /**
232
- * if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code
233
- */
234
- define('QR_FIND_BEST_MASK', true);
235
-
236
- /**
237
- * if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly
238
- */
239
- define('QR_FIND_FROM_RANDOM', 2);
240
-
241
- /**
242
- * when QR_FIND_BEST_MASK === false
243
- */
244
- define('QR_DEFAULT_MASK', 2);
245
-
246
- // -----------------------------------------------------
247
-
248
- } // end of definitions
249
-
250
- // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
251
-
252
- // for compatibility with PHP4
253
- if (!function_exists('str_split')) {
254
- /**
255
- * Convert a string to an array (needed for PHP4 compatibility)
256
- * @param $string (string) The input string.
257
- * @param $split_length (int) Maximum length of the chunk.
258
- * @return If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element.
259
- */
260
- function str_split($string, $split_length=1) {
261
- if ((strlen($string) > $split_length) OR (!$split_length)) {
262
- do {
263
- $c = strlen($string);
264
- $parts[] = substr($string, 0, $split_length);
265
- $string = substr($string, $split_length);
266
- } while ($string !== false);
267
- } else {
268
- $parts = array($string);
269
- }
270
- return $parts;
271
- }
272
- }
273
-
274
- // #####################################################
275
-
276
- /**
277
- * @class QRcode
278
- * Class to create QR-code arrays for TCPDF class.
279
- * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD.
280
- * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness.
281
- * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004.
282
- * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.
283
- *
284
- * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html).
285
- * Please read comments on this class source file for full copyright and license information.
286
- *
287
- * @package com.tecnick.tcpdf
288
- * @author Nicola Asuni
289
- * @version 1.0.010
290
- */
291
- class QRcode {
292
-
293
- /**
294
- * Barcode array to be returned which is readable by TCPDF.
295
- * @protected
296
- */
297
- protected $barcode_array = array();
298
-
299
- /**
300
- * QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix.
301
- * @protected
302
- */
303
- protected $version = 0;
304
-
305
- /**
306
- * Levels of error correction. See definitions for possible values.
307
- * @protected
308
- */
309
- protected $level = QR_ECLEVEL_L;
310
-
311
- /**
312
- * Encoding mode.
313
- * @protected
314
- */
315
- protected $hint = QR_MODE_8B;
316
-
317
- /**
318
- * Boolean flag, if true the input string will be converted to uppercase.
319
- * @protected
320
- */
321
- protected $casesensitive = true;
322
-
323
- /**
324
- * Structured QR code (not supported yet).
325
- * @protected
326
- */
327
- protected $structured = 0;
328
-
329
- /**
330
- * Mask data.
331
- * @protected
332
- */
333
- protected $data;
334
-
335
- // FrameFiller
336
-
337
- /**
338
- * Width.
339
- * @protected
340
- */
341
- protected $width;
342
-
343
- /**
344
- * Frame.
345
- * @protected
346
- */
347
- protected $frame;
348
-
349
- /**
350
- * X position of bit.
351
- * @protected
352
- */
353
- protected $x;
354
-
355
- /**
356
- * Y position of bit.
357
- * @protected
358
- */
359
- protected $y;
360
-
361
- /**
362
- * Direction.
363
- * @protected
364
- */
365
- protected $dir;
366
-
367
- /**
368
- * Single bit value.
369
- * @protected
370
- */
371
- protected $bit;
372
-
373
- // ---- QRrawcode ----
374
-
375
- /**
376
- * Data code.
377
- * @protected
378
- */
379
- protected $datacode = array();
380
-
381
- /**
382
- * Error correction code.
383
- * @protected
384
- */
385
- protected $ecccode = array();
386
-
387
- /**
388
- * Blocks.
389
- * @protected
390
- */
391
- protected $blocks;
392
-
393
- /**
394
- * Reed-Solomon blocks.
395
- * @protected
396
- */
397
- protected $rsblocks = array(); //of RSblock
398
-
399
- /**
400
- * Counter.
401
- * @protected
402
- */
403
- protected $count;
404
-
405
- /**
406
- * Data length.
407
- * @protected
408
- */
409
- protected $dataLength;
410
-
411
- /**
412
- * Error correction length.
413
- * @protected
414
- */
415
- protected $eccLength;
416
-
417
- /**
418
- * Value b1.
419
- * @protected
420
- */
421
- protected $b1;
422
-
423
- // ---- QRmask ----
424
-
425
- /**
426
- * Run length.
427
- * @protected
428
- */
429
- protected $runLength = array();
430
-
431
- // ---- QRsplit ----
432
-
433
- /**
434
- * Input data string.
435
- * @protected
436
- */
437
- protected $dataStr = '';
438
-
439
- /**
440
- * Input items.
441
- * @protected
442
- */
443
- protected $items;
444
-
445
- // Reed-Solomon items
446
-
447
- /**
448
- * Reed-Solomon items.
449
- * @protected
450
- */
451
- protected $rsitems = array();
452
-
453
- /**
454
- * Array of frames.
455
- * @protected
456
- */
457
- protected $frames = array();
458
-
459
- /**
460
- * Alphabet-numeric convesion table.
461
- * @protected
462
- */
463
- protected $anTable = array(
464
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
465
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
466
- 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, //
467
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, //
468
- -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, //
469
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, //
470
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
471
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 //
472
- );
473
-
474
- /**
475
- * Array Table of the capacity of symbols.
476
- * See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004.
477
- * @protected
478
- */
479
- protected $capacity = array(
480
- array( 0, 0, 0, array( 0, 0, 0, 0)), //
481
- array( 21, 26, 0, array( 7, 10, 13, 17)), // 1
482
- array( 25, 44, 7, array( 10, 16, 22, 28)), //
483
- array( 29, 70, 7, array( 15, 26, 36, 44)), //
484
- array( 33, 100, 7, array( 20, 36, 52, 64)), //
485
- array( 37, 134, 7, array( 26, 48, 72, 88)), // 5
486
- array( 41, 172, 7, array( 36, 64, 96, 112)), //
487
- array( 45, 196, 0, array( 40, 72, 108, 130)), //
488
- array( 49, 242, 0, array( 48, 88, 132, 156)), //
489
- array( 53, 292, 0, array( 60, 110, 160, 192)), //
490
- array( 57, 346, 0, array( 72, 130, 192, 224)), // 10
491
- array( 61, 404, 0, array( 80, 150, 224, 264)), //
492
- array( 65, 466, 0, array( 96, 176, 260, 308)), //
493
- array( 69, 532, 0, array( 104, 198, 288, 352)), //
494
- array( 73, 581, 3, array( 120, 216, 320, 384)), //
495
- array( 77, 655, 3, array( 132, 240, 360, 432)), // 15
496
- array( 81, 733, 3, array( 144, 280, 408, 480)), //
497
- array( 85, 815, 3, array( 168, 308, 448, 532)), //
498
- array( 89, 901, 3, array( 180, 338, 504, 588)), //
499
- array( 93, 991, 3, array( 196, 364, 546, 650)), //
500
- array( 97, 1085, 3, array( 224, 416, 600, 700)), // 20
501
- array(101, 1156, 4, array( 224, 442, 644, 750)), //
502
- array(105, 1258, 4, array( 252, 476, 690, 816)), //
503
- array(109, 1364, 4, array( 270, 504, 750, 900)), //
504
- array(113, 1474, 4, array( 300, 560, 810, 960)), //
505
- array(117, 1588, 4, array( 312, 588, 870, 1050)), // 25
506
- array(121, 1706, 4, array( 336, 644, 952, 1110)), //
507
- array(125, 1828, 4, array( 360, 700, 1020, 1200)), //
508
- array(129, 1921, 3, array( 390, 728, 1050, 1260)), //
509
- array(133, 2051, 3, array( 420, 784, 1140, 1350)), //
510
- array(137, 2185, 3, array( 450, 812, 1200, 1440)), // 30
511
- array(141, 2323, 3, array( 480, 868, 1290, 1530)), //
512
- array(145, 2465, 3, array( 510, 924, 1350, 1620)), //
513
- array(149, 2611, 3, array( 540, 980, 1440, 1710)), //
514
- array(153, 2761, 3, array( 570, 1036, 1530, 1800)), //
515
- array(157, 2876, 0, array( 570, 1064, 1590, 1890)), // 35
516
- array(161, 3034, 0, array( 600, 1120, 1680, 1980)), //
517
- array(165, 3196, 0, array( 630, 1204, 1770, 2100)), //
518
- array(169, 3362, 0, array( 660, 1260, 1860, 2220)), //
519
- array(173, 3532, 0, array( 720, 1316, 1950, 2310)), //
520
- array(177, 3706, 0, array( 750, 1372, 2040, 2430)) // 40
521
- );
522
-
523
- /**
524
- * Array Length indicator.
525
- * @protected
526
- */
527
- protected $lengthTableBits = array(
528
- array(10, 12, 14),
529
- array( 9, 11, 13),
530
- array( 8, 16, 16),
531
- array( 8, 10, 12)
532
- );
533
-
534
- /**
535
- * Array Table of the error correction code (Reed-Solomon block).
536
- * See Table 12-16 (pp.30-36), JIS X0510:2004.
537
- * @protected
538
- */
539
- protected $eccTable = array(
540
- array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), //
541
- array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1
542
- array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), //
543
- array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), //
544
- array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), //
545
- array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5
546
- array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), //
547
- array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), //
548
- array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), //
549
- array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), //
550
- array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), // 10
551
- array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), //
552
- array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), //
553
- array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), //
554
- array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), //
555
- array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), // 15
556
- array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), //
557
- array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), //
558
- array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), //
559
- array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), //
560
- array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), // 20
561
- array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), //
562
- array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), //
563
- array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), //
564
- array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), //
565
- array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), // 25
566
- array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), //
567
- array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), //
568
- array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), //
569
- array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), //
570
- array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), // 30
571
- array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), //
572
- array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), //
573
- array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), //
574
- array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), //
575
- array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), // 35
576
- array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), //
577
- array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), //
578
- array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), //
579
- array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), //
580
- array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)) // 40
581
- );
582
-
583
- /**
584
- * Array Positions of alignment patterns.
585
- * This array includes only the second and the third position of the alignment patterns. Rest of them can be calculated from the distance between them.
586
- * See Table 1 in Appendix E (pp.71) of JIS X0510:2004.
587
- * @protected
588
- */
589
- protected $alignmentPattern = array(
590
- array( 0, 0),
591
- array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5
592
- array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10
593
- array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), // 11-15
594
- array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), // 16-20
595
- array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), // 21-25
596
- array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), // 26-30
597
- array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), // 31-35
598
- array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58) // 35-40
599
- );
600
-
601
- /**
602
- * Array Version information pattern (BCH coded).
603
- * See Table 1 in Appendix D (pp.68) of JIS X0510:2004.
604
- * size: [QRSPEC_VERSION_MAX - 6]
605
- * @protected
606
- */
607
- protected $versionPattern = array(
608
- 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, //
609
- 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, //
610
- 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, //
611
- 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, //
612
- 0x27541, 0x28c69
613
- );
614
-
615
- /**
616
- * Array Format information
617
- * @protected
618
- */
619
- protected $formatInfo = array(
620
- array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), //
621
- array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), //
622
- array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), //
623
- array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) //
624
- );
625
-
626
-
627
- // -------------------------------------------------
628
- // -------------------------------------------------
629
-
630
-
631
- /**
632
- * This is the class constructor.
633
- * Creates a QRcode object
634
- * @param $code (string) code to represent using QRcode
635
- * @param $eclevel (string) error level: <ul><li>L : About 7% or less errors can be corrected.</li><li>M : About 15% or less errors can be corrected.</li><li>Q : About 25% or less errors can be corrected.</li><li>H : About 30% or less errors can be corrected.</li></ul>
636
- * @public
637
- * @since 1.0.000
638
- */
639
- public function __construct($code, $eclevel = 'L') {
640
- $barcode_array = array();
641
- if ((is_null($code)) OR ($code == '\0') OR ($code == '')) {
642
- return false;
643
- }
644
- // set error correction level
645
- $this->level = array_search($eclevel, array('L', 'M', 'Q', 'H'));
646
- if ($this->level === false) {
647
- $this->level = QR_ECLEVEL_L;
648
- }
649
- if (($this->hint != QR_MODE_8B) AND ($this->hint != QR_MODE_KJ)) {
650
- return false;
651
- }
652
- if (($this->version < 0) OR ($this->version > QRSPEC_VERSION_MAX)) {
653
- return false;
654
- }
655
- $this->items = array();
656
- $this->encodeString($code);
657
- if (is_null($this->data)) {
658
- return false;
659
- }
660
- $qrTab = $this->binarize($this->data);
661
- $size = count($qrTab);
662
- $barcode_array['num_rows'] = $size;
663
- $barcode_array['num_cols'] = $size;
664
- $barcode_array['bcode'] = array();
665
- foreach ($qrTab as $line) {
666
- $arrAdd = array();
667
- foreach (str_split($line) as $char) {
668
- $arrAdd[] = ($char=='1')?1:0;
669
- }
670
- $barcode_array['bcode'][] = $arrAdd;
671
- }
672
- $this->barcode_array = $barcode_array;
673
- }
674
-
675
- /**
676
- * Returns a barcode array which is readable by TCPDF
677
- * @return array barcode array readable by TCPDF;
678
- * @public
679
- */
680
- public function getBarcodeArray() {
681
- return $this->barcode_array;
682
- }
683
-
684
- /**
685
- * Convert the frame in binary form
686
- * @param $frame (array) array to binarize
687
- * @return array frame in binary form
688
- */
689
- protected function binarize($frame) {
690
- $len = count($frame);
691
- // the frame is square (width = height)
692
- foreach ($frame as &$frameLine) {
693
- for ($i=0; $i<$len; $i++) {
694
- $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0';
695
- }
696
- }
697
- return $frame;
698
- }
699
-
700
- /**
701
- * Encode the input string to QR code
702
- * @param $string (string) input string to encode
703
- */
704
- protected function encodeString($string) {
705
- $this->dataStr = $string;
706
- if (!$this->casesensitive) {
707
- $this->toUpper();
708
- }
709
- $ret = $this->splitString();
710
- if ($ret < 0) {
711
- return NULL;
712
- }
713
- $this->encodeMask(-1);
714
- }
715
-
716
- /**
717
- * Encode mask
718
- * @param $mask (int) masking mode
719
- */
720
- protected function encodeMask($mask) {
721
- $spec = array(0, 0, 0, 0, 0);
722
- $this->datacode = $this->getByteStream($this->items);
723
- if (is_null($this->datacode)) {
724
- return NULL;
725
- }
726
- $spec = $this->getEccSpec($this->version, $this->level, $spec);
727
- $this->b1 = $this->rsBlockNum1($spec);
728
- $this->dataLength = $this->rsDataLength($spec);
729
- $this->eccLength = $this->rsEccLength($spec);
730
- $this->ecccode = array_fill(0, $this->eccLength, 0);
731
- $this->blocks = $this->rsBlockNum($spec);
732
- $ret = $this->init($spec);
733
- if ($ret < 0) {
734
- return NULL;
735
- }
736
- $this->count = 0;
737
- $this->width = $this->getWidth($this->version);
738
- $this->frame = $this->newFrame($this->version);
739
- $this->x = $this->width - 1;
740
- $this->y = $this->width - 1;
741
- $this->dir = -1;
742
- $this->bit = -1;
743
- // inteleaved data and ecc codes
744
- for ($i=0; $i < ($this->dataLength + $this->eccLength); $i++) {
745
- $code = $this->getCode();
746
- $bit = 0x80;
747
- for ($j=0; $j<8; $j++) {
748
- $addr = $this->getNextPosition();
749
- $this->setFrameAt($addr, 0x02 | (($bit & $code) != 0));
750
- $bit = $bit >> 1;
751
- }
752
- }
753
- // remainder bits
754
- $j = $this->getRemainder($this->version);
755
- for ($i=0; $i<$j; $i++) {
756
- $addr = $this->getNextPosition();
757
- $this->setFrameAt($addr, 0x02);
758
- }
759
- // masking
760
- $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0);
761
- if ($mask < 0) {
762
- if (QR_FIND_BEST_MASK) {
763
- $masked = $this->mask($this->width, $this->frame, $this->level);
764
- } else {
765
- $masked = $this->makeMask($this->width, $this->frame, (intval(QR_DEFAULT_MASK) % 8), $this->level);
766
- }
767
- } else {
768
- $masked = $this->makeMask($this->width, $this->frame, $mask, $this->level);
769
- }
770
- if ($masked == NULL) {
771
- return NULL;
772
- }
773
- $this->data = $masked;
774
- }
775
-
776
- // - - - - - - - - - - - - - - - - - - - - - - - - -
777
-
778
- // FrameFiller
779
-
780
- /**
781
- * Set frame value at specified position
782
- * @param $at (array) x,y position
783
- * @param $val (int) value of the character to set
784
- */
785
- protected function setFrameAt($at, $val) {
786
- $this->frame[$at['y']][$at['x']] = chr($val);
787
- }
788
-
789
- /**
790
- * Get frame value at specified position
791
- * @param $at (array) x,y position
792
- * @return value at specified position
793
- */
794
- protected function getFrameAt($at) {
795
- return ord($this->frame[$at['y']][$at['x']]);
796
- }
797
-
798
- /**
799
- * Return the next frame position
800
- * @return array of x,y coordinates
801
- */
802
- protected function getNextPosition() {
803
- do {
804
- if ($this->bit == -1) {
805
- $this->bit = 0;
806
- return array('x'=>$this->x, 'y'=>$this->y);
807
- }
808
- $x = $this->x;
809
- $y = $this->y;
810
- $w = $this->width;
811
- if ($this->bit == 0) {
812
- $x--;
813
- $this->bit++;
814
- } else {
815
- $x++;
816
- $y += $this->dir;
817
- $this->bit--;
818
- }
819
- if ($this->dir < 0) {
820
- if ($y < 0) {
821
- $y = 0;
822
- $x -= 2;
823
- $this->dir = 1;
824
- if ($x == 6) {
825
- $x--;
826
- $y = 9;
827
- }
828
- }
829
- } else {
830
- if ($y == $w) {
831
- $y = $w - 1;
832
- $x -= 2;
833
- $this->dir = -1;
834
- if ($x == 6) {
835
- $x--;
836
- $y -= 8;
837
- }
838
- }
839
- }
840
- if (($x < 0) OR ($y < 0)) {
841
- return NULL;
842
- }
843
- $this->x = $x;
844
- $this->y = $y;
845
- } while(ord($this->frame[$y][$x]) & 0x80);
846
- return array('x'=>$x, 'y'=>$y);
847
- }
848
-
849
- // - - - - - - - - - - - - - - - - - - - - - - - - -
850
-
851
- // QRrawcode
852
-
853
- /**
854
- * Initialize code.
855
- * @param $spec (array) array of ECC specification
856
- * @return 0 in case of success, -1 in case of error
857
- */
858
- protected function init($spec) {
859
- $dl = $this->rsDataCodes1($spec);
860
- $el = $this->rsEccCodes1($spec);
861
- $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);
862
- $blockNo = 0;
863
- $dataPos = 0;
864
- $eccPos = 0;
865
- $endfor = $this->rsBlockNum1($spec);
866
- for ($i=0; $i < $endfor; ++$i) {
867
- $ecc = array_slice($this->ecccode, $eccPos);
868
- $this->rsblocks[$blockNo] = array();
869
- $this->rsblocks[$blockNo]['dataLength'] = $dl;
870
- $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos);
871
- $this->rsblocks[$blockNo]['eccLength'] = $el;
872
- $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc);
873
- $this->rsblocks[$blockNo]['ecc'] = $ecc;
874
- $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc);
875
- $dataPos += $dl;
876
- $eccPos += $el;
877
- $blockNo++;
878
- }
879
- if ($this->rsBlockNum2($spec) == 0) {
880
- return 0;
881
- }
882
- $dl = $this->rsDataCodes2($spec);
883
- $el = $this->rsEccCodes2($spec);
884
- $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);
885
- if ($rs == NULL) {
886
- return -1;
887
- }
888
- $endfor = $this->rsBlockNum2($spec);
889
- for ($i=0; $i < $endfor; ++$i) {
890
- $ecc = array_slice($this->ecccode, $eccPos);
891
- $this->rsblocks[$blockNo] = array();
892
- $this->rsblocks[$blockNo]['dataLength'] = $dl;
893
- $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos);
894
- $this->rsblocks[$blockNo]['eccLength'] = $el;
895
- $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc);
896
- $this->rsblocks[$blockNo]['ecc'] = $ecc;
897
- $this->ecccode = array_merge(array_slice($this->ecccode, 0, $eccPos), $ecc);
898
- $dataPos += $dl;
899
- $eccPos += $el;
900
- $blockNo++;
901
- }
902
- return 0;
903
- }
904
-
905
- /**
906
- * Return Reed-Solomon block code.
907
- * @return array rsblocks
908
- */
909
- protected function getCode() {
910
- if ($this->count < $this->dataLength) {
911
- $row = $this->count % $this->blocks;
912
- $col = $this->count / $this->blocks;
913
- if ($col >= $this->rsblocks[0]['dataLength']) {
914
- $row += $this->b1;
915
- }
916
- $ret = $this->rsblocks[$row]['data'][$col];
917
- } elseif ($this->count < $this->dataLength + $this->eccLength) {
918
- $row = ($this->count - $this->dataLength) % $this->blocks;
919
- $col = ($this->count - $this->dataLength) / $this->blocks;
920
- $ret = $this->rsblocks[$row]['ecc'][$col];
921
- } else {
922
- return 0;
923
- }
924
- $this->count++;
925
- return $ret;
926
- }
927
-
928
- // - - - - - - - - - - - - - - - - - - - - - - - - -
929
-
930
- // QRmask
931
-
932
- /**
933
- * Write Format Information on frame and returns the number of black bits
934
- * @param $width (int) frame width
935
- * @param $frame (array) frame
936
- * @param $mask (array) masking mode
937
- * @param $level (int) error correction level
938
- * @return int blacks
939
- */
940
- protected function writeFormatInformation($width, &$frame, $mask, $level) {
941
- $blacks = 0;
942
- $format = $this->getFormatInfo($mask, $level);
943
- for ($i=0; $i<8; ++$i) {
944
- if ($format & 1) {
945
- $blacks += 2;
946
- $v = 0x85;
947
- } else {
948
- $v = 0x84;
949
- }
950
- $frame[8][$width - 1 - $i] = chr($v);
951
- if ($i < 6) {
952
- $frame[$i][8] = chr($v);
953
- } else {
954
- $frame[$i + 1][8] = chr($v);
955
- }
956
- $format = $format >> 1;
957
- }
958
- for ($i=0; $i<7; ++$i) {
959
- if ($format & 1) {
960
- $blacks += 2;
961
- $v = 0x85;
962
- } else {
963
- $v = 0x84;
964
- }
965
- $frame[$width - 7 + $i][8] = chr($v);
966
- if ($i == 0) {
967
- $frame[8][7] = chr($v);
968
- } else {
969
- $frame[8][6 - $i] = chr($v);
970
- }
971
- $format = $format >> 1;
972
- }
973
- return $blacks;
974
- }
975
-
976
- /**
977
- * mask0
978
- * @param $x (int) X position
979
- * @param $y (int) Y position
980
- * @return int mask
981
- */
982
- protected function mask0($x, $y) {
983
- return ($x + $y) & 1;
984
- }
985
-
986
- /**
987
- * mask1
988
- * @param $x (int) X position
989
- * @param $y (int) Y position
990
- * @return int mask
991
- */
992
- protected function mask1($x, $y) {
993
- return ($y & 1);
994
- }
995
-
996
- /**
997
- * mask2
998
- * @param $x (int) X position
999
- * @param $y (int) Y position
1000
- * @return int mask
1001
- */
1002
- protected function mask2($x, $y) {
1003
- return ($x % 3);
1004
- }
1005
-
1006
- /**
1007
- * mask3
1008
- * @param $x (int) X position
1009
- * @param $y (int) Y position
1010
- * @return int mask
1011
- */
1012
- protected function mask3($x, $y) {
1013
- return ($x + $y) % 3;
1014
- }
1015
-
1016
- /**
1017
- * mask4
1018
- * @param $x (int) X position
1019
- * @param $y (int) Y position
1020
- * @return int mask
1021
- */
1022
- protected function mask4($x, $y) {
1023
- return (((int)($y / 2)) + ((int)($x / 3))) & 1;
1024
- }
1025
-
1026
- /**
1027
- * mask5
1028
- * @param $x (int) X position
1029
- * @param $y (int) Y position
1030
- * @return int mask
1031
- */
1032
- protected function mask5($x, $y) {
1033
- return (($x * $y) & 1) + ($x * $y) % 3;
1034
- }
1035
-
1036
- /**
1037
- * mask6
1038
- * @param $x (int) X position
1039
- * @param $y (int) Y position
1040
- * @return int mask
1041
- */
1042
- protected function mask6($x, $y) {
1043
- return ((($x * $y) & 1) + ($x * $y) % 3) & 1;
1044
- }
1045
-
1046
- /**
1047
- * mask7
1048
- * @param $x (int) X position
1049
- * @param $y (int) Y position
1050
- * @return int mask
1051
- */
1052
- protected function mask7($x, $y) {
1053
- return ((($x * $y) % 3) + (($x + $y) & 1)) & 1;
1054
- }
1055
-
1056
- /**
1057
- * Return bitmask
1058
- * @param $maskNo (int) mask number
1059
- * @param $width (int) width
1060
- * @param $frame (array) frame
1061
- * @return array bitmask
1062
- */
1063
- protected function generateMaskNo($maskNo, $width, $frame) {
1064
- $bitMask = array_fill(0, $width, array_fill(0, $width, 0));
1065
- for ($y=0; $y<$width; ++$y) {
1066
- for ($x=0; $x<$width; ++$x) {
1067
- if (ord($frame[$y][$x]) & 0x80) {
1068
- $bitMask[$y][$x] = 0;
1069
- } else {
1070
- $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y);
1071
- $bitMask[$y][$x] = ($maskFunc == 0)?1:0;
1072
- }
1073
- }
1074
- }
1075
- return $bitMask;
1076
- }
1077
-
1078
- /**
1079
- * makeMaskNo
1080
- * @param $maskNo (int)
1081
- * @param $width (int)
1082
- * @param $s (int)
1083
- * @param $d (int)
1084
- * @param $maskGenOnly (boolean)
1085
- * @return int b
1086
- */
1087
- protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) {
1088
- $b = 0;
1089
- $bitMask = array();
1090
- $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d);
1091
- if ($maskGenOnly) {
1092
- return;
1093
- }
1094
- $d = $s;
1095
- for ($y=0; $y<$width; ++$y) {
1096
- for ($x=0; $x<$width; ++$x) {
1097
- if ($bitMask[$y][$x] == 1) {
1098
- $d[$y][$x] = chr(ord($s[$y][$x]) ^ ((int)($bitMask[$y][$x])));
1099
- }
1100
- $b += (int)(ord($d[$y][$x]) & 1);
1101
- }
1102
- }
1103
- return $b;
1104
- }
1105
-
1106
- /**
1107
- * makeMask
1108
- * @param $width (int)
1109
- * @param $frame (array)
1110
- * @param $maskNo (int)
1111
- * @param $level (int)
1112
- * @return array mask
1113
- */
1114
- protected function makeMask($width, $frame, $maskNo, $level) {
1115
- $masked = array_fill(0, $width, str_repeat("\0", $width));
1116
- $this->makeMaskNo($maskNo, $width, $frame, $masked);
1117
- $this->writeFormatInformation($width, $masked, $maskNo, $level);
1118
- return $masked;
1119
- }
1120
-
1121
- /**
1122
- * calcN1N3
1123
- * @param $length (int)
1124
- * @return int demerit
1125
- */
1126
- protected function calcN1N3($length) {
1127
- $demerit = 0;
1128
- for ($i=0; $i<$length; ++$i) {
1129
- if ($this->runLength[$i] >= 5) {
1130
- $demerit += (N1 + ($this->runLength[$i] - 5));
1131
- }
1132
- if ($i & 1) {
1133
- if (($i >= 3) AND ($i < ($length-2)) AND ($this->runLength[$i] % 3 == 0)) {
1134
- $fact = (int)($this->runLength[$i] / 3);
1135
- if (($this->runLength[$i-2] == $fact)
1136
- AND ($this->runLength[$i-1] == $fact)
1137
- AND ($this->runLength[$i+1] == $fact)
1138
- AND ($this->runLength[$i+2] == $fact)) {
1139
- if (($this->runLength[$i-3] < 0) OR ($this->runLength[$i-3] >= (4 * $fact))) {
1140
- $demerit += N3;
1141
- } elseif ((($i+3) >= $length) OR ($this->runLength[$i+3] >= (4 * $fact))) {
1142
- $demerit += N3;
1143
- }
1144
- }
1145
- }
1146
- }
1147
- }
1148
- return $demerit;
1149
- }
1150
-
1151
- /**
1152
- * evaluateSymbol
1153
- * @param $width (int)
1154
- * @param $frame (array)
1155
- * @return int demerit
1156
- */
1157
- protected function evaluateSymbol($width, $frame) {
1158
- $head = 0;
1159
- $demerit = 0;
1160
- for ($y=0; $y<$width; ++$y) {
1161
- $head = 0;
1162
- $this->runLength[0] = 1;
1163
- $frameY = $frame[$y];
1164
- if ($y > 0) {
1165
- $frameYM = $frame[$y-1];
1166
- }
1167
- for ($x=0; $x<$width; ++$x) {
1168
- if (($x > 0) AND ($y > 0)) {
1169
- $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]);
1170
- $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]);
1171
- if (($b22 | ($w22 ^ 1)) & 1) {
1172
- $demerit += N2;
1173
- }
1174
- }
1175
- if (($x == 0) AND (ord($frameY[$x]) & 1)) {
1176
- $this->runLength[0] = -1;
1177
- $head = 1;
1178
- $this->runLength[$head] = 1;
1179
- } elseif ($x > 0) {
1180
- if ((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) {
1181
- $head++;
1182
- $this->runLength[$head] = 1;
1183
- } else {
1184
- $this->runLength[$head]++;
1185
- }
1186
- }
1187
- }
1188
- $demerit += $this->calcN1N3($head+1);
1189
- }
1190
- for ($x=0; $x<$width; ++$x) {
1191
- $head = 0;
1192
- $this->runLength[0] = 1;
1193
- for ($y=0; $y<$width; ++$y) {
1194
- if (($y == 0) AND (ord($frame[$y][$x]) & 1)) {
1195
- $this->runLength[0] = -1;
1196
- $head = 1;
1197
- $this->runLength[$head] = 1;
1198
- } elseif ($y > 0) {
1199
- if ((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) {
1200
- $head++;
1201
- $this->runLength[$head] = 1;
1202
- } else {
1203
- $this->runLength[$head]++;
1204
- }
1205
- }
1206
- }
1207
- $demerit += $this->calcN1N3($head+1);
1208
- }
1209
- return $demerit;
1210
- }
1211
-
1212
- /**
1213
- * mask
1214
- * @param $width (int)
1215
- * @param $frame (array)
1216
- * @param $level (int)
1217
- * @return array best mask
1218
- */
1219
- protected function mask($width, $frame, $level) {
1220
- $minDemerit = PHP_INT_MAX;
1221
- $bestMaskNum = 0;
1222
- $bestMask = array();
1223
- $checked_masks = array(0, 1, 2, 3, 4, 5, 6, 7);
1224
- if (QR_FIND_FROM_RANDOM !== false) {
1225
- $howManuOut = 8 - (QR_FIND_FROM_RANDOM % 9);
1226
- for ($i = 0; $i < $howManuOut; ++$i) {
1227
- $remPos = rand (0, count($checked_masks)-1);
1228
- unset($checked_masks[$remPos]);
1229
- $checked_masks = array_values($checked_masks);
1230
- }
1231
- }
1232
- $bestMask = $frame;
1233
- foreach ($checked_masks as $i) {
1234
- $mask = array_fill(0, $width, str_repeat("\0", $width));
1235
- $demerit = 0;
1236
- $blacks = 0;
1237
- $blacks = $this->makeMaskNo($i, $width, $frame, $mask);
1238
- $blacks += $this->writeFormatInformation($width, $mask, $i, $level);
1239
- $blacks = (int)(100 * $blacks / ($width * $width));
1240
- $demerit = (int)((int)(abs($blacks - 50) / 5) * N4);
1241
- $demerit += $this->evaluateSymbol($width, $mask);
1242
- if ($demerit < $minDemerit) {
1243
- $minDemerit = $demerit;
1244
- $bestMask = $mask;
1245
- $bestMaskNum = $i;
1246
- }
1247
- }
1248
- return $bestMask;
1249
- }
1250
-
1251
- // - - - - - - - - - - - - - - - - - - - - - - - - -
1252
-
1253
- // QRsplit
1254
-
1255
- /**
1256
- * Return true if the character at specified position is a number
1257
- * @param $str (string) string
1258
- * @param $pos (int) characted position
1259
- * @return boolean true of false
1260
- */
1261
- protected function isdigitat($str, $pos) {
1262
- if ($pos >= strlen($str)) {
1263
- return false;
1264
- }
1265
- return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9')));
1266
- }
1267
-
1268
- /**
1269
- * Return true if the character at specified position is an alphanumeric character
1270
- * @param $str (string) string
1271
- * @param $pos (int) characted position
1272
- * @return boolean true of false
1273
- */
1274
- protected function isalnumat($str, $pos) {
1275
- if ($pos >= strlen($str)) {
1276
- return false;
1277
- }
1278
- return ($this->lookAnTable(ord($str[$pos])) >= 0);
1279
- }
1280
-
1281
- /**
1282
- * identifyMode
1283
- * @param $pos (int)
1284
- * @return int mode
1285
- */
1286
- protected function identifyMode($pos) {
1287
- if ($pos >= strlen($this->dataStr)) {
1288
- return QR_MODE_NL;
1289
- }
1290
- $c = $this->dataStr[$pos];
1291
- if ($this->isdigitat($this->dataStr, $pos)) {
1292
- return QR_MODE_NM;
1293
- } elseif ($this->isalnumat($this->dataStr, $pos)) {
1294
- return QR_MODE_AN;
1295
- } elseif ($this->hint == QR_MODE_KJ) {
1296
- if ($pos+1 < strlen($this->dataStr)) {
1297
- $d = $this->dataStr[$pos+1];
1298
- $word = (ord($c) << 8) | ord($d);
1299
- if (($word >= 0x8140 && $word <= 0x9ffc) OR ($word >= 0xe040 && $word <= 0xebbf)) {
1300
- return QR_MODE_KJ;
1301
- }
1302
- }
1303
- }
1304
- return QR_MODE_8B;
1305
- }
1306
-
1307
- /**
1308
- * eatNum
1309
- * @return int run
1310
- */
1311
- protected function eatNum() {
1312
- $ln = $this->lengthIndicator(QR_MODE_NM, $this->version);
1313
- $p = 0;
1314
- while($this->isdigitat($this->dataStr, $p)) {
1315
- $p++;
1316
- }
1317
- $run = $p;
1318
- $mode = $this->identifyMode($p);
1319
- if ($mode == QR_MODE_8B) {
1320
- $dif = $this->estimateBitsModeNum($run) + 4 + $ln
1321
- + $this->estimateBitsMode8(1) // + 4 + l8
1322
- - $this->estimateBitsMode8($run + 1); // - 4 - l8
1323
- if ($dif > 0) {
1324
- return $this->eat8();
1325
- }
1326
- }
1327
- if ($mode == QR_MODE_AN) {
1328
- $dif = $this->estimateBitsModeNum($run) + 4 + $ln
1329
- + $this->estimateBitsModeAn(1) // + 4 + la
1330
- - $this->estimateBitsModeAn($run + 1);// - 4 - la
1331
- if ($dif > 0) {
1332
- return $this->eatAn();
1333
- }
1334
- }
1335
- $this->items = $this->appendNewInputItem($this->items, QR_MODE_NM, $run, str_split($this->dataStr));
1336
- return $run;
1337
- }
1338
-
1339
- /**
1340
- * eatAn
1341
- * @return int run
1342
- */
1343
- protected function eatAn() {
1344
- $la = $this->lengthIndicator(QR_MODE_AN, $this->version);
1345
- $ln = $this->lengthIndicator(QR_MODE_NM, $this->version);
1346
- $p =1 ;
1347
- while($this->isalnumat($this->dataStr, $p)) {
1348
- if ($this->isdigitat($this->dataStr, $p)) {
1349
- $q = $p;
1350
- while($this->isdigitat($this->dataStr, $q)) {
1351
- $q++;
1352
- }
1353
- $dif = $this->estimateBitsModeAn($p) // + 4 + la
1354
- + $this->estimateBitsModeNum($q - $p) + 4 + $ln
1355
- - $this->estimateBitsModeAn($q); // - 4 - la
1356
- if ($dif < 0) {
1357
- break;
1358
- } else {
1359
- $p = $q;
1360
- }
1361
- } else {
1362
- $p++;
1363
- }
1364
- }
1365
- $run = $p;
1366
- if (!$this->isalnumat($this->dataStr, $p)) {
1367
- $dif = $this->estimateBitsModeAn($run) + 4 + $la
1368
- + $this->estimateBitsMode8(1) // + 4 + l8
1369
- - $this->estimateBitsMode8($run + 1); // - 4 - l8
1370
- if ($dif > 0) {
1371
- return $this->eat8();
1372
- }
1373
- }
1374
- $this->items = $this->appendNewInputItem($this->items, QR_MODE_AN, $run, str_split($this->dataStr));
1375
- return $run;
1376
- }
1377
-
1378
- /**
1379
- * eatKanji
1380
- * @return int run
1381
- */
1382
- protected function eatKanji() {
1383
- $p = 0;
1384
- while($this->identifyMode($p) == QR_MODE_KJ) {
1385
- $p += 2;
1386
- }
1387
- $this->items = $this->appendNewInputItem($this->items, QR_MODE_KJ, $p, str_split($this->dataStr));
1388
- return $run;
1389
- }
1390
-
1391
- /**
1392
- * eat8
1393
- * @return int run
1394
- */
1395
- protected function eat8() {
1396
- $la = $this->lengthIndicator(QR_MODE_AN, $this->version);
1397
- $ln = $this->lengthIndicator(QR_MODE_NM, $this->version);
1398
- $p = 1;
1399
- $dataStrLen = strlen($this->dataStr);
1400
- while($p < $dataStrLen) {
1401
- $mode = $this->identifyMode($p);
1402
- if ($mode == QR_MODE_KJ) {
1403
- break;
1404
- }
1405
- if ($mode == QR_MODE_NM) {
1406
- $q = $p;
1407
- while($this->isdigitat($this->dataStr, $q)) {
1408
- $q++;
1409
- }
1410
- $dif = $this->estimateBitsMode8($p) // + 4 + l8
1411
- + $this->estimateBitsModeNum($q - $p) + 4 + $ln
1412
- - $this->estimateBitsMode8($q); // - 4 - l8
1413
- if ($dif < 0) {
1414
- break;
1415
- } else {
1416
- $p = $q;
1417
- }
1418
- } elseif ($mode == QR_MODE_AN) {
1419
- $q = $p;
1420
- while($this->isalnumat($this->dataStr, $q)) {
1421
- $q++;
1422
- }
1423
- $dif = $this->estimateBitsMode8($p) // + 4 + l8
1424
- + $this->estimateBitsModeAn($q - $p) + 4 + $la
1425
- - $this->estimateBitsMode8($q); // - 4 - l8
1426
- if ($dif < 0) {
1427
- break;
1428
- } else {
1429
- $p = $q;
1430
- }
1431
- } else {
1432
- $p++;
1433
- }
1434
- }
1435
- $run = $p;
1436
- $this->items = $this->appendNewInputItem($this->items, QR_MODE_8B, $run, str_split($this->dataStr));
1437
- return $run;
1438
- }
1439
-
1440
- /**
1441
- * splitString
1442
- * @return (int)
1443
- */
1444
- protected function splitString() {
1445
- while (strlen($this->dataStr) > 0) {
1446
- $mode = $this->identifyMode(0);
1447
- switch ($mode) {
1448
- case QR_MODE_NM: {
1449
- $length = $this->eatNum();
1450
- break;
1451
- }
1452
- case QR_MODE_AN: {
1453
- $length = $this->eatAn();
1454
- break;
1455
- }
1456
- case QR_MODE_KJ: {
1457
- if ($hint == QR_MODE_KJ) {
1458
- $length = $this->eatKanji();
1459
- } else {
1460
- $length = $this->eat8();
1461
- }
1462
- break;
1463
- }
1464
- default: {
1465
- $length = $this->eat8();
1466
- break;
1467
- }
1468
- }
1469
- if ($length == 0) {
1470
- return 0;
1471
- }
1472
- if ($length < 0) {
1473
- return -1;
1474
- }
1475
- $this->dataStr = substr($this->dataStr, $length);
1476
- }
1477
- return 0;
1478
- }
1479
-
1480
- /**
1481
- * toUpper
1482
- */
1483
- protected function toUpper() {
1484
- $stringLen = strlen($this->dataStr);
1485
- $p = 0;
1486
- while ($p < $stringLen) {
1487
- $mode = $this->identifyMode(substr($this->dataStr, $p), $this->hint);
1488
- if ($mode == QR_MODE_KJ) {
1489
- $p += 2;
1490
- } else {
1491
- if ((ord($this->dataStr[$p]) >= ord('a')) AND (ord($this->dataStr[$p]) <= ord('z'))) {
1492
- $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32);
1493
- }
1494
- $p++;
1495
- }
1496
- }
1497
- return $this->dataStr;
1498
- }
1499
-
1500
- // - - - - - - - - - - - - - - - - - - - - - - - - -
1501
-
1502
- // QRinputItem
1503
-
1504
- /**
1505
- * newInputItem
1506
- * @param $mode (int)
1507
- * @param $size (int)
1508
- * @param $data (array)
1509
- * @param $bstream (array)
1510
- * @return array input item
1511
- */
1512
- protected function newInputItem($mode, $size, $data, $bstream=null) {
1513
- $setData = array_slice($data, 0, $size);
1514
- if (count($setData) < $size) {
1515
- $setData = array_merge($setData, array_fill(0, ($size - count($setData)), 0));
1516
- }
1517
- if (!$this->check($mode, $size, $setData)) {
1518
- return NULL;
1519
- }
1520
- $inputitem = array();
1521
- $inputitem['mode'] = $mode;
1522
- $inputitem['size'] = $size;
1523
- $inputitem['data'] = $setData;
1524
- $inputitem['bstream'] = $bstream;
1525
- return $inputitem;
1526
- }
1527
-
1528
- /**
1529
- * encodeModeNum
1530
- * @param $inputitem (array)
1531
- * @param $version (int)
1532
- * @return array input item
1533
- */
1534
- protected function encodeModeNum($inputitem, $version) {
1535
- $words = (int)($inputitem['size'] / 3);
1536
- $inputitem['bstream'] = array();
1537
- $val = 0x1;
1538
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val);
1539
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_NM, $version), $inputitem['size']);
1540
- for ($i=0; $i < $words; ++$i) {
1541
- $val = (ord($inputitem['data'][$i*3 ]) - ord('0')) * 100;
1542
- $val += (ord($inputitem['data'][$i*3+1]) - ord('0')) * 10;
1543
- $val += (ord($inputitem['data'][$i*3+2]) - ord('0'));
1544
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 10, $val);
1545
- }
1546
- if ($inputitem['size'] - $words * 3 == 1) {
1547
- $val = ord($inputitem['data'][$words*3]) - ord('0');
1548
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val);
1549
- } elseif (($inputitem['size'] - ($words * 3)) == 2) {
1550
- $val = (ord($inputitem['data'][$words*3 ]) - ord('0')) * 10;
1551
- $val += (ord($inputitem['data'][$words*3+1]) - ord('0'));
1552
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 7, $val);
1553
- }
1554
- return $inputitem;
1555
- }
1556
-
1557
- /**
1558
- * encodeModeAn
1559
- * @param $inputitem (array)
1560
- * @param $version (int)
1561
- * @return array input item
1562
- */
1563
- protected function encodeModeAn($inputitem, $version) {
1564
- $words = (int)($inputitem['size'] / 2);
1565
- $inputitem['bstream'] = array();
1566
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x02);
1567
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_AN, $version), $inputitem['size']);
1568
- for ($i=0; $i < $words; ++$i) {
1569
- $val = (int)($this->lookAnTable(ord($inputitem['data'][$i*2])) * 45);
1570
- $val += (int)($this->lookAnTable(ord($inputitem['data'][($i*2)+1])));
1571
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 11, $val);
1572
- }
1573
- if ($inputitem['size'] & 1) {
1574
- $val = $this->lookAnTable(ord($inputitem['data'][($words * 2)]));
1575
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 6, $val);
1576
- }
1577
- return $inputitem;
1578
- }
1579
-
1580
- /**
1581
- * encodeMode8
1582
- * @param $inputitem (array)
1583
- * @param $version (int)
1584
- * @return array input item
1585
- */
1586
- protected function encodeMode8($inputitem, $version) {
1587
- $inputitem['bstream'] = array();
1588
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x4);
1589
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_8B, $version), $inputitem['size']);
1590
- for ($i=0; $i < $inputitem['size']; ++$i) {
1591
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][$i]));
1592
- }
1593
- return $inputitem;
1594
- }
1595
-
1596
- /**
1597
- * encodeModeKanji
1598
- * @param $inputitem (array)
1599
- * @param $version (int)
1600
- * @return array input item
1601
- */
1602
- protected function encodeModeKanji($inputitem, $version) {
1603
- $inputitem['bstream'] = array();
1604
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x8);
1605
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_KJ, $version), (int)($inputitem['size'] / 2));
1606
- for ($i=0; $i<$inputitem['size']; $i+=2) {
1607
- $val = (ord($inputitem['data'][$i]) << 8) | ord($inputitem['data'][$i+1]);
1608
- if ($val <= 0x9ffc) {
1609
- $val -= 0x8140;
1610
- } else {
1611
- $val -= 0xc140;
1612
- }
1613
- $h = ($val >> 8) * 0xc0;
1614
- $val = ($val & 0xff) + $h;
1615
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 13, $val);
1616
- }
1617
- return $inputitem;
1618
- }
1619
-
1620
- /**
1621
- * encodeModeStructure
1622
- * @param $inputitem (array)
1623
- * @return array input item
1624
- */
1625
- protected function encodeModeStructure($inputitem) {
1626
- $inputitem['bstream'] = array();
1627
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x03);
1628
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][1]) - 1);
1629
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][0]) - 1);
1630
- $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][2]));
1631
- return $inputitem;
1632
- }
1633
-
1634
- /**
1635
- * encodeBitStream
1636
- * @param $inputitem (array)
1637
- * @param $version (int)
1638
- * @return array input item
1639
- */
1640
- protected function encodeBitStream($inputitem, $version) {
1641
- $inputitem['bstream'] = array();
1642
- $words = $this->maximumWords($inputitem['mode'], $version);
1643
- if ($inputitem['size'] > $words) {
1644
- $st1 = $this->newInputItem($inputitem['mode'], $words, $inputitem['data']);
1645
- $st2 = $this->newInputItem($inputitem['mode'], $inputitem['size'] - $words, array_slice($inputitem['data'], $words));
1646
- $st1 = $this->encodeBitStream($st1, $version);
1647
- $st2 = $this->encodeBitStream($st2, $version);
1648
- $inputitem['bstream'] = array();
1649
- $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st1['bstream']);
1650
- $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st2['bstream']);
1651
- } else {
1652
- switch($inputitem['mode']) {
1653
- case QR_MODE_NM: {
1654
- $inputitem = $this->encodeModeNum($inputitem, $version);
1655
- break;
1656
- }
1657
- case QR_MODE_AN: {
1658
- $inputitem = $this->encodeModeAn($inputitem, $version);
1659
- break;
1660
- }
1661
- case QR_MODE_8B: {
1662
- $inputitem = $this->encodeMode8($inputitem, $version);
1663
- break;
1664
- }
1665
- case QR_MODE_KJ: {
1666
- $inputitem = $this->encodeModeKanji($inputitem, $version);
1667
- break;
1668
- }
1669
- case QR_MODE_ST: {
1670
- $inputitem = $this->encodeModeStructure($inputitem);
1671
- break;
1672
- }
1673
- default: {
1674
- break;
1675
- }
1676
- }
1677
- }
1678
- return $inputitem;
1679
- }
1680
-
1681
- // - - - - - - - - - - - - - - - - - - - - - - - - -
1682
-
1683
- // QRinput
1684
-
1685
- /**
1686
- * Append data to an input object.
1687
- * The data is copied and appended to the input object.
1688
- * @param $items (arrray) input items
1689
- * @param $mode (int) encoding mode.
1690
- * @param $size (int) size of data (byte).
1691
- * @param $data (array) array of input data.
1692
- * @return items
1693
- *
1694
- */
1695
- protected function appendNewInputItem($items, $mode, $size, $data) {
1696
- $newitem = $this->newInputItem($mode, $size, $data);
1697
- if (!empty($newitem)) {
1698
- $items[] = $newitem;
1699
- }
1700
- return $items;
1701
- }
1702
-
1703
- /**
1704
- * insertStructuredAppendHeader
1705
- * @param $items (array)
1706
- * @param $size (int)
1707
- * @param $index (int)
1708
- * @param $parity (int)
1709
- * @return array items
1710
- */
1711
- protected function insertStructuredAppendHeader($items, $size, $index, $parity) {
1712
- if ($size > MAX_STRUCTURED_SYMBOLS) {
1713
- return -1;
1714
- }
1715
- if (($index <= 0) OR ($index > MAX_STRUCTURED_SYMBOLS)) {
1716
- return -1;
1717
- }
1718
- $buf = array($size, $index, $parity);
1719
- $entry = $this->newInputItem(QR_MODE_ST, 3, buf);
1720
- array_unshift($items, $entry);
1721
- return $items;
1722
- }
1723
-
1724
- /**
1725
- * calcParity
1726
- * @param $items (array)
1727
- * @return int parity
1728
- */
1729
- protected function calcParity($items) {
1730
- $parity = 0;
1731
- foreach ($items as $item) {
1732
- if ($item['mode'] != QR_MODE_ST) {
1733
- for ($i=$item['size']-1; $i>=0; --$i) {
1734
- $parity ^= $item['data'][$i];
1735
- }
1736
- }
1737
- }
1738
- return $parity;
1739
- }
1740
-
1741
- /**
1742
- * checkModeNum
1743
- * @param $size (int)
1744
- * @param $data (array)
1745
- * @return boolean true or false
1746
- */
1747
- protected function checkModeNum($size, $data) {
1748
- for ($i=0; $i<$size; ++$i) {
1749
- if ((ord($data[$i]) < ord('0')) OR (ord($data[$i]) > ord('9'))){
1750
- return false;
1751
- }
1752
- }
1753
- return true;
1754
- }
1755
-
1756
- /**
1757
- * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19).
1758
- * @param $c (int) character value
1759
- * @return value
1760
- */
1761
- protected function lookAnTable($c) {
1762
- return (($c > 127)?-1:$this->anTable[$c]);
1763
- }
1764
-
1765
- /**
1766
- * checkModeAn
1767
- * @param $size (int)
1768
- * @param $data (array)
1769
- * @return boolean true or false
1770
- */
1771
- protected function checkModeAn($size, $data) {
1772
- for ($i=0; $i<$size; ++$i) {
1773
- if ($this->lookAnTable(ord($data[$i])) == -1) {
1774
- return false;
1775
- }
1776
- }
1777
- return true;
1778
- }
1779
-
1780
- /**
1781
- * estimateBitsModeNum
1782
- * @param $size (int)
1783
- * @return int number of bits
1784
- */
1785
- protected function estimateBitsModeNum($size) {
1786
- $w = (int)($size / 3);
1787
- $bits = ($w * 10);
1788
- switch($size - ($w * 3)) {
1789
- case 1: {
1790
- $bits += 4;
1791
- break;
1792
- }
1793
- case 2: {
1794
- $bits += 7;
1795
- break;
1796
- }
1797
- }
1798
- return $bits;
1799
- }
1800
-
1801
- /**
1802
- * estimateBitsModeAn
1803
- * @param $size (int)
1804
- * @return int number of bits
1805
- */
1806
- protected function estimateBitsModeAn($size) {
1807
- $bits = (int)($size * 5.5); // (size / 2 ) * 11
1808
- if ($size & 1) {
1809
- $bits += 6;
1810
- }
1811
- return $bits;
1812
- }
1813
-
1814
- /**
1815
- * estimateBitsMode8
1816
- * @param $size (int)
1817
- * @return int number of bits
1818
- */
1819
- protected function estimateBitsMode8($size) {
1820
- return (int)($size * 8);
1821
- }
1822
-
1823
- /**
1824
- * estimateBitsModeKanji
1825
- * @param $size (int)
1826
- * @return int number of bits
1827
- */
1828
- protected function estimateBitsModeKanji($size) {
1829
- return (int)($size * 6.5); // (size / 2 ) * 13
1830
- }
1831
-
1832
- /**
1833
- * checkModeKanji
1834
- * @param $size (int)
1835
- * @param $data (array)
1836
- * @return boolean true or false
1837
- */
1838
- protected function checkModeKanji($size, $data) {
1839
- if ($size & 1) {
1840
- return false;
1841
- }
1842
- for ($i=0; $i<$size; $i+=2) {
1843
- $val = (ord($data[$i]) << 8) | ord($data[$i+1]);
1844
- if (($val < 0x8140) OR (($val > 0x9ffc) AND ($val < 0xe040)) OR ($val > 0xebbf)) {
1845
- return false;
1846
- }
1847
- }
1848
- return true;
1849
- }
1850
-
1851
- /**
1852
- * Validate the input data.
1853
- * @param $mode (int) encoding mode.
1854
- * @param $size (int) size of data (byte).
1855
- * @param $data (array) data to validate
1856
- * @return boolean true in case of valid data, false otherwise
1857
- */
1858
- protected function check($mode, $size, $data) {
1859
- if ($size <= 0) {
1860
- return false;
1861
- }
1862
- switch($mode) {
1863
- case QR_MODE_NM: {
1864
- return $this->checkModeNum($size, $data);
1865
- }
1866
- case QR_MODE_AN: {
1867
- return $this->checkModeAn($size, $data);
1868
- }
1869
- case QR_MODE_KJ: {
1870
- return $this->checkModeKanji($size, $data);
1871
- }
1872
- case QR_MODE_8B: {
1873
- return true;
1874
- }
1875
- case QR_MODE_ST: {
1876
- return true;
1877
- }
1878
- default: {
1879
- break;
1880
- }
1881
- }
1882
- return false;
1883
- }
1884
-
1885
- /**
1886
- * estimateBitStreamSize
1887
- * @param $items (array)
1888
- * @param $version (int)
1889
- * @return int bits
1890
- */
1891
- protected function estimateBitStreamSize($items, $version) {
1892
- $bits = 0;
1893
- if ($version == 0) {
1894
- $version = 1;
1895
- }
1896
- foreach ($items as $item) {
1897
- switch($item['mode']) {
1898
- case QR_MODE_NM: {
1899
- $bits = $this->estimateBitsModeNum($item['size']);
1900
- break;
1901
- }
1902
- case QR_MODE_AN: {
1903
- $bits = $this->estimateBitsModeAn($item['size']);
1904
- break;
1905
- }
1906
- case QR_MODE_8B: {
1907
- $bits = $this->estimateBitsMode8($item['size']);
1908
- break;
1909
- }
1910
- case QR_MODE_KJ: {
1911
- $bits = $this->estimateBitsModeKanji($item['size']);
1912
- break;
1913
- }
1914
- case QR_MODE_ST: {
1915
- return STRUCTURE_HEADER_BITS;
1916
- }
1917
- default: {
1918
- return 0;
1919
- }
1920
- }
1921
- $l = $this->lengthIndicator($item['mode'], $version);
1922
- $m = 1 << $l;
1923
- $num = (int)(($item['size'] + $m - 1) / $m);
1924
- $bits += $num * (4 + $l);
1925
- }
1926
- return $bits;
1927
- }
1928
-
1929
- /**
1930
- * estimateVersion
1931
- * @param $items (array)
1932
- * @return int version
1933
- */
1934
- protected function estimateVersion($items) {
1935
- $version = 0;
1936
- $prev = 0;
1937
- do {
1938
- $prev = $version;
1939
- $bits = $this->estimateBitStreamSize($items, $prev);
1940
- $version = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level);
1941
- if ($version < 0) {
1942
- return -1;
1943
- }
1944
- } while ($version > $prev);
1945
- return $version;
1946
- }
1947
-
1948
- /**
1949
- * lengthOfCode
1950
- * @param $mode (int)
1951
- * @param $version (int)
1952
- * @param $bits (int)
1953
- * @return int size
1954
- */
1955
- protected function lengthOfCode($mode, $version, $bits) {
1956
- $payload = $bits - 4 - $this->lengthIndicator($mode, $version);
1957
- switch($mode) {
1958
- case QR_MODE_NM: {
1959
- $chunks = (int)($payload / 10);
1960
- $remain = $payload - $chunks * 10;
1961
- $size = $chunks * 3;
1962
- if ($remain >= 7) {
1963
- $size += 2;
1964
- } elseif ($remain >= 4) {
1965
- $size += 1;
1966
- }
1967
- break;
1968
- }
1969
- case QR_MODE_AN: {
1970
- $chunks = (int)($payload / 11);
1971
- $remain = $payload - $chunks * 11;
1972
- $size = $chunks * 2;
1973
- if ($remain >= 6) {
1974
- ++$size;
1975
- }
1976
- break;
1977
- }
1978
- case QR_MODE_8B: {
1979
- $size = (int)($payload / 8);
1980
- break;
1981
- }
1982
- case QR_MODE_KJ: {
1983
- $size = (int)(($payload / 13) * 2);
1984
- break;
1985
- }
1986
- case QR_MODE_ST: {
1987
- $size = (int)($payload / 8);
1988
- break;
1989
- }
1990
- default: {
1991
- $size = 0;
1992
- break;
1993
- }
1994
- }
1995
- $maxsize = $this->maximumWords($mode, $version);
1996
- if ($size < 0) {
1997
- $size = 0;
1998
- }
1999
- if ($size > $maxsize) {
2000
- $size = $maxsize;
2001
- }
2002
- return $size;
2003
- }
2004
-
2005
- /**
2006
- * createBitStream
2007
- * @param $items (array)
2008
- * @return array of items and total bits
2009
- */
2010
- protected function createBitStream($items) {
2011
- $total = 0;
2012
- foreach ($items as $key => $item) {
2013
- $items[$key] = $this->encodeBitStream($item, $this->version);
2014
- $bits = count($items[$key]['bstream']);
2015
- $total += $bits;
2016
- }
2017
- return array($items, $total);
2018
- }
2019
-
2020
- /**
2021
- * convertData
2022
- * @param $items (array)
2023
- * @return array items
2024
- */
2025
- protected function convertData($items) {
2026
- $ver = $this->estimateVersion($items);
2027
- if ($ver > $this->version) {
2028
- $this->version = $ver;
2029
- }
2030
- while (true) {
2031
- $cbs = $this->createBitStream($items);
2032
- $items = $cbs[0];
2033
- $bits = $cbs[1];
2034
- if ($bits < 0) {
2035
- return -1;
2036
- }
2037
- $ver = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level);
2038
- if ($ver < 0) {
2039
- return -1;
2040
- } elseif ($ver > $this->version) {
2041
- $this->version = $ver;
2042
- } else {
2043
- break;
2044
- }
2045
- }
2046
- return $items;
2047
- }
2048
-
2049
- /**
2050
- * Append Padding Bit to bitstream
2051
- * @param $bstream (array)
2052
- * @return array bitstream
2053
- */
2054
- protected function appendPaddingBit($bstream) {
2055
- if (is_null($bstream)) {
2056
- return null;
2057
- }
2058
- $bits = count($bstream);
2059
- $maxwords = $this->getDataLength($this->version, $this->level);
2060
- $maxbits = $maxwords * 8;
2061
- if ($maxbits == $bits) {
2062
- return $bstream;
2063
- }
2064
- if ($maxbits - $bits < 5) {
2065
- return $this->appendNum($bstream, $maxbits - $bits, 0);
2066
- }
2067
- $bits += 4;
2068
- $words = (int)(($bits + 7) / 8);
2069
- $padding = array();
2070
- $padding = $this->appendNum($padding, $words * 8 - $bits + 4, 0);
2071
- $padlen = $maxwords - $words;
2072
- if ($padlen > 0) {
2073
- $padbuf = array();
2074
- for ($i=0; $i<$padlen; ++$i) {
2075
- $padbuf[$i] = ($i&1)?0x11:0xec;
2076
- }
2077
- $padding = $this->appendBytes($padding, $padlen, $padbuf);
2078
- }
2079
- return $this->appendBitstream($bstream, $padding);
2080
- }
2081
-
2082
- /**
2083
- * mergeBitStream
2084
- * @param $items (array) items
2085
- * @return array bitstream
2086
- */
2087
- protected function mergeBitStream($items) {
2088
- $items = $this->convertData($items);
2089
- if (!is_array($items)) {
2090
- return null;
2091
- }
2092
- $bstream = array();
2093
- foreach ($items as $item) {
2094
- $bstream = $this->appendBitstream($bstream, $item['bstream']);
2095
- }
2096
- return $bstream;
2097
- }
2098
-
2099
- /**
2100
- * Returns a stream of bits.
2101
- * @param $items (int)
2102
- * @return array padded merged byte stream
2103
- */
2104
- protected function getBitStream($items) {
2105
- $bstream = $this->mergeBitStream($items);
2106
- return $this->appendPaddingBit($bstream);
2107
- }
2108
-
2109
- /**
2110
- * Pack all bit streams padding bits into a byte array.
2111
- * @param $items (int)
2112
- * @return array padded merged byte stream
2113
- */
2114
- protected function getByteStream($items) {
2115
- $bstream = $this->getBitStream($items);
2116
- return $this->bitstreamToByte($bstream);
2117
- }
2118
-
2119
- // - - - - - - - - - - - - - - - - - - - - - - - - -
2120
-
2121
- // QRbitstream
2122
-
2123
- /**
2124
- * Return an array with zeros
2125
- * @param $setLength (int) array size
2126
- * @return array
2127
- */
2128
- protected function allocate($setLength) {
2129
- return array_fill(0, $setLength, 0);
2130
- }
2131
-
2132
- /**
2133
- * Return new bitstream from number
2134
- * @param $bits (int) number of bits
2135
- * @param $num (int) number
2136
- * @return array bitstream
2137
- */
2138
- protected function newFromNum($bits, $num) {
2139
- $bstream = $this->allocate($bits);
2140
- $mask = 1 << ($bits - 1);
2141
- for ($i=0; $i<$bits; ++$i) {
2142
- if ($num & $mask) {
2143
- $bstream[$i] = 1;
2144
- } else {
2145
- $bstream[$i] = 0;
2146
- }
2147
- $mask = $mask >> 1;
2148
- }
2149
- return $bstream;
2150
- }
2151
-
2152
- /**
2153
- * Return new bitstream from bytes
2154
- * @param $size (int) size
2155
- * @param $data (array) bytes
2156
- * @return array bitstream
2157
- */
2158
- protected function newFromBytes($size, $data) {
2159
- $bstream = $this->allocate($size * 8);
2160
- $p=0;
2161
- for ($i=0; $i<$size; ++$i) {
2162
- $mask = 0x80;
2163
- for ($j=0; $j<8; ++$j) {
2164
- if ($data[$i] & $mask) {
2165
- $bstream[$p] = 1;
2166
- } else {
2167
- $bstream[$p] = 0;
2168
- }
2169
- $p++;
2170
- $mask = $mask >> 1;
2171
- }
2172
- }
2173
- return $bstream;
2174
- }
2175
-
2176
- /**
2177
- * Append one bitstream to another
2178
- * @param $bitstream (array) original bitstream
2179
- * @param $append (array) bitstream to append
2180
- * @return array bitstream
2181
- */
2182
- protected function appendBitstream($bitstream, $append) {
2183
- if ((!is_array($append)) OR (count($append) == 0)) {
2184
- return $bitstream;
2185
- }
2186
- if (count($bitstream) == 0) {
2187
- return $append;
2188
- }
2189
- return array_values(array_merge($bitstream, $append));
2190
- }
2191
-
2192
- /**
2193
- * Append one bitstream created from number to another
2194
- * @param $bitstream (array) original bitstream
2195
- * @param $bits (int) number of bits
2196
- * @param $num (int) number
2197
- * @return array bitstream
2198
- */
2199
- protected function appendNum($bitstream, $bits, $num) {
2200
- if ($bits == 0) {
2201
- return 0;
2202
- }
2203
- $b = $this->newFromNum($bits, $num);
2204
- return $this->appendBitstream($bitstream, $b);
2205
- }
2206
-
2207
- /**
2208
- * Append one bitstream created from bytes to another
2209
- * @param $bitstream (array) original bitstream
2210
- * @param $size (int) size
2211
- * @param $data (array) bytes
2212
- * @return array bitstream
2213
- */
2214
- protected function appendBytes($bitstream, $size, $data) {
2215
- if ($size == 0) {
2216
- return 0;
2217
- }
2218
- $b = $this->newFromBytes($size, $data);
2219
- return $this->appendBitstream($bitstream, $b);
2220
- }
2221
-
2222
- /**
2223
- * Convert bitstream to bytes
2224
- * @param $bstream (array) original bitstream
2225
- * @return array of bytes
2226
- */
2227
- protected function bitstreamToByte($bstream) {
2228
- if (is_null($bstream)) {
2229
- return null;
2230
- }
2231
- $size = count($bstream);
2232
- if ($size == 0) {
2233
- return array();
2234
- }
2235
- $data = array_fill(0, (int)(($size + 7) / 8), 0);
2236
- $bytes = (int)($size / 8);
2237
- $p = 0;
2238
- for ($i=0; $i<$bytes; $i++) {
2239
- $v = 0;
2240
- for ($j=0; $j<8; $j++) {
2241
- $v = $v << 1;
2242
- $v |= $bstream[$p];
2243
- $p++;
2244
- }
2245
- $data[$i] = $v;
2246
- }
2247
- if ($size & 7) {
2248
- $v = 0;
2249
- for ($j=0; $j<($size & 7); $j++) {
2250
- $v = $v << 1;
2251
- $v |= $bstream[$p];
2252
- $p++;
2253
- }
2254
- $data[$bytes] = $v;
2255
- }
2256
- return $data;
2257
- }
2258
-
2259
- // - - - - - - - - - - - - - - - - - - - - - - - - -
2260
-
2261
- // QRspec
2262
-
2263
- /**
2264
- * Replace a value on the array at the specified position
2265
- * @param $srctab (array)
2266
- * @param $x (int) X position
2267
- * @param $y (int) Y position
2268
- * @param $repl (string) value to replace
2269
- * @param $replLen (int) length of the repl string
2270
- * @return array srctab
2271
- */
2272
- protected function qrstrset($srctab, $x, $y, $repl, $replLen=false) {
2273
- $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl));
2274
- return $srctab;
2275
- }
2276
-
2277
- /**
2278
- * Return maximum data code length (bytes) for the version.
2279
- * @param $version (int) version
2280
- * @param $level (int) error correction level
2281
- * @return int maximum size (bytes)
2282
- */
2283
- protected function getDataLength($version, $level) {
2284
- return $this->capacity[$version][QRCAP_WORDS] - $this->capacity[$version][QRCAP_EC][$level];
2285
- }
2286
-
2287
- /**
2288
- * Return maximum error correction code length (bytes) for the version.
2289
- * @param $version (int) version
2290
- * @param $level (int) error correction level
2291
- * @return int ECC size (bytes)
2292
- */
2293
- protected function getECCLength($version, $level){
2294
- return $this->capacity[$version][QRCAP_EC][$level];
2295
- }
2296
-
2297
- /**
2298
- * Return the width of the symbol for the version.
2299
- * @param $version (int) version
2300
- * @return int width
2301
- */
2302
- protected function getWidth($version) {
2303
- return $this->capacity[$version][QRCAP_WIDTH];
2304
- }
2305
-
2306
- /**
2307
- * Return the numer of remainder bits.
2308
- * @param $version (int) version
2309
- * @return int number of remainder bits
2310
- */
2311
- protected function getRemainder($version) {
2312
- return $this->capacity[$version][QRCAP_REMINDER];
2313
- }
2314
-
2315
- /**
2316
- * Return a version number that satisfies the input code length.
2317
- * @param $size (int) input code length (bytes)
2318
- * @param $level (int) error correction level
2319
- * @return int version number
2320
- */
2321
- protected function getMinimumVersion($size, $level) {
2322
- for ($i = 1; $i <= QRSPEC_VERSION_MAX; ++$i) {
2323
- $words = ($this->capacity[$i][QRCAP_WORDS] - $this->capacity[$i][QRCAP_EC][$level]);
2324
- if ($words >= $size) {
2325
- return $i;
2326
- }
2327
- }
2328
- // the size of input data is greater than QR capacity, try to lover the error correction mode
2329
- return -1;
2330
- }
2331
-
2332
- /**
2333
- * Return the size of length indicator for the mode and version.
2334
- * @param $mode (int) encoding mode
2335
- * @param $version (int) version
2336
- * @return int the size of the appropriate length indicator (bits).
2337
- */
2338
- protected function lengthIndicator($mode, $version) {
2339
- if ($mode == QR_MODE_ST) {
2340
- return 0;
2341
- }
2342
- if ($version <= 9) {
2343
- $l = 0;
2344
- } elseif ($version <= 26) {
2345
- $l = 1;
2346
- } else {
2347
- $l = 2;
2348
- }
2349
- return $this->lengthTableBits[$mode][$l];
2350
- }
2351
-
2352
- /**
2353
- * Return the maximum length for the mode and version.
2354
- * @param $mode (int) encoding mode
2355
- * @param $version (int) version
2356
- * @return int the maximum length (bytes)
2357
- */
2358
- protected function maximumWords($mode, $version) {
2359
- if ($mode == QR_MODE_ST) {
2360
- return 3;
2361
- }
2362
- if ($version <= 9) {
2363
- $l = 0;
2364
- } else if ($version <= 26) {
2365
- $l = 1;
2366
- } else {
2367
- $l = 2;
2368
- }
2369
- $bits = $this->lengthTableBits[$mode][$l];
2370
- $words = (1 << $bits) - 1;
2371
- if ($mode == QR_MODE_KJ) {
2372
- $words *= 2; // the number of bytes is required
2373
- }
2374
- return $words;
2375
- }
2376
-
2377
- /**
2378
- * Return an array of ECC specification.
2379
- * @param $version (int) version
2380
- * @param $level (int) error correction level
2381
- * @param $spec (array) an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code}
2382
- * @return array spec
2383
- */
2384
- protected function getEccSpec($version, $level, $spec) {
2385
- if (count($spec) < 5) {
2386
- $spec = array(0, 0, 0, 0, 0);
2387
- }
2388
- $b1 = $this->eccTable[$version][$level][0];
2389
- $b2 = $this->eccTable[$version][$level][1];
2390
- $data = $this->getDataLength($version, $level);
2391
- $ecc = $this->getECCLength($version, $level);
2392
- if ($b2 == 0) {
2393
- $spec[0] = $b1;
2394
- $spec[1] = (int)($data / $b1);
2395
- $spec[2] = (int)($ecc / $b1);
2396
- $spec[3] = 0;
2397
- $spec[4] = 0;
2398
- } else {
2399
- $spec[0] = $b1;
2400
- $spec[1] = (int)($data / ($b1 + $b2));
2401
- $spec[2] = (int)($ecc / ($b1 + $b2));
2402
- $spec[3] = $b2;
2403
- $spec[4] = $spec[1] + 1;
2404
- }
2405
- return $spec;
2406
- }
2407
-
2408
- /**
2409
- * Put an alignment marker.
2410
- * @param $frame (array) frame
2411
- * @param $ox (int) X center coordinate of the pattern
2412
- * @param $oy (int) Y center coordinate of the pattern
2413
- * @return array frame
2414
- */
2415
- protected function putAlignmentMarker($frame, $ox, $oy) {
2416
- $finder = array(
2417
- "\xa1\xa1\xa1\xa1\xa1",
2418
- "\xa1\xa0\xa0\xa0\xa1",
2419
- "\xa1\xa0\xa1\xa0\xa1",
2420
- "\xa1\xa0\xa0\xa0\xa1",
2421
- "\xa1\xa1\xa1\xa1\xa1"
2422
- );
2423
- $yStart = $oy - 2;
2424
- $xStart = $ox - 2;
2425
- for ($y=0; $y < 5; $y++) {
2426
- $frame = $this->qrstrset($frame, $xStart, $yStart+$y, $finder[$y]);
2427
- }
2428
- return $frame;
2429
- }
2430
-
2431
- /**
2432
- * Put an alignment pattern.
2433
- * @param $version (int) version
2434
- * @param $frame (array) frame
2435
- * @param $width (int) width
2436
- * @return array frame
2437
- */
2438
- protected function putAlignmentPattern($version, $frame, $width) {
2439
- if ($version < 2) {
2440
- return $frame;
2441
- }
2442
- $d = $this->alignmentPattern[$version][1] - $this->alignmentPattern[$version][0];
2443
- if ($d < 0) {
2444
- $w = 2;
2445
- } else {
2446
- $w = (int)(($width - $this->alignmentPattern[$version][0]) / $d + 2);
2447
- }
2448
- if ($w * $w - 3 == 1) {
2449
- $x = $this->alignmentPattern[$version][0];
2450
- $y = $this->alignmentPattern[$version][0];
2451
- $frame = $this->putAlignmentMarker($frame, $x, $y);
2452
- return $frame;
2453
- }
2454
- $cx = $this->alignmentPattern[$version][0];
2455
- $wo = $w - 1;
2456
- for ($x=1; $x < $wo; ++$x) {
2457
- $frame = $this->putAlignmentMarker($frame, 6, $cx);
2458
- $frame = $this->putAlignmentMarker($frame, $cx, 6);
2459
- $cx += $d;
2460
- }
2461
- $cy = $this->alignmentPattern[$version][0];
2462
- for ($y=0; $y < $wo; ++$y) {
2463
- $cx = $this->alignmentPattern[$version][0];
2464
- for ($x=0; $x < $wo; ++$x) {
2465
- $frame = $this->putAlignmentMarker($frame, $cx, $cy);
2466
- $cx += $d;
2467
- }
2468
- $cy += $d;
2469
- }
2470
- return $frame;
2471
- }
2472
-
2473
- /**
2474
- * Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits.
2475
- * @param $version (int) version
2476
- * @return BCH encoded version information pattern
2477
- */
2478
- protected function getVersionPattern($version) {
2479
- if (($version < 7) OR ($version > QRSPEC_VERSION_MAX)) {
2480
- return 0;
2481
- }
2482
- return $this->versionPattern[($version - 7)];
2483
- }
2484
-
2485
- /**
2486
- * Return BCH encoded format information pattern.
2487
- * @param $mask (array)
2488
- * @param $level (int) error correction level
2489
- * @return BCH encoded format information pattern
2490
- */
2491
- protected function getFormatInfo($mask, $level) {
2492
- if (($mask < 0) OR ($mask > 7)) {
2493
- return 0;
2494
- }
2495
- if (($level < 0) OR ($level > 3)) {
2496
- return 0;
2497
- }
2498
- return $this->formatInfo[$level][$mask];
2499
- }
2500
-
2501
- /**
2502
- * Put a finder pattern.
2503
- * @param $frame (array) frame
2504
- * @param $ox (int) X center coordinate of the pattern
2505
- * @param $oy (int) Y center coordinate of the pattern
2506
- * @return array frame
2507
- */
2508
- protected function putFinderPattern($frame, $ox, $oy) {
2509
- $finder = array(
2510
- "\xc1\xc1\xc1\xc1\xc1\xc1\xc1",
2511
- "\xc1\xc0\xc0\xc0\xc0\xc0\xc1",
2512
- "\xc1\xc0\xc1\xc1\xc1\xc0\xc1",
2513
- "\xc1\xc0\xc1\xc1\xc1\xc0\xc1",
2514
- "\xc1\xc0\xc1\xc1\xc1\xc0\xc1",
2515
- "\xc1\xc0\xc0\xc0\xc0\xc0\xc1",
2516
- "\xc1\xc1\xc1\xc1\xc1\xc1\xc1"
2517
- );
2518
- for ($y=0; $y < 7; $y++) {
2519
- $frame = $this->qrstrset($frame, $ox, ($oy + $y), $finder[$y]);
2520
- }
2521
- return $frame;
2522
- }
2523
-
2524
- /**
2525
- * Return a copy of initialized frame.
2526
- * @param $version (int) version
2527
- * @return Array of unsigned char.
2528
- */
2529
- protected function createFrame($version) {
2530
- $width = $this->capacity[$version][QRCAP_WIDTH];
2531
- $frameLine = str_repeat ("\0", $width);
2532
- $frame = array_fill(0, $width, $frameLine);
2533
- // Finder pattern
2534
- $frame = $this->putFinderPattern($frame, 0, 0);
2535
- $frame = $this->putFinderPattern($frame, $width - 7, 0);
2536
- $frame = $this->putFinderPattern($frame, 0, $width - 7);
2537
- // Separator
2538
- $yOffset = $width - 7;
2539
- for ($y=0; $y < 7; ++$y) {
2540
- $frame[$y][7] = "\xc0";
2541
- $frame[$y][$width - 8] = "\xc0";
2542
- $frame[$yOffset][7] = "\xc0";
2543
- ++$yOffset;
2544
- }
2545
- $setPattern = str_repeat("\xc0", 8);
2546
- $frame = $this->qrstrset($frame, 0, 7, $setPattern);
2547
- $frame = $this->qrstrset($frame, $width-8, 7, $setPattern);
2548
- $frame = $this->qrstrset($frame, 0, $width - 8, $setPattern);
2549
- // Format info
2550
- $setPattern = str_repeat("\x84", 9);
2551
- $frame = $this->qrstrset($frame, 0, 8, $setPattern);
2552
- $frame = $this->qrstrset($frame, $width - 8, 8, $setPattern, 8);
2553
- $yOffset = $width - 8;
2554
- for ($y=0; $y < 8; ++$y,++$yOffset) {
2555
- $frame[$y][8] = "\x84";
2556
- $frame[$yOffset][8] = "\x84";
2557
- }
2558
- // Timing pattern
2559
- $wo = $width - 15;
2560
- for ($i=1; $i < $wo; ++$i) {
2561
- $frame[6][7+$i] = chr(0x90 | ($i & 1));
2562
- $frame[7+$i][6] = chr(0x90 | ($i & 1));
2563
- }
2564
- // Alignment pattern
2565
- $frame = $this->putAlignmentPattern($version, $frame, $width);
2566
- // Version information
2567
- if ($version >= 7) {
2568
- $vinf = $this->getVersionPattern($version);
2569
- $v = $vinf;
2570
- for ($x=0; $x<6; ++$x) {
2571
- for ($y=0; $y<3; ++$y) {
2572
- $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1));
2573
- $v = $v >> 1;
2574
- }
2575
- }
2576
- $v = $vinf;
2577
- for ($y=0; $y<6; ++$y) {
2578
- for ($x=0; $x<3; ++$x) {
2579
- $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1));
2580
- $v = $v >> 1;
2581
- }
2582
- }
2583
- }
2584
- // and a little bit...
2585
- $frame[$width - 8][8] = "\x81";
2586
- return $frame;
2587
- }
2588
-
2589
- /**
2590
- * Set new frame for the specified version.
2591
- * @param $version (int) version
2592
- * @return Array of unsigned char.
2593
- */
2594
- protected function newFrame($version) {
2595
- if (($version < 1) OR ($version > QRSPEC_VERSION_MAX)) {
2596
- return NULL;
2597
- }
2598
- if (!isset($this->frames[$version])) {
2599
- $this->frames[$version] = $this->createFrame($version);
2600
- }
2601
- if (is_null($this->frames[$version])) {
2602
- return NULL;
2603
- }
2604
- return $this->frames[$version];
2605
- }
2606
-
2607
- /**
2608
- * Return block number 0
2609
- * @param $spec (array)
2610
- * @return int value
2611
- */
2612
- protected function rsBlockNum($spec) {
2613
- return ($spec[0] + $spec[3]);
2614
- }
2615
-
2616
- /**
2617
- * Return block number 1
2618
- * @param $spec (array)
2619
- * @return int value
2620
- */
2621
- protected function rsBlockNum1($spec) {
2622
- return $spec[0];
2623
- }
2624
-
2625
- /**
2626
- * Return data codes 1
2627
- * @param $spec (array)
2628
- * @return int value
2629
- */
2630
- protected function rsDataCodes1($spec) {
2631
- return $spec[1];
2632
- }
2633
-
2634
- /**
2635
- * Return ecc codes 1
2636
- * @param $spec (array)
2637
- * @return int value
2638
- */
2639
- protected function rsEccCodes1($spec) {
2640
- return $spec[2];
2641
- }
2642
-
2643
- /**
2644
- * Return block number 2
2645
- * @param $spec (array)
2646
- * @return int value
2647
- */
2648
- protected function rsBlockNum2($spec) {
2649
- return $spec[3];
2650
- }
2651
-
2652
- /**
2653
- * Return data codes 2
2654
- * @param $spec (array)
2655
- * @return int value
2656
- */
2657
- protected function rsDataCodes2($spec) {
2658
- return $spec[4];
2659
- }
2660
-
2661
- /**
2662
- * Return ecc codes 2
2663
- * @param $spec (array)
2664
- * @return int value
2665
- */
2666
- protected function rsEccCodes2($spec) {
2667
- return $spec[2];
2668
- }
2669
-
2670
- /**
2671
- * Return data length
2672
- * @param $spec (array)
2673
- * @return int value
2674
- */
2675
- protected function rsDataLength($spec) {
2676
- return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]);
2677
- }
2678
-
2679
- /**
2680
- * Return ecc length
2681
- * @param $spec (array)
2682
- * @return int value
2683
- */
2684
- protected function rsEccLength($spec) {
2685
- return ($spec[0] + $spec[3]) * $spec[2];
2686
- }
2687
-
2688
- // - - - - - - - - - - - - - - - - - - - - - - - - -
2689
-
2690
- // QRrs
2691
-
2692
- /**
2693
- * Initialize a Reed-Solomon codec and add it to existing rsitems
2694
- * @param $symsize (int) symbol size, bits
2695
- * @param $gfpoly (int) Field generator polynomial coefficients
2696
- * @param $fcr (int) first root of RS code generator polynomial, index form
2697
- * @param $prim (int) primitive element to generate polynomial roots
2698
- * @param $nroots (int) RS code generator polynomial degree (number of roots)
2699
- * @param $pad (int) padding bytes at front of shortened block
2700
- * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
2701
- */
2702
- protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
2703
- foreach ($this->rsitems as $rs) {
2704
- if (($rs['pad'] != $pad) OR ($rs['nroots'] != $nroots) OR ($rs['mm'] != $symsize)
2705
- OR ($rs['gfpoly'] != $gfpoly) OR ($rs['fcr'] != $fcr) OR ($rs['prim'] != $prim)) {
2706
- continue;
2707
- }
2708
- return $rs;
2709
- }
2710
- $rs = $this->init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad);
2711
- array_unshift($this->rsitems, $rs);
2712
- return $rs;
2713
- }
2714
-
2715
- // - - - - - - - - - - - - - - - - - - - - - - - - -
2716
-
2717
- // QRrsItem
2718
-
2719
- /**
2720
- * modnn
2721
- * @param $rs (array) RS values
2722
- * @param $x (int) X position
2723
- * @return int X osition
2724
- */
2725
- protected function modnn($rs, $x) {
2726
- while ($x >= $rs['nn']) {
2727
- $x -= $rs['nn'];
2728
- $x = ($x >> $rs['mm']) + ($x & $rs['nn']);
2729
- }
2730
- return $x;
2731
- }
2732
-
2733
- /**
2734
- * Initialize a Reed-Solomon codec and returns an array of values.
2735
- * @param $symsize (int) symbol size, bits
2736
- * @param $gfpoly (int) Field generator polynomial coefficients
2737
- * @param $fcr (int) first root of RS code generator polynomial, index form
2738
- * @param $prim (int) primitive element to generate polynomial roots
2739
- * @param $nroots (int) RS code generator polynomial degree (number of roots)
2740
- * @param $pad (int) padding bytes at front of shortened block
2741
- * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
2742
- */
2743
- protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
2744
- // Based on Reed solomon encoder by Phil Karn, KA9Q (GNU-LGPLv2)
2745
- $rs = null;
2746
- // Check parameter ranges
2747
- if (($symsize < 0) OR ($symsize > 8)) {
2748
- return $rs;
2749
- }
2750
- if (($fcr < 0) OR ($fcr >= (1<<$symsize))) {
2751
- return $rs;
2752
- }
2753
- if (($prim <= 0) OR ($prim >= (1<<$symsize))) {
2754
- return $rs;
2755
- }
2756
- if (($nroots < 0) OR ($nroots >= (1<<$symsize))) {
2757
- return $rs;
2758
- }
2759
- if (($pad < 0) OR ($pad >= ((1<<$symsize) -1 - $nroots))) {
2760
- return $rs;
2761
- }
2762
- $rs = array();
2763
- $rs['mm'] = $symsize;
2764
- $rs['nn'] = (1 << $symsize) - 1;
2765
- $rs['pad'] = $pad;
2766
- $rs['alpha_to'] = array_fill(0, ($rs['nn'] + 1), 0);
2767
- $rs['index_of'] = array_fill(0, ($rs['nn'] + 1), 0);
2768
- // PHP style macro replacement ;)
2769
- $NN =& $rs['nn'];
2770
- $A0 =& $NN;
2771
- // Generate Galois field lookup tables
2772
- $rs['index_of'][0] = $A0; // log(zero) = -inf
2773
- $rs['alpha_to'][$A0] = 0; // alpha**-inf = 0
2774
- $sr = 1;
2775
- for ($i=0; $i<$rs['nn']; ++$i) {
2776
- $rs['index_of'][$sr] = $i;
2777
- $rs['alpha_to'][$i] = $sr;
2778
- $sr <<= 1;
2779
- if ($sr & (1 << $symsize)) {
2780
- $sr ^= $gfpoly;
2781
- }
2782
- $sr &= $rs['nn'];
2783
- }
2784
- if ($sr != 1) {
2785
- // field generator polynomial is not primitive!
2786
- return NULL;
2787
- }
2788
- // Form RS code generator polynomial from its roots
2789
- $rs['genpoly'] = array_fill(0, ($nroots + 1), 0);
2790
- $rs['fcr'] = $fcr;
2791
- $rs['prim'] = $prim;
2792
- $rs['nroots'] = $nroots;
2793
- $rs['gfpoly'] = $gfpoly;
2794
- // Find prim-th root of 1, used in decoding
2795
- for ($iprim=1; ($iprim % $prim) != 0; $iprim += $rs['nn']) {
2796
- ; // intentional empty-body loop!
2797
- }
2798
- $rs['iprim'] = (int)($iprim / $prim);
2799
- $rs['genpoly'][0] = 1;
2800
- for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) {
2801
- $rs['genpoly'][$i+1] = 1;
2802
- // Multiply rs->genpoly[] by @**(root + x)
2803
- for ($j = $i; $j > 0; --$j) {
2804
- if ($rs['genpoly'][$j] != 0) {
2805
- $rs['genpoly'][$j] = $rs['genpoly'][$j-1] ^ $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][$j]] + $root)];
2806
- } else {
2807
- $rs['genpoly'][$j] = $rs['genpoly'][$j-1];
2808
- }
2809
- }
2810
- // rs->genpoly[0] can never be zero
2811
- $rs['genpoly'][0] = $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][0]] + $root)];
2812
- }
2813
- // convert rs->genpoly[] to index form for quicker encoding
2814
- for ($i = 0; $i <= $nroots; ++$i) {
2815
- $rs['genpoly'][$i] = $rs['index_of'][$rs['genpoly'][$i]];
2816
- }
2817
- return $rs;
2818
- }
2819
-
2820
- /**
2821
- * Encode a Reed-Solomon codec and returns the parity array
2822
- * @param $rs (array) RS values
2823
- * @param $data (array) data
2824
- * @param $parity (array) parity
2825
- * @return parity array
2826
- */
2827
- protected function encode_rs_char($rs, $data, $parity) {
2828
- $MM =& $rs['mm']; // bits per symbol
2829
- $NN =& $rs['nn']; // the total number of symbols in a RS block
2830
- $ALPHA_TO =& $rs['alpha_to']; // the address of an array of NN elements to convert Galois field elements in index (log) form to polynomial form
2831
- $INDEX_OF =& $rs['index_of']; // the address of an array of NN elements to convert Galois field elements in polynomial form to index (log) form
2832
- $GENPOLY =& $rs['genpoly']; // an array of NROOTS+1 elements containing the generator polynomial in index form
2833
- $NROOTS =& $rs['nroots']; // the number of roots in the RS code generator polynomial, which is the same as the number of parity symbols in a block
2834
- $FCR =& $rs['fcr']; // first consecutive root, index form
2835
- $PRIM =& $rs['prim']; // primitive element, index form
2836
- $IPRIM =& $rs['iprim']; // prim-th root of 1, index form
2837
- $PAD =& $rs['pad']; // the number of pad symbols in a block
2838
- $A0 =& $NN;
2839
- $parity = array_fill(0, $NROOTS, 0);
2840
- for ($i=0; $i < ($NN - $NROOTS - $PAD); $i++) {
2841
- $feedback = $INDEX_OF[$data[$i] ^ $parity[0]];
2842
- if ($feedback != $A0) {
2843
- // feedback term is non-zero
2844
- // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must
2845
- // always be for the polynomials constructed by init_rs()
2846
- $feedback = $this->modnn($rs, $NN - $GENPOLY[$NROOTS] + $feedback);
2847
- for ($j=1; $j < $NROOTS; ++$j) {
2848
- $parity[$j] ^= $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[($NROOTS - $j)])];
2849
- }
2850
- }
2851
- // Shift
2852
- array_shift($parity);
2853
- if ($feedback != $A0) {
2854
- array_push($parity, $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[0])]);
2855
- } else {
2856
- array_push($parity, 0);
2857
- }
2858
- }
2859
- return $parity;
2860
- }
2861
-
2862
- } // end QRcode class
2863
-
2864
- //============================================================+
2865
- // END OF FILE
2866
- //============================================================+
 
1
+ <?php
2
+ //============================================================+
3
+ // File name : qrcode.php
4
+ // Version : 1.0.010
5
+ // Begin : 2010-03-22
6
+ // Last Update : 2012-07-25
7
+ // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
+ // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
+ // -------------------------------------------------------------------
10
+ // Copyright (C) 2010-2012 Nicola Asuni - Tecnick.com LTD
11
+ //
12
+ // This file is part of TCPDF software library.
13
+ //
14
+ // TCPDF is free software: you can redistribute it and/or modify it
15
+ // under the terms of the GNU Lesser General Public License as
16
+ // published by the Free Software Foundation, either version 3 of the
17
+ // License, or (at your option) any later version.
18
+ //
19
+ // TCPDF is distributed in the hope that it will be useful, but
20
+ // WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
+ // See the GNU Lesser General Public License for more details.
23
+ //
24
+ // You should have received a copy of the GNU Lesser General Public License
25
+ // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
+ //
27
+ // See LICENSE.TXT file for more information.
28
+ // -------------------------------------------------------------------
29
+ //
30
+ // DESCRIPTION :
31
+ //
32
+ // Class to create QR-code arrays for TCPDF class.
33
+ // QR Code symbol is a 2D barcode that can be scanned by
34
+ // handy terminals such as a mobile phone with CCD.
35
+ // The capacity of QR Code is up to 7000 digits or 4000
36
+ // characters, and has high robustness.
37
+ // This class supports QR Code model 2, described in
38
+ // JIS (Japanese Industrial Standards) X0510:2004
39
+ // or ISO/IEC 18004.
40
+ // Currently the following features are not supported:
41
+ // ECI and FNC1 mode, Micro QR Code, QR Code model 1,
42
+ // Structured mode.
43
+ //
44
+ // This class is derived from the following projects:
45
+ // ---------------------------------------------------------
46
+ // "PHP QR Code encoder"
47
+ // License: GNU-LGPLv3
48
+ // Copyright (C) 2010 by Dominik Dzienia <deltalab at poczta dot fm>
49
+ // http://phpqrcode.sourceforge.net/
50
+ // https://sourceforge.net/projects/phpqrcode/
51
+ //
52
+ // The "PHP QR Code encoder" is based on
53
+ // "C libqrencode library" (ver. 3.1.1)
54
+ // License: GNU-LGPL 2.1
55
+ // Copyright (C) 2006-2010 by Kentaro Fukuchi
56
+ // http://megaui.net/fukuchi/works/qrencode/index.en.html
57
+ //
58
+ // Reed-Solomon code encoder is written by Phil Karn, KA9Q.
59
+ // Copyright (C) 2002-2006 Phil Karn, KA9Q
60
+ //
61
+ // QR Code is registered trademark of DENSO WAVE INCORPORATED
62
+ // http://www.denso-wave.com/qrcode/index-e.html
63
+ // ---------------------------------------------------------
64
+ //============================================================+
65
+
66
+ /**
67
+ * @file
68
+ * Class to create QR-code arrays for TCPDF class.
69
+ * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD.
70
+ * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness.
71
+ * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004.
72
+ * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.
73
+ *
74
+ * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html).
75
+ * Please read comments on this class source file for full copyright and license information.
76
+ *
77
+ * @package com.tecnick.tcpdf
78
+ * @author Nicola Asuni
79
+ * @version 1.0.010
80
+ */
81
+
82
+ // definitions
83
+ if (!defined('QRCODEDEFS')) {
84
+
85
+ /**
86
+ * Indicate that definitions for this class are set
87
+ */
88
+ define('QRCODEDEFS', true);
89
+
90
+ // -----------------------------------------------------
91
+
92
+ // Encoding modes (characters which can be encoded in QRcode)
93
+
94
+ /**
95
+ * Encoding mode
96
+ */
97
+ define('QR_MODE_NL', -1);
98
+
99
+ /**
100
+ * Encoding mode numeric (0-9). 3 characters are encoded to 10bit length. In theory, 7089 characters or less can be stored in a QRcode.
101
+ */
102
+ define('QR_MODE_NM', 0);
103
+
104
+ /**
105
+ * Encoding mode alphanumeric (0-9A-Z $%*+-./:) 45characters. 2 characters are encoded to 11bit length. In theory, 4296 characters or less can be stored in a QRcode.
106
+ */
107
+ define('QR_MODE_AN', 1);
108
+
109
+ /**
110
+ * Encoding mode 8bit byte data. In theory, 2953 characters or less can be stored in a QRcode.
111
+ */
112
+ define('QR_MODE_8B', 2);
113
+
114
+ /**
115
+ * Encoding mode KANJI. A KANJI character (multibyte character) is encoded to 13bit length. In theory, 1817 characters or less can be stored in a QRcode.
116
+ */
117
+ define('QR_MODE_KJ', 3);
118
+
119
+ /**
120
+ * Encoding mode STRUCTURED (currently unsupported)
121
+ */
122
+ define('QR_MODE_ST', 4);
123
+
124
+ // -----------------------------------------------------
125
+
126
+ // Levels of error correction.
127
+ // QRcode has a function of an error correcting for miss reading that white is black.
128
+ // Error correcting is defined in 4 level as below.
129
+
130
+ /**
131
+ * Error correction level L : About 7% or less errors can be corrected.
132
+ */
133
+ define('QR_ECLEVEL_L', 0);
134
+
135
+ /**
136
+ * Error correction level M : About 15% or less errors can be corrected.
137
+ */
138
+ define('QR_ECLEVEL_M', 1);
139
+
140
+ /**
141
+ * Error correction level Q : About 25% or less errors can be corrected.
142
+ */
143
+ define('QR_ECLEVEL_Q', 2);
144
+
145
+ /**
146
+ * Error correction level H : About 30% or less errors can be corrected.
147
+ */
148
+ define('QR_ECLEVEL_H', 3);
149
+
150
+ // -----------------------------------------------------
151
+
152
+ // Version. Size of QRcode is defined as version.
153
+ // Version is from 1 to 40.
154
+ // Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases.
155
+ // So version 40 is 177*177 matrix.
156
+
157
+ /**
158
+ * Maximum QR Code version.
159
+ */
160
+ define('QRSPEC_VERSION_MAX', 40);
161
+
162
+ /**
163
+ * Maximum matrix size for maximum version (version 40 is 177*177 matrix).
164
+ */
165
+ define('QRSPEC_WIDTH_MAX', 177);
166
+
167
+ // -----------------------------------------------------
168
+
169
+ /**
170
+ * Matrix index to get width from $capacity array.
171
+ */
172
+ define('QRCAP_WIDTH', 0);
173
+
174
+ /**
175
+ * Matrix index to get number of words from $capacity array.
176
+ */
177
+ define('QRCAP_WORDS', 1);
178
+
179
+ /**
180
+ * Matrix index to get remainder from $capacity array.
181
+ */
182
+ define('QRCAP_REMINDER', 2);
183
+
184
+ /**
185
+ * Matrix index to get error correction level from $capacity array.
186
+ */
187
+ define('QRCAP_EC', 3);
188
+
189
+ // -----------------------------------------------------
190
+
191
+ // Structure (currently usupported)
192
+
193
+ /**
194
+ * Number of header bits for structured mode
195
+ */
196
+ define('STRUCTURE_HEADER_BITS', 20);
197
+
198
+ /**
199
+ * Max number of symbols for structured mode
200
+ */
201
+ define('MAX_STRUCTURED_SYMBOLS', 16);
202
+
203
+ // -----------------------------------------------------
204
+
205
+ // Masks
206
+
207
+ /**
208
+ * Down point base value for case 1 mask pattern (concatenation of same color in a line or a column)
209
+ */
210
+ define('N1', 3);
211
+
212
+ /**
213
+ * Down point base value for case 2 mask pattern (module block of same color)
214
+ */
215
+ define('N2', 3);
216
+
217
+ /**
218
+ * Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column)
219
+ */
220
+ define('N3', 40);
221
+
222
+ /**
223
+ * Down point base value for case 4 mask pattern (ration of dark modules in whole)
224
+ */
225
+ define('N4', 10);
226
+
227
+ // -----------------------------------------------------
228
+
229
+ // Optimization settings
230
+
231
+ /**
232
+ * if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code
233
+ */
234
+ define('QR_FIND_BEST_MASK', true);
235
+
236
+ /**
237
+ * if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly
238
+ */
239
+ define('QR_FIND_FROM_RANDOM', 2);
240
+
241
+ /**
242
+ * when QR_FIND_BEST_MASK === false
243
+ */
244
+ define('QR_DEFAULT_MASK', 2);
245
+
246
+ // -----------------------------------------------------
247
+
248
+ } // end of definitions
249
+
250
+ // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
251
+
252
+ // for compatibility with PHP4
253
+ if (!function_exists('str_split')) {
254
+ /**
255
+ * Convert a string to an array (needed for PHP4 compatibility)
256
+ * @param $string (string) The input string.
257
+ * @param $split_length (int) Maximum length of the chunk.
258
+ * @return If the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element.
259
+ */
260
+ function str_split($string, $split_length=1) {
261
+ if ((strlen($string) > $split_length) OR (!$split_length)) {
262
+ do {
263
+ $c = strlen($string);
264
+ $parts[] = substr($string, 0, $split_length);
265
+ $string = substr($string, $split_length);
266
+ } while ($string !== false);
267
+ } else {
268
+ $parts = array($string);
269
+ }
270
+ return $parts;
271
+ }
272
+ }
273
+
274
+ // #####################################################
275
+
276
+ /**
277
+ * @class QRcode
278
+ * Class to create QR-code arrays for TCPDF class.
279
+ * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD.
280
+ * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness.
281
+ * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004.
282
+ * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.
283
+ *
284
+ * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html).
285
+ * Please read comments on this class source file for full copyright and license information.
286
+ *
287
+ * @package com.tecnick.tcpdf
288
+ * @author Nicola Asuni
289
+ * @version 1.0.010
290
+ */
291
+ class QRcode {
292
+
293
+ /**
294
+ * Barcode array to be returned which is readable by TCPDF.
295
+ * @protected
296
+ */
297
+ protected $barcode_array = array();
298
+
299
+ /**
300
+ * QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix.
301
+ * @protected
302
+ */
303
+ protected $version = 0;
304
+
305
+ /**
306
+ * Levels of error correction. See definitions for possible values.
307
+ * @protected
308
+ */
309
+ protected $level = QR_ECLEVEL_L;
310
+
311
+ /**
312
+ * Encoding mode.
313
+ * @protected
314
+ */
315
+ protected $hint = QR_MODE_8B;
316
+
317
+ /**
318
+ * Boolean flag, if true the input string will be converted to uppercase.
319
+ * @protected
320
+ */
321
+ protected $casesensitive = true;
322
+
323
+ /**
324
+ * Structured QR code (not supported yet).
325
+ * @protected
326
+ */
327
+ protected $structured = 0;
328
+
329
+ /**
330
+ * Mask data.
331
+ * @protected
332
+ */
333
+ protected $data;
334
+
335
+ // FrameFiller
336
+
337
+ /**
338
+ * Width.
339
+ * @protected
340
+ */
341
+ protected $width;
342
+
343
+ /**
344
+ * Frame.
345
+ * @protected
346
+ */
347
+ protected $frame;
348
+
349
+ /**
350
+ * X position of bit.
351
+ * @protected
352
+ */
353
+ protected $x;
354
+
355
+ /**
356
+ * Y position of bit.
357
+ * @protected
358
+ */
359
+ protected $y;
360
+
361
+ /**
362
+ * Direction.
363
+ * @protected
364
+ */
365
+ protected $dir;
366
+
367
+ /**
368
+ * Single bit value.
369
+ * @protected
370
+ */
371
+ protected $bit;
372
+
373
+ // ---- QRrawcode ----
374
+
375
+ /**
376
+ * Data code.
377
+ * @protected
378
+ */
379
+ protected $datacode = array();
380
+
381
+ /**
382
+ * Error correction code.
383
+ * @protected
384
+ */
385
+ protected $ecccode = array();
386
+
387
+ /**
388
+ * Blocks.
389
+ * @protected
390
+ */
391
+ protected $blocks;
392
+
393
+ /**
394
+ * Reed-Solomon blocks.
395
+ * @protected
396
+ */
397
+ protected $rsblocks = array(); //of RSblock
398
+
399
+ /**
400
+ * Counter.
401
+ * @protected
402
+ */
403
+ protected $count;
404
+
405
+ /**
406
+ * Data length.
407
+ * @protected
408
+ */
409
+ protected $dataLength;
410
+
411
+ /**
412
+ * Error correction length.
413
+ * @protected
414
+ */
415
+ protected $eccLength;
416
+
417
+ /**
418
+ * Value b1.
419
+ * @protected
420
+ */
421
+ protected $b1;
422
+
423
+ // ---- QRmask ----
424
+
425
+ /**
426
+ * Run length.
427
+ * @protected
428
+ */
429
+ protected $runLength = array();
430
+
431
+ // ---- QRsplit ----
432
+
433
+ /**
434
+ * Input data string.
435
+ * @protected
436
+ */
437
+ protected $dataStr = '';
438
+
439
+ /**
440
+ * Input items.
441
+ * @protected
442
+ */
443
+ protected $items;
444
+
445
+ // Reed-Solomon items
446
+
447
+ /**
448
+ * Reed-Solomon items.
449
+ * @protected
450
+ */
451
+ protected $rsitems = array();
452
+
453
+ /**
454
+ * Array of frames.
455
+ * @protected
456
+ */
457
+ protected $frames = array();
458
+
459
+ /**
460
+ * Alphabet-numeric convesion table.
461
+ * @protected
462
+ */
463
+ protected $anTable = array(
464
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
465
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
466
+ 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, //
467
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, //
468
+ -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, //
469
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, //
470
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, //
471
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 //
472
+ );
473
+
474
+ /**
475
+ * Array Table of the capacity of symbols.
476
+ * See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004.
477
+ * @protected
478
+ */
479
+ protected $capacity = array(
480
+ array( 0, 0, 0, array( 0, 0, 0, 0)), //
481
+ array( 21, 26, 0, array( 7, 10, 13, 17)), // 1
482
+ array( 25, 44, 7, array( 10, 16, 22, 28)), //
483
+ array( 29, 70, 7, array( 15, 26, 36, 44)), //
484
+ array( 33, 100, 7, array( 20, 36, 52, 64)), //
485
+ array( 37, 134, 7, array( 26, 48, 72, 88)), // 5
486
+ array( 41, 172, 7, array( 36, 64, 96, 112)), //
487
+ array( 45, 196, 0, array( 40, 72, 108, 130)), //
488
+ array( 49, 242, 0, array( 48, 88, 132, 156)), //
489
+ array( 53, 292, 0, array( 60, 110, 160, 192)), //
490
+ array( 57, 346, 0, array( 72, 130, 192, 224)), // 10
491
+ array( 61, 404, 0, array( 80, 150, 224, 264)), //
492
+ array( 65, 466, 0, array( 96, 176, 260, 308)), //
493
+ array( 69, 532, 0, array( 104, 198, 288, 352)), //
494
+ array( 73, 581, 3, array( 120, 216, 320, 384)), //
495
+ array( 77, 655, 3, array( 132, 240, 360, 432)), // 15
496
+ array( 81, 733, 3, array( 144, 280, 408, 480)), //
497
+ array( 85, 815, 3, array( 168, 308, 448, 532)), //
498
+ array( 89, 901, 3, array( 180, 338, 504, 588)), //
499
+ array( 93, 991, 3, array( 196, 364, 546, 650)), //
500
+ array( 97, 1085, 3, array( 224, 416, 600, 700)), // 20
501
+ array(101, 1156, 4, array( 224, 442, 644, 750)), //
502
+ array(105, 1258, 4, array( 252, 476, 690, 816)), //
503
+ array(109, 1364, 4, array( 270, 504, 750, 900)), //
504
+ array(113, 1474, 4, array( 300, 560, 810, 960)), //
505
+ array(117, 1588, 4, array( 312, 588, 870, 1050)), // 25
506
+ array(121, 1706, 4, array( 336, 644, 952, 1110)), //
507
+ array(125, 1828, 4, array( 360, 700, 1020, 1200)), //
508
+ array(129, 1921, 3, array( 390, 728, 1050, 1260)), //
509
+ array(133, 2051, 3, array( 420, 784, 1140, 1350)), //
510
+ array(137, 2185, 3, array( 450, 812, 1200, 1440)), // 30
511
+ array(141, 2323, 3, array( 480, 868, 1290, 1530)), //
512
+ array(145, 2465, 3, array( 510, 924, 1350, 1620)), //
513
+ array(149, 2611, 3, array( 540, 980, 1440, 1710)), //
514
+ array(153, 2761, 3, array( 570, 1036, 1530, 1800)), //
515
+ array(157, 2876, 0, array( 570, 1064, 1590, 1890)), // 35
516
+ array(161, 3034, 0, array( 600, 1120, 1680, 1980)), //
517
+ array(165, 3196, 0, array( 630, 1204, 1770, 2100)), //
518
+ array(169, 3362, 0, array( 660, 1260, 1860, 2220)), //
519
+ array(173, 3532, 0, array( 720, 1316, 1950, 2310)), //
520
+ array(177, 3706, 0, array( 750, 1372, 2040, 2430)) // 40
521
+ );
522
+
523
+ /**
524
+ * Array Length indicator.
525
+ * @protected
526
+ */
527
+ protected $lengthTableBits = array(
528
+ array(10, 12, 14),
529
+ array( 9, 11, 13),
530
+ array( 8, 16, 16),
531
+ array( 8, 10, 12)
532
+ );
533
+
534
+ /**
535
+ * Array Table of the error correction code (Reed-Solomon block).
536
+ * See Table 12-16 (pp.30-36), JIS X0510:2004.
537
+ * @protected
538
+ */
539
+ protected $eccTable = array(
540
+ array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), //
541
+ array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1
542
+ array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), //
543
+ array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), //
544
+ array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), //
545
+ array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5
546
+ array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), //
547
+ array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), //
548
+ array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), //
549
+ array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), //
550
+ array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), // 10
551
+ array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), //
552
+ array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), //
553
+ array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), //
554
+ array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), //
555
+ array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), // 15
556
+ array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), //
557
+ array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), //
558
+ array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), //
559
+ array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), //
560
+ array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), // 20
561
+ array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), //
562
+ array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), //
563
+ array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), //
564
+ array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), //
565
+ array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), // 25
566
+ array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), //
567
+ array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), //
568
+ array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), //
569
+ array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), //
570
+ array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), // 30
571
+ array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), //
572
+ array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), //
573
+ array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), //
574
+ array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), //
575
+ array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), // 35
576
+ array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), //
577
+ array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), //
578
+ array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), //
579
+ array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), //
580
+ array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)) // 40
581
+ );
582
+
583
+ /**
584
+ * Array Positions of alignment patterns.
585
+ * This array includes only the second and the third position of the alignment patterns. Rest of them can be calculated from the distance between them.
586
+ * See Table 1 in Appendix E (pp.71) of JIS X0510:2004.
587
+ * @protected
588
+ */
589
+ protected $alignmentPattern = array(
590
+ array( 0, 0),
591
+ array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5
592
+ array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10
593
+ array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), // 11-15
594
+ array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), // 16-20
595
+ array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), // 21-25
596
+ array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), // 26-30
597
+ array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), // 31-35
598
+ array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58) // 35-40
599
+ );
600
+
601
+ /**
602
+ * Array Version information pattern (BCH coded).
603
+ * See Table 1 in Appendix D (pp.68) of JIS X0510:2004.
604
+ * size: [QRSPEC_VERSION_MAX - 6]
605
+ * @protected
606
+ */
607
+ protected $versionPattern = array(
608
+ 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, //
609
+ 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, //
610
+ 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, //
611
+ 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, //
612
+ 0x27541, 0x28c69
613
+ );
614
+
615
+ /**
616
+ * Array Format information
617
+ * @protected
618
+ */
619
+ protected $formatInfo = array(
620
+ array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), //
621
+ array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), //
622
+ array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), //
623
+ array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) //
624
+ );
625
+
626
+
627
+ // -------------------------------------------------
628
+ // -------------------------------------------------
629
+
630
+
631
+ /**
632
+ * This is the class constructor.
633
+ * Creates a QRcode object
634
+ * @param $code (string) code to represent using QRcode
635
+ * @param $eclevel (string) error level: <ul><li>L : About 7% or less errors can be corrected.</li><li>M : About 15% or less errors can be corrected.</li><li>Q : About 25% or less errors can be corrected.</li><li>H : About 30% or less errors can be corrected.</li></ul>
636
+ * @public
637
+ * @since 1.0.000
638
+ */
639
+ public function __construct($code, $eclevel = 'L') {
640
+ $barcode_array = array();
641
+ if ((is_null($code)) OR ($code == '\0') OR ($code == '')) {
642
+ return false;
643
+ }
644
+ // set error correction level
645
+ $this->level = array_search($eclevel, array('L', 'M', 'Q', 'H'));
646
+ if ($this->level === false) {
647
+ $this->level = QR_ECLEVEL_L;
648
+ }
649
+ if (($this->hint != QR_MODE_8B) AND ($this->hint != QR_MODE_KJ)) {
650
+ return false;
651
+ }
652
+ if (($this->version < 0) OR ($this->version > QRSPEC_VERSION_MAX)) {
653
+ return false;
654
+ }
655
+ $this->items = array();
656
+ $this->encodeString($code);
657
+ if (is_null($this->data)) {
658
+ return false;
659
+ }
660
+ $qrTab = $this->binarize($this->data);
661
+ $size = count($qrTab);
662
+ $barcode_array['num_rows'] = $size;
663
+ $barcode_array['num_cols'] = $size;
664
+ $barcode_array['bcode'] = array();
665
+ foreach ($qrTab as $line) {
666
+ $arrAdd = array();
667
+ foreach (str_split($line) as $char) {
668
+ $arrAdd[] = ($char=='1')?1:0;
669
+ }
670
+ $barcode_array['bcode'][] = $arrAdd;
671
+ }
672
+ $this->barcode_array = $barcode_array;
673
+ }
674
+
675
+ /**
676
+ * Returns a barcode array which is readable by TCPDF
677
+ * @return array barcode array readable by TCPDF;
678
+ * @public
679
+ */
680
+ public function getBarcodeArray() {
681
+ return $this->barcode_array;
682
+ }
683
+
684
+ /**
685
+ * Convert the frame in binary form
686
+ * @param $frame (array) array to binarize
687
+ * @return array frame in binary form
688
+ */
689
+ protected function binarize($frame) {
690
+ $len = count($frame);
691
+ // the frame is square (width = height)
692
+ foreach ($frame as &$frameLine) {
693
+ for ($i=0; $i<$len; $i++) {
694
+ $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0';
695
+ }
696
+ }
697
+ return $frame;
698
+ }
699
+
700
+ /**
701
+ * Encode the input string to QR code
702
+ * @param $string (string) input string to encode
703
+ */
704
+ protected function encodeString($string) {
705
+ $this->dataStr = $string;
706
+ if (!$this->casesensitive) {
707
+ $this->toUpper();
708
+ }
709
+ $ret = $this->splitString();
710
+ if ($ret < 0) {
711
+ return NULL;
712
+ }
713
+ $this->encodeMask(-1);
714
+ }
715
+
716
+ /**
717
+ * Encode mask
718
+ * @param $mask (int) masking mode
719
+ */
720
+ protected function encodeMask($mask) {
721
+ $spec = array(0, 0, 0, 0, 0);
722
+ $this->datacode = $this->getByteStream($this->items);
723
+
724
+ if (is_null($this->datacode)) {
725
+ return NULL;
726
+ }
727
+ $spec = $this->getEccSpec($this->version, $this->level, $spec);
728
+ $this->b1 = $this->rsBlockNum1($spec);
729
+ $this->dataLength = $this->rsDataLength($spec);
730
+ $this->eccLength = $this->rsEccLength($spec);
731
+ $this->ecccode = array_fill(0, $this->eccLength, 0);
732
+ $this->blocks = $this->rsBlockNum($spec);
733
+ $ret = $this->init($spec);
734
+ if ($ret < 0) {
735
+ return NULL;
736
+ }
737
+ $this->count = 0;
738
+ $this->width = $this->getWidth($this->version);
739
+ $this->frame = $this->newFrame($this->version);
740
+ $this->x = $this->width - 1;
741
+ $this->y = $this->width - 1;
742
+ $this->dir = -1;
743
+ $this->bit = -1;
744
+ // inteleaved data and ecc codes
745
+ for ($i=0; $i < ($this->dataLength + $this->eccLength); $i++) {
746
+ $code = $this->getCode();
747
+ $bit = 0x80;
748
+ for ($j=0; $j<8; $j++) {
749
+ $addr = $this->getNextPosition();
750
+ $this->setFrameAt($addr, 0x02 | (($bit & $code) != 0));
751
+ $bit = $bit >> 1;
752
+ }
753
+ }
754
+ // remainder bits
755
+ $j = $this->getRemainder($this->version);
756
+ for ($i=0; $i<$j; $i++) {
757
+ $addr = $this->getNextPosition();
758
+ $this->setFrameAt($addr, 0x02);
759
+ }
760
+ // masking
761
+ $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0);
762
+ if ($mask < 0) {
763
+ if (QR_FIND_BEST_MASK) {
764
+ $masked = $this->mask($this->width, $this->frame, $this->level);
765
+ } else {
766
+ $masked = $this->makeMask($this->width, $this->frame, (intval(QR_DEFAULT_MASK) % 8), $this->level);
767
+ }
768
+ } else {
769
+ $masked = $this->makeMask($this->width, $this->frame, $mask, $this->level);
770
+ }
771
+ if ($masked == NULL) {
772
+ return NULL;
773
+ }
774
+ $this->data = $masked;
775
+ }
776
+
777
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
778
+
779
+ // FrameFiller
780
+
781
+ /**
782
+ * Set frame value at specified position
783
+ * @param $at (array) x,y position
784
+ * @param $val (int) value of the character to set
785
+ */
786
+ protected function setFrameAt($at, $val) {
787
+ $this->frame[$at['y']][$at['x']] = chr($val);
788
+ }
789
+
790
+ /**
791
+ * Get frame value at specified position
792
+ * @param $at (array) x,y position
793
+ * @return value at specified position
794
+ */
795
+ protected function getFrameAt($at) {
796
+ return ord($this->frame[$at['y']][$at['x']]);
797
+ }
798
+
799
+ /**
800
+ * Return the next frame position
801
+ * @return array of x,y coordinates
802
+ */
803
+ protected function getNextPosition() {
804
+ do {
805
+ if ($this->bit == -1) {
806
+ $this->bit = 0;
807
+ return array('x'=>$this->x, 'y'=>$this->y);
808
+ }
809
+ $x = $this->x;
810
+ $y = $this->y;
811
+ $w = $this->width;
812
+ if ($this->bit == 0) {
813
+ $x--;
814
+ $this->bit++;
815
+ } else {
816
+ $x++;
817
+ $y += $this->dir;
818
+ $this->bit--;
819
+ }
820
+ if ($this->dir < 0) {
821
+ if ($y < 0) {
822
+ $y = 0;
823
+ $x -= 2;
824
+ $this->dir = 1;
825
+ if ($x == 6) {
826
+ $x--;
827
+ $y = 9;
828
+ }
829
+ }
830
+ } else {
831
+ if ($y == $w) {
832
+ $y = $w - 1;
833
+ $x -= 2;
834
+ $this->dir = -1;
835
+ if ($x == 6) {
836
+ $x--;
837
+ $y -= 8;
838
+ }
839
+ }
840
+ }
841
+ if (($x < 0) OR ($y < 0)) {
842
+ return NULL;
843
+ }
844
+ $this->x = $x;
845
+ $this->y = $y;
846
+ } while(ord($this->frame[$y][$x]) & 0x80);
847
+ return array('x'=>$x, 'y'=>$y);
848
+ }
849
+
850
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
851
+
852
+ // QRrawcode
853
+
854
+ /**
855
+ * Initialize code.
856
+ * @param $spec (array) array of ECC specification
857
+ * @return 0 in case of success, -1 in case of error
858
+ */
859
+ protected function init($spec) {
860
+ $dl = $this->rsDataCodes1($spec);
861
+ $el = $this->rsEccCodes1($spec);
862
+ $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);
863
+ $blockNo = 0;
864
+ $dataPos = 0;
865
+ $eccPos = 0;
866
+ $endfor = $this->rsBlockNum1($spec);
867
+ for ($i=0; $i < $endfor; ++$i) {
868
+ $ecc = array_slice($this->ecccode, $eccPos);
869
+ $this->rsblocks[$blockNo] = array();
870
+ $this->rsblocks[$blockNo]['dataLength'] = $dl;
871
+ $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos);
872
+ $this->rsblocks[$blockNo]['eccLength'] = $el;
873
+ $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc);
874
+ $this->rsblocks[$blockNo]['ecc'] = $ecc;
875
+ $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc);
876
+ $dataPos += $dl;
877
+ $eccPos += $el;
878
+ $blockNo++;
879
+ }
880
+ if ($this->rsBlockNum2($spec) == 0) {
881
+ return 0;
882
+ }
883
+ $dl = $this->rsDataCodes2($spec);
884
+ $el = $this->rsEccCodes2($spec);
885
+ $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el);
886
+ if ($rs == NULL) {
887
+ return -1;
888
+ }
889
+ $endfor = $this->rsBlockNum2($spec);
890
+ for ($i=0; $i < $endfor; ++$i) {
891
+ $ecc = array_slice($this->ecccode, $eccPos);
892
+ $this->rsblocks[$blockNo] = array();
893
+ $this->rsblocks[$blockNo]['dataLength'] = $dl;
894
+ $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos);
895
+ $this->rsblocks[$blockNo]['eccLength'] = $el;
896
+ $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc);
897
+ $this->rsblocks[$blockNo]['ecc'] = $ecc;
898
+ $this->ecccode = array_merge(array_slice($this->ecccode, 0, $eccPos), $ecc);
899
+ $dataPos += $dl;
900
+ $eccPos += $el;
901
+ $blockNo++;
902
+ }
903
+ return 0;
904
+ }
905
+
906
+ /**
907
+ * Return Reed-Solomon block code.
908
+ * @return array rsblocks
909
+ */
910
+ protected function getCode() {
911
+ if ($this->count < $this->dataLength) {
912
+ $row = $this->count % $this->blocks;
913
+ $col = $this->count / $this->blocks;
914
+ if ($col >= $this->rsblocks[0]['dataLength']) {
915
+ $row += $this->b1;
916
+ }
917
+ $ret = $this->rsblocks[$row]['data'][$col];
918
+ } elseif ($this->count < $this->dataLength + $this->eccLength) {
919
+ $row = ($this->count - $this->dataLength) % $this->blocks;
920
+ $col = ($this->count - $this->dataLength) / $this->blocks;
921
+ $ret = $this->rsblocks[$row]['ecc'][$col];
922
+ } else {
923
+ return 0;
924
+ }
925
+ $this->count++;
926
+ return $ret;
927
+ }
928
+
929
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
930
+
931
+ // QRmask
932
+
933
+ /**
934
+ * Write Format Information on frame and returns the number of black bits
935
+ * @param $width (int) frame width
936
+ * @param $frame (array) frame
937
+ * @param $mask (array) masking mode
938
+ * @param $level (int) error correction level
939
+ * @return int blacks
940
+ */
941
+ protected function writeFormatInformation($width, &$frame, $mask, $level) {
942
+ $blacks = 0;
943
+ $format = $this->getFormatInfo($mask, $level);
944
+ for ($i=0; $i<8; ++$i) {
945
+ if ($format & 1) {
946
+ $blacks += 2;
947
+ $v = 0x85;
948
+ } else {
949
+ $v = 0x84;
950
+ }
951
+ $frame[8][$width - 1 - $i] = chr($v);
952
+ if ($i < 6) {
953
+ $frame[$i][8] = chr($v);
954
+ } else {
955
+ $frame[$i + 1][8] = chr($v);
956
+ }
957
+ $format = $format >> 1;
958
+ }
959
+ for ($i=0; $i<7; ++$i) {
960
+ if ($format & 1) {
961
+ $blacks += 2;
962
+ $v = 0x85;
963
+ } else {
964
+ $v = 0x84;
965
+ }
966
+ $frame[$width - 7 + $i][8] = chr($v);
967
+ if ($i == 0) {
968
+ $frame[8][7] = chr($v);
969
+ } else {
970
+ $frame[8][6 - $i] = chr($v);
971
+ }
972
+ $format = $format >> 1;
973
+ }
974
+ return $blacks;
975
+ }
976
+
977
+ /**
978
+ * mask0
979
+ * @param $x (int) X position
980
+ * @param $y (int) Y position
981
+ * @return int mask
982
+ */
983
+ protected function mask0($x, $y) {
984
+ return ($x + $y) & 1;
985
+ }
986
+
987
+ /**
988
+ * mask1
989
+ * @param $x (int) X position
990
+ * @param $y (int) Y position
991
+ * @return int mask
992
+ */
993
+ protected function mask1($x, $y) {
994
+ return ($y & 1);
995
+ }
996
+
997
+ /**
998
+ * mask2
999
+ * @param $x (int) X position
1000
+ * @param $y (int) Y position
1001
+ * @return int mask
1002
+ */
1003
+ protected function mask2($x, $y) {
1004
+ return ($x % 3);
1005
+ }
1006
+
1007
+ /**
1008
+ * mask3
1009
+ * @param $x (int) X position
1010
+ * @param $y (int) Y position
1011
+ * @return int mask
1012
+ */
1013
+ protected function mask3($x, $y) {
1014
+ return ($x + $y) % 3;
1015
+ }
1016
+
1017
+ /**
1018
+ * mask4
1019
+ * @param $x (int) X position
1020
+ * @param $y (int) Y position
1021
+ * @return int mask
1022
+ */
1023
+ protected function mask4($x, $y) {
1024
+ return (((int)($y / 2)) + ((int)($x / 3))) & 1;
1025
+ }
1026
+
1027
+ /**
1028
+ * mask5
1029
+ * @param $x (int) X position
1030
+ * @param $y (int) Y position
1031
+ * @return int mask
1032
+ */
1033
+ protected function mask5($x, $y) {
1034
+ return (($x * $y) & 1) + ($x * $y) % 3;
1035
+ }
1036
+
1037
+ /**
1038
+ * mask6
1039
+ * @param $x (int) X position
1040
+ * @param $y (int) Y position
1041
+ * @return int mask
1042
+ */
1043
+ protected function mask6($x, $y) {
1044
+ return ((($x * $y) & 1) + ($x * $y) % 3) & 1;
1045
+ }
1046
+
1047
+ /**
1048
+ * mask7
1049
+ * @param $x (int) X position
1050
+ * @param $y (int) Y position
1051
+ * @return int mask
1052
+ */
1053
+ protected function mask7($x, $y) {
1054
+ return ((($x * $y) % 3) + (($x + $y) & 1)) & 1;
1055
+ }
1056
+
1057
+ /**
1058
+ * Return bitmask
1059
+ * @param $maskNo (int) mask number
1060
+ * @param $width (int) width
1061
+ * @param $frame (array) frame
1062
+ * @return array bitmask
1063
+ */
1064
+ protected function generateMaskNo($maskNo, $width, $frame) {
1065
+ $bitMask = array_fill(0, $width, array_fill(0, $width, 0));
1066
+ for ($y=0; $y<$width; ++$y) {
1067
+ for ($x=0; $x<$width; ++$x) {
1068
+ if (ord($frame[$y][$x]) & 0x80) {
1069
+ $bitMask[$y][$x] = 0;
1070
+ } else {
1071
+ $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y);
1072
+ $bitMask[$y][$x] = ($maskFunc == 0)?1:0;
1073
+ }
1074
+ }
1075
+ }
1076
+ return $bitMask;
1077
+ }
1078
+
1079
+ /**
1080
+ * makeMaskNo
1081
+ * @param $maskNo (int)
1082
+ * @param $width (int)
1083
+ * @param $s (int)
1084
+ * @param $d (int)
1085
+ * @param $maskGenOnly (boolean)
1086
+ * @return int b
1087
+ */
1088
+ protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) {
1089
+ $b = 0;
1090
+ $bitMask = array();
1091
+ $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d);
1092
+ if ($maskGenOnly) {
1093
+ return;
1094
+ }
1095
+ $d = $s;
1096
+ for ($y=0; $y<$width; ++$y) {
1097
+ for ($x=0; $x<$width; ++$x) {
1098
+ if ($bitMask[$y][$x] == 1) {
1099
+ $d[$y][$x] = chr(ord($s[$y][$x]) ^ ((int)($bitMask[$y][$x])));
1100
+ }
1101
+ $b += (int)(ord($d[$y][$x]) & 1);
1102
+ }
1103
+ }
1104
+ return $b;
1105
+ }
1106
+
1107
+ /**
1108
+ * makeMask
1109
+ * @param $width (int)
1110
+ * @param $frame (array)
1111
+ * @param $maskNo (int)
1112
+ * @param $level (int)
1113
+ * @return array mask
1114
+ */
1115
+ protected function makeMask($width, $frame, $maskNo, $level) {
1116
+ $masked = array_fill(0, $width, str_repeat("\0", $width));
1117
+ $this->makeMaskNo($maskNo, $width, $frame, $masked);
1118
+ $this->writeFormatInformation($width, $masked, $maskNo, $level);
1119
+ return $masked;
1120
+ }
1121
+
1122
+ /**
1123
+ * calcN1N3
1124
+ * @param $length (int)
1125
+ * @return int demerit
1126
+ */
1127
+ protected function calcN1N3($length) {
1128
+ $demerit = 0;
1129
+ for ($i=0; $i<$length; ++$i) {
1130
+ if ($this->runLength[$i] >= 5) {
1131
+ $demerit += (N1 + ($this->runLength[$i] - 5));
1132
+ }
1133
+ if ($i & 1) {
1134
+ if (($i >= 3) AND ($i < ($length-2)) AND ($this->runLength[$i] % 3 == 0)) {
1135
+ $fact = (int)($this->runLength[$i] / 3);
1136
+ if (($this->runLength[$i-2] == $fact)
1137
+ AND ($this->runLength[$i-1] == $fact)
1138
+ AND ($this->runLength[$i+1] == $fact)
1139
+ AND ($this->runLength[$i+2] == $fact)) {
1140
+ if (($this->runLength[$i-3] < 0) OR ($this->runLength[$i-3] >= (4 * $fact))) {
1141
+ $demerit += N3;
1142
+ } elseif ((($i+3) >= $length) OR ($this->runLength[$i+3] >= (4 * $fact))) {
1143
+ $demerit += N3;
1144
+ }
1145
+ }
1146
+ }
1147
+ }
1148
+ }
1149
+ return $demerit;
1150
+ }
1151
+
1152
+ /**
1153
+ * evaluateSymbol
1154
+ * @param $width (int)
1155
+ * @param $frame (array)
1156
+ * @return int demerit
1157
+ */
1158
+ protected function evaluateSymbol($width, $frame) {
1159
+ $head = 0;
1160
+ $demerit = 0;
1161
+ for ($y=0; $y<$width; ++$y) {
1162
+ $head = 0;
1163
+ $this->runLength[0] = 1;
1164
+ $frameY = $frame[$y];
1165
+ if ($y > 0) {
1166
+ $frameYM = $frame[$y-1];
1167
+ }
1168
+ for ($x=0; $x<$width; ++$x) {
1169
+ if (($x > 0) AND ($y > 0)) {
1170
+ $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]);
1171
+ $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]);
1172
+ if (($b22 | ($w22 ^ 1)) & 1) {
1173
+ $demerit += N2;
1174
+ }
1175
+ }
1176
+ if (($x == 0) AND (ord($frameY[$x]) & 1)) {
1177
+ $this->runLength[0] = -1;
1178
+ $head = 1;
1179
+ $this->runLength[$head] = 1;
1180
+ } elseif ($x > 0) {
1181
+ if ((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) {
1182
+ $head++;
1183
+ $this->runLength[$head] = 1;
1184
+ } else {
1185
+ $this->runLength[$head]++;
1186
+ }
1187
+ }
1188
+ }
1189
+ $demerit += $this->calcN1N3($head+1);
1190
+ }
1191
+ for ($x=0; $x<$width; ++$x) {
1192
+ $head = 0;
1193
+ $this->runLength[0] = 1;
1194
+ for ($y=0; $y<$width; ++$y) {
1195
+ if (($y == 0) AND (ord($frame[$y][$x]) & 1)) {
1196
+ $this->runLength[0] = -1;
1197
+ $head = 1;
1198
+ $this->runLength[$head] = 1;
1199
+ } elseif ($y > 0) {
1200
+ if ((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) {
1201
+ $head++;
1202
+ $this->runLength[$head] = 1;
1203
+ } else {
1204
+ $this->runLength[$head]++;
1205
+ }
1206
+ }
1207
+ }
1208
+ $demerit += $this->calcN1N3($head+1);
1209
+ }
1210
+ return $demerit;
1211
+ }
1212
+
1213
+ /**
1214
+ * mask
1215
+ * @param $width (int)
1216
+ * @param $frame (array)
1217
+ * @param $level (int)
1218
+ * @return array best mask
1219
+ */
1220
+ protected function mask($width, $frame, $level) {
1221
+ $minDemerit = PHP_INT_MAX;
1222
+ $bestMaskNum = 0;
1223
+ $bestMask = array();
1224
+ $checked_masks = array(0, 1, 2, 3, 4, 5, 6, 7);
1225
+ if (QR_FIND_FROM_RANDOM !== false) {
1226
+ $howManuOut = 8 - (QR_FIND_FROM_RANDOM % 9);
1227
+ for ($i = 0; $i < $howManuOut; ++$i) {
1228
+ $remPos = rand (0, count($checked_masks)-1);
1229
+ unset($checked_masks[$remPos]);
1230
+ $checked_masks = array_values($checked_masks);
1231
+ }
1232
+ }
1233
+ $bestMask = $frame;
1234
+ foreach ($checked_masks as $i) {
1235
+ $mask = array_fill(0, $width, str_repeat("\0", $width));
1236
+ $demerit = 0;
1237
+ $blacks = 0;
1238
+ $blacks = $this->makeMaskNo($i, $width, $frame, $mask);
1239
+ $blacks += $this->writeFormatInformation($width, $mask, $i, $level);
1240
+ $blacks = (int)(100 * $blacks / ($width * $width));
1241
+ $demerit = (int)((int)(abs($blacks - 50) / 5) * N4);
1242
+ $demerit += $this->evaluateSymbol($width, $mask);
1243
+ if ($demerit < $minDemerit) {
1244
+ $minDemerit = $demerit;
1245
+ $bestMask = $mask;
1246
+ $bestMaskNum = $i;
1247
+ }
1248
+ }
1249
+ return $bestMask;
1250
+ }
1251
+
1252
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
1253
+
1254
+ // QRsplit
1255
+
1256
+ /**
1257
+ * Return true if the character at specified position is a number
1258
+ * @param $str (string) string
1259
+ * @param $pos (int) characted position
1260
+ * @return boolean true of false
1261
+ */
1262
+ protected function isdigitat($str, $pos) {
1263
+ if ($pos >= strlen($str)) {
1264
+ return false;
1265
+ }
1266
+ return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9')));
1267
+ }
1268
+
1269
+ /**
1270
+ * Return true if the character at specified position is an alphanumeric character
1271
+ * @param $str (string) string
1272
+ * @param $pos (int) characted position
1273
+ * @return boolean true of false
1274
+ */
1275
+ protected function isalnumat($str, $pos) {
1276
+ if ($pos >= strlen($str)) {
1277
+ return false;
1278
+ }
1279
+ return ($this->lookAnTable(ord($str[$pos])) >= 0);
1280
+ }
1281
+
1282
+ /**
1283
+ * identifyMode
1284
+ * @param $pos (int)
1285
+ * @return int mode
1286
+ */
1287
+ protected function identifyMode($pos) {
1288
+ if ($pos >= strlen($this->dataStr)) {
1289
+ return QR_MODE_NL;
1290
+ }
1291
+ $c = $this->dataStr[$pos];
1292
+ if ($this->isdigitat($this->dataStr, $pos)) {
1293
+ return QR_MODE_NM;
1294
+ } elseif ($this->isalnumat($this->dataStr, $pos)) {
1295
+ return QR_MODE_AN;
1296
+ } elseif ($this->hint == QR_MODE_KJ) {
1297
+ if ($pos+1 < strlen($this->dataStr)) {
1298
+ $d = $this->dataStr[$pos+1];
1299
+ $word = (ord($c) << 8) | ord($d);
1300
+ if (($word >= 0x8140 && $word <= 0x9ffc) OR ($word >= 0xe040 && $word <= 0xebbf)) {
1301
+ return QR_MODE_KJ;
1302
+ }
1303
+ }
1304
+ }
1305
+ return QR_MODE_8B;
1306
+ }
1307
+
1308
+ /**
1309
+ * eatNum
1310
+ * @return int run
1311
+ */
1312
+ protected function eatNum() {
1313
+ $ln = $this->lengthIndicator(QR_MODE_NM, $this->version);
1314
+ $p = 0;
1315
+ while($this->isdigitat($this->dataStr, $p)) {
1316
+ $p++;
1317
+ }
1318
+ $run = $p;
1319
+ $mode = $this->identifyMode($p);
1320
+ if ($mode == QR_MODE_8B) {
1321
+ $dif = $this->estimateBitsModeNum($run) + 4 + $ln
1322
+ + $this->estimateBitsMode8(1) // + 4 + l8
1323
+ - $this->estimateBitsMode8($run + 1); // - 4 - l8
1324
+ if ($dif > 0) {
1325
+ return $this->eat8();
1326
+ }
1327
+ }
1328
+ if ($mode == QR_MODE_AN) {
1329
+ $dif = $this->estimateBitsModeNum($run) + 4 + $ln
1330
+ + $this->estimateBitsModeAn(1) // + 4 + la
1331
+ - $this->estimateBitsModeAn($run + 1);// - 4 - la
1332
+ if ($dif > 0) {
1333
+ return $this->eatAn();
1334
+ }
1335
+ }
1336
+ $this->items = $this->appendNewInputItem($this->items, QR_MODE_NM, $run, str_split($this->dataStr));
1337
+ return $run;
1338
+ }
1339
+
1340
+ /**
1341
+ * eatAn
1342
+ * @return int run
1343
+ */
1344
+ protected function eatAn() {
1345
+ $la = $this->lengthIndicator(QR_MODE_AN, $this->version);
1346
+ $ln = $this->lengthIndicator(QR_MODE_NM, $this->version);
1347
+ $p =1 ;
1348
+ while($this->isalnumat($this->dataStr, $p)) {
1349
+ if ($this->isdigitat($this->dataStr, $p)) {
1350
+ $q = $p;
1351
+ while($this->isdigitat($this->dataStr, $q)) {
1352
+ $q++;
1353
+ }
1354
+ $dif = $this->estimateBitsModeAn($p) // + 4 + la
1355
+ + $this->estimateBitsModeNum($q - $p) + 4 + $ln
1356
+ - $this->estimateBitsModeAn($q); // - 4 - la
1357
+ if ($dif < 0) {
1358
+ break;
1359
+ } else {
1360
+ $p = $q;
1361
+ }
1362
+ } else {
1363
+ $p++;
1364
+ }
1365
+ }
1366
+ $run = $p;
1367
+ if (!$this->isalnumat($this->dataStr, $p)) {
1368
+ $dif = $this->estimateBitsModeAn($run) + 4 + $la
1369
+ + $this->estimateBitsMode8(1) // + 4 + l8
1370
+ - $this->estimateBitsMode8($run + 1); // - 4 - l8
1371
+ if ($dif > 0) {
1372
+ return $this->eat8();
1373
+ }
1374
+ }
1375
+ $this->items = $this->appendNewInputItem($this->items, QR_MODE_AN, $run, str_split($this->dataStr));
1376
+ return $run;
1377
+ }
1378
+
1379
+ /**
1380
+ * eatKanji
1381
+ * @return int run
1382
+ */
1383
+ protected function eatKanji() {
1384
+ $p = 0;
1385
+ while($this->identifyMode($p) == QR_MODE_KJ) {
1386
+ $p += 2;
1387
+ }
1388
+ $this->items = $this->appendNewInputItem($this->items, QR_MODE_KJ, $p, str_split($this->dataStr));
1389
+ return $run;
1390
+ }
1391
+
1392
+ /**
1393
+ * eat8
1394
+ * @return int run
1395
+ */
1396
+ protected function eat8() {
1397
+ $la = $this->lengthIndicator(QR_MODE_AN, $this->version);
1398
+ $ln = $this->lengthIndicator(QR_MODE_NM, $this->version);
1399
+ $p = 1;
1400
+ $dataStrLen = strlen($this->dataStr);
1401
+ while($p < $dataStrLen) {
1402
+ $mode = $this->identifyMode($p);
1403
+ if ($mode == QR_MODE_KJ) {
1404
+ break;
1405
+ }
1406
+ if ($mode == QR_MODE_NM) {
1407
+ $q = $p;
1408
+ while($this->isdigitat($this->dataStr, $q)) {
1409
+ $q++;
1410
+ }
1411
+ $dif = $this->estimateBitsMode8($p) // + 4 + l8
1412
+ + $this->estimateBitsModeNum($q - $p) + 4 + $ln
1413
+ - $this->estimateBitsMode8($q); // - 4 - l8
1414
+ if ($dif < 0) {
1415
+ break;
1416
+ } else {
1417
+ $p = $q;
1418
+ }
1419
+ } elseif ($mode == QR_MODE_AN) {
1420
+ $q = $p;
1421
+ while($this->isalnumat($this->dataStr, $q)) {
1422
+ $q++;
1423
+ }
1424
+ $dif = $this->estimateBitsMode8($p) // + 4 + l8
1425
+ + $this->estimateBitsModeAn($q - $p) + 4 + $la
1426
+ - $this->estimateBitsMode8($q); // - 4 - l8
1427
+ if ($dif < 0) {
1428
+ break;
1429
+ } else {
1430
+ $p = $q;
1431
+ }
1432
+ } else {
1433
+ $p++;
1434
+ }
1435
+ }
1436
+ $run = $p;
1437
+ $this->items = $this->appendNewInputItem($this->items, QR_MODE_8B, $run, str_split($this->dataStr));
1438
+ return $run;
1439
+ }
1440
+
1441
+ /**
1442
+ * splitString
1443
+ * @return (int)
1444
+ */
1445
+ protected function splitString() {
1446
+ while (strlen($this->dataStr) > 0) {
1447
+ $mode = $this->identifyMode(0);
1448
+ switch ($mode) {
1449
+ case QR_MODE_NM: {
1450
+ $length = $this->eatNum();
1451
+ break;
1452
+ }
1453
+ case QR_MODE_AN: {
1454
+ $length = $this->eatAn();
1455
+ break;
1456
+ }
1457
+ case QR_MODE_KJ: {
1458
+ if ($hint == QR_MODE_KJ) {
1459
+ $length = $this->eatKanji();
1460
+ } else {
1461
+ $length = $this->eat8();
1462
+ }
1463
+ break;
1464
+ }
1465
+ default: {
1466
+ $length = $this->eat8();
1467
+ break;
1468
+ }
1469
+ }
1470
+ if ($length == 0) {
1471
+ return 0;
1472
+ }
1473
+ if ($length < 0) {
1474
+ return -1;
1475
+ }
1476
+ $this->dataStr = substr($this->dataStr, $length);
1477
+ }
1478
+ return 0;
1479
+ }
1480
+
1481
+ /**
1482
+ * toUpper
1483
+ */
1484
+ protected function toUpper() {
1485
+ $stringLen = strlen($this->dataStr);
1486
+ $p = 0;
1487
+ while ($p < $stringLen) {
1488
+ $mode = $this->identifyMode(substr($this->dataStr, $p), $this->hint);
1489
+ if ($mode == QR_MODE_KJ) {
1490
+ $p += 2;
1491
+ } else {
1492
+ if ((ord($this->dataStr[$p]) >= ord('a')) AND (ord($this->dataStr[$p]) <= ord('z'))) {
1493
+ $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32);
1494
+ }
1495
+ $p++;
1496
+ }
1497
+ }
1498
+ return $this->dataStr;
1499
+ }
1500
+
1501
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
1502
+
1503
+ // QRinputItem
1504
+
1505
+ /**
1506
+ * newInputItem
1507
+ * @param $mode (int)
1508
+ * @param $size (int)
1509
+ * @param $data (array)
1510
+ * @param $bstream (array)
1511
+ * @return array input item
1512
+ */
1513
+ protected function newInputItem($mode, $size, $data, $bstream=null) {
1514
+ $setData = array_slice($data, 0, $size);
1515
+ if (count($setData) < $size) {
1516
+ $setData = array_merge($setData, array_fill(0, ($size - count($setData)), 0));
1517
+ }
1518
+ if (!$this->check($mode, $size, $setData)) {
1519
+ return NULL;
1520
+ }
1521
+ $inputitem = array();
1522
+ $inputitem['mode'] = $mode;
1523
+ $inputitem['size'] = $size;
1524
+ $inputitem['data'] = $setData;
1525
+ $inputitem['bstream'] = $bstream;
1526
+ return $inputitem;
1527
+ }
1528
+
1529
+ /**
1530
+ * encodeModeNum
1531
+ * @param $inputitem (array)
1532
+ * @param $version (int)
1533
+ * @return array input item
1534
+ */
1535
+ protected function encodeModeNum($inputitem, $version) {
1536
+ $words = (int)($inputitem['size'] / 3);
1537
+ $inputitem['bstream'] = array();
1538
+ $val = 0x1;
1539
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val);
1540
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_NM, $version), $inputitem['size']);
1541
+ for ($i=0; $i < $words; ++$i) {
1542
+ $val = (ord($inputitem['data'][$i*3 ]) - ord('0')) * 100;
1543
+ $val += (ord($inputitem['data'][$i*3+1]) - ord('0')) * 10;
1544
+ $val += (ord($inputitem['data'][$i*3+2]) - ord('0'));
1545
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 10, $val);
1546
+ }
1547
+ if ($inputitem['size'] - $words * 3 == 1) {
1548
+ $val = ord($inputitem['data'][$words*3]) - ord('0');
1549
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val);
1550
+ } elseif (($inputitem['size'] - ($words * 3)) == 2) {
1551
+ $val = (ord($inputitem['data'][$words*3 ]) - ord('0')) * 10;
1552
+ $val += (ord($inputitem['data'][$words*3+1]) - ord('0'));
1553
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 7, $val);
1554
+ }
1555
+ return $inputitem;
1556
+ }
1557
+
1558
+ /**
1559
+ * encodeModeAn
1560
+ * @param $inputitem (array)
1561
+ * @param $version (int)
1562
+ * @return array input item
1563
+ */
1564
+ protected function encodeModeAn($inputitem, $version) {
1565
+ $words = (int)($inputitem['size'] / 2);
1566
+ $inputitem['bstream'] = array();
1567
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x02);
1568
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_AN, $version), $inputitem['size']);
1569
+ for ($i=0; $i < $words; ++$i) {
1570
+ $val = (int)($this->lookAnTable(ord($inputitem['data'][$i*2])) * 45);
1571
+ $val += (int)($this->lookAnTable(ord($inputitem['data'][($i*2)+1])));
1572
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 11, $val);
1573
+ }
1574
+ if ($inputitem['size'] & 1) {
1575
+ $val = $this->lookAnTable(ord($inputitem['data'][($words * 2)]));
1576
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 6, $val);
1577
+ }
1578
+ return $inputitem;
1579
+ }
1580
+
1581
+ /**
1582
+ * encodeMode8
1583
+ * @param $inputitem (array)
1584
+ * @param $version (int)
1585
+ * @return array input item
1586
+ */
1587
+ protected function encodeMode8($inputitem, $version) {
1588
+ $inputitem['bstream'] = array();
1589
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x4);
1590
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_8B, $version), $inputitem['size']);
1591
+ for ($i=0; $i < $inputitem['size']; ++$i) {
1592
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][$i]));
1593
+ }
1594
+ return $inputitem;
1595
+ }
1596
+
1597
+ /**
1598
+ * encodeModeKanji
1599
+ * @param $inputitem (array)
1600
+ * @param $version (int)
1601
+ * @return array input item
1602
+ */
1603
+ protected function encodeModeKanji($inputitem, $version) {
1604
+ $inputitem['bstream'] = array();
1605
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x8);
1606
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_KJ, $version), (int)($inputitem['size'] / 2));
1607
+ for ($i=0; $i<$inputitem['size']; $i+=2) {
1608
+ $val = (ord($inputitem['data'][$i]) << 8) | ord($inputitem['data'][$i+1]);
1609
+ if ($val <= 0x9ffc) {
1610
+ $val -= 0x8140;
1611
+ } else {
1612
+ $val -= 0xc140;
1613
+ }
1614
+ $h = ($val >> 8) * 0xc0;
1615
+ $val = ($val & 0xff) + $h;
1616
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 13, $val);
1617
+ }
1618
+ return $inputitem;
1619
+ }
1620
+
1621
+ /**
1622
+ * encodeModeStructure
1623
+ * @param $inputitem (array)
1624
+ * @return array input item
1625
+ */
1626
+ protected function encodeModeStructure($inputitem) {
1627
+ $inputitem['bstream'] = array();
1628
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x03);
1629
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][1]) - 1);
1630
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][0]) - 1);
1631
+ $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][2]));
1632
+ return $inputitem;
1633
+ }
1634
+
1635
+ /**
1636
+ * encodeBitStream
1637
+ * @param $inputitem (array)
1638
+ * @param $version (int)
1639
+ * @return array input item
1640
+ */
1641
+ protected function encodeBitStream($inputitem, $version) {
1642
+ $inputitem['bstream'] = array();
1643
+ $words = $this->maximumWords($inputitem['mode'], $version);
1644
+ if ($inputitem['size'] > $words) {
1645
+ $st1 = $this->newInputItem($inputitem['mode'], $words, $inputitem['data']);
1646
+ $st2 = $this->newInputItem($inputitem['mode'], $inputitem['size'] - $words, array_slice($inputitem['data'], $words));
1647
+ $st1 = $this->encodeBitStream($st1, $version);
1648
+ $st2 = $this->encodeBitStream($st2, $version);
1649
+ $inputitem['bstream'] = array();
1650
+ $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st1['bstream']);
1651
+ $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st2['bstream']);
1652
+ } else {
1653
+ switch($inputitem['mode']) {
1654
+ case QR_MODE_NM: {
1655
+ $inputitem = $this->encodeModeNum($inputitem, $version);
1656
+ break;
1657
+ }
1658
+ case QR_MODE_AN: {
1659
+ $inputitem = $this->encodeModeAn($inputitem, $version);
1660
+ break;
1661
+ }
1662
+ case QR_MODE_8B: {
1663
+ $inputitem = $this->encodeMode8($inputitem, $version);
1664
+ break;
1665
+ }
1666
+ case QR_MODE_KJ: {
1667
+ $inputitem = $this->encodeModeKanji($inputitem, $version);
1668
+ break;
1669
+ }
1670
+ case QR_MODE_ST: {
1671
+ $inputitem = $this->encodeModeStructure($inputitem);
1672
+ break;
1673
+ }
1674
+ default: {
1675
+ break;
1676
+ }
1677
+ }
1678
+ }
1679
+ return $inputitem;
1680
+ }
1681
+
1682
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
1683
+
1684
+ // QRinput
1685
+
1686
+ /**
1687
+ * Append data to an input object.
1688
+ * The data is copied and appended to the input object.
1689
+ * @param $items (arrray) input items
1690
+ * @param $mode (int) encoding mode.
1691
+ * @param $size (int) size of data (byte).
1692
+ * @param $data (array) array of input data.
1693
+ * @return items
1694
+ *
1695
+ */
1696
+ protected function appendNewInputItem($items, $mode, $size, $data) {
1697
+ $newitem = $this->newInputItem($mode, $size, $data);
1698
+ if (!empty($newitem)) {
1699
+ $items[] = $newitem;
1700
+ }
1701
+ return $items;
1702
+ }
1703
+
1704
+ /**
1705
+ * insertStructuredAppendHeader
1706
+ * @param $items (array)
1707
+ * @param $size (int)
1708
+ * @param $index (int)
1709
+ * @param $parity (int)
1710
+ * @return array items
1711
+ */
1712
+ protected function insertStructuredAppendHeader($items, $size, $index, $parity) {
1713
+ if ($size > MAX_STRUCTURED_SYMBOLS) {
1714
+ return -1;
1715
+ }
1716
+ if (($index <= 0) OR ($index > MAX_STRUCTURED_SYMBOLS)) {
1717
+ return -1;
1718
+ }
1719
+ $buf = array($size, $index, $parity);
1720
+ $entry = $this->newInputItem(QR_MODE_ST, 3, buf);
1721
+ array_unshift($items, $entry);
1722
+ return $items;
1723
+ }
1724
+
1725
+ /**
1726
+ * calcParity
1727
+ * @param $items (array)
1728
+ * @return int parity
1729
+ */
1730
+ protected function calcParity($items) {
1731
+ $parity = 0;
1732
+ foreach ($items as $item) {
1733
+ if ($item['mode'] != QR_MODE_ST) {
1734
+ for ($i=$item['size']-1; $i>=0; --$i) {
1735
+ $parity ^= $item['data'][$i];
1736
+ }
1737
+ }
1738
+ }
1739
+ return $parity;
1740
+ }
1741
+
1742
+ /**
1743
+ * checkModeNum
1744
+ * @param $size (int)
1745
+ * @param $data (array)
1746
+ * @return boolean true or false
1747
+ */
1748
+ protected function checkModeNum($size, $data) {
1749
+ for ($i=0; $i<$size; ++$i) {
1750
+ if ((ord($data[$i]) < ord('0')) OR (ord($data[$i]) > ord('9'))){
1751
+ return false;
1752
+ }
1753
+ }
1754
+ return true;
1755
+ }
1756
+
1757
+ /**
1758
+ * Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19).
1759
+ * @param $c (int) character value
1760
+ * @return value
1761
+ */
1762
+ protected function lookAnTable($c) {
1763
+ return (($c > 127)?-1:$this->anTable[$c]);
1764
+ }
1765
+
1766
+ /**
1767
+ * checkModeAn
1768
+ * @param $size (int)
1769
+ * @param $data (array)
1770
+ * @return boolean true or false
1771
+ */
1772
+ protected function checkModeAn($size, $data) {
1773
+ for ($i=0; $i<$size; ++$i) {
1774
+ if ($this->lookAnTable(ord($data[$i])) == -1) {
1775
+ return false;
1776
+ }
1777
+ }
1778
+ return true;
1779
+ }
1780
+
1781
+ /**
1782
+ * estimateBitsModeNum
1783
+ * @param $size (int)
1784
+ * @return int number of bits
1785
+ */
1786
+ protected function estimateBitsModeNum($size) {
1787
+ $w = (int)($size / 3);
1788
+ $bits = ($w * 10);
1789
+ switch($size - ($w * 3)) {
1790
+ case 1: {
1791
+ $bits += 4;
1792
+ break;
1793
+ }
1794
+ case 2: {
1795
+ $bits += 7;
1796
+ break;
1797
+ }
1798
+ }
1799
+ return $bits;
1800
+ }
1801
+
1802
+ /**
1803
+ * estimateBitsModeAn
1804
+ * @param $size (int)
1805
+ * @return int number of bits
1806
+ */
1807
+ protected function estimateBitsModeAn($size) {
1808
+ $bits = (int)($size * 5.5); // (size / 2 ) * 11
1809
+ if ($size & 1) {
1810
+ $bits += 6;
1811
+ }
1812
+ return $bits;
1813
+ }
1814
+
1815
+ /**
1816
+ * estimateBitsMode8
1817
+ * @param $size (int)
1818
+ * @return int number of bits
1819
+ */
1820
+ protected function estimateBitsMode8($size) {
1821
+ return (int)($size * 8);
1822
+ }
1823
+
1824
+ /**
1825
+ * estimateBitsModeKanji
1826
+ * @param $size (int)
1827
+ * @return int number of bits
1828
+ */
1829
+ protected function estimateBitsModeKanji($size) {
1830
+ return (int)($size * 6.5); // (size / 2 ) * 13
1831
+ }
1832
+
1833
+ /**
1834
+ * checkModeKanji
1835
+ * @param $size (int)
1836
+ * @param $data (array)
1837
+ * @return boolean true or false
1838
+ */
1839
+ protected function checkModeKanji($size, $data) {
1840
+ if ($size & 1) {
1841
+ return false;
1842
+ }
1843
+ for ($i=0; $i<$size; $i+=2) {
1844
+ $val = (ord($data[$i]) << 8) | ord($data[$i+1]);
1845
+ if (($val < 0x8140) OR (($val > 0x9ffc) AND ($val < 0xe040)) OR ($val > 0xebbf)) {
1846
+ return false;
1847
+ }
1848
+ }
1849
+ return true;
1850
+ }
1851
+
1852
+ /**
1853
+ * Validate the input data.
1854
+ * @param $mode (int) encoding mode.
1855
+ * @param $size (int) size of data (byte).
1856
+ * @param $data (array) data to validate
1857
+ * @return boolean true in case of valid data, false otherwise
1858
+ */
1859
+ protected function check($mode, $size, $data) {
1860
+ if ($size <= 0) {
1861
+ return false;
1862
+ }
1863
+ switch($mode) {
1864
+ case QR_MODE_NM: {
1865
+ return $this->checkModeNum($size, $data);
1866
+ }
1867
+ case QR_MODE_AN: {
1868
+ return $this->checkModeAn($size, $data);
1869
+ }
1870
+ case QR_MODE_KJ: {
1871
+ return $this->checkModeKanji($size, $data);
1872
+ }
1873
+ case QR_MODE_8B: {
1874
+ return true;
1875
+ }
1876
+ case QR_MODE_ST: {
1877
+ return true;
1878
+ }
1879
+ default: {
1880
+ break;
1881
+ }
1882
+ }
1883
+ return false;
1884
+ }
1885
+
1886
+ /**
1887
+ * estimateBitStreamSize
1888
+ * @param $items (array)
1889
+ * @param $version (int)
1890
+ * @return int bits
1891
+ */
1892
+ protected function estimateBitStreamSize($items, $version) {
1893
+ $bits = 0;
1894
+ if ($version == 0) {
1895
+ $version = 1;
1896
+ }
1897
+ foreach ($items as $item) {
1898
+ switch($item['mode']) {
1899
+ case QR_MODE_NM: {
1900
+ $bits = $this->estimateBitsModeNum($item['size']);
1901
+ break;
1902
+ }
1903
+ case QR_MODE_AN: {
1904
+ $bits = $this->estimateBitsModeAn($item['size']);
1905
+ break;
1906
+ }
1907
+ case QR_MODE_8B: {
1908
+ $bits = $this->estimateBitsMode8($item['size']);
1909
+ break;
1910
+ }
1911
+ case QR_MODE_KJ: {
1912
+ $bits = $this->estimateBitsModeKanji($item['size']);
1913
+ break;
1914
+ }
1915
+ case QR_MODE_ST: {
1916
+ return STRUCTURE_HEADER_BITS;
1917
+ }
1918
+ default: {
1919
+ return 0;
1920
+ }
1921
+ }
1922
+ $l = $this->lengthIndicator($item['mode'], $version);
1923
+ $m = 1 << $l;
1924
+ $num = (int)(($item['size'] + $m - 1) / $m);
1925
+ $bits += $num * (4 + $l);
1926
+ }
1927
+ return $bits;
1928
+ }
1929
+
1930
+ /**
1931
+ * estimateVersion
1932
+ * @param $items (array)
1933
+ * @return int version
1934
+ */
1935
+ protected function estimateVersion($items) {
1936
+ $version = 0;
1937
+ $prev = 0;
1938
+ do {
1939
+ $prev = $version;
1940
+ $bits = $this->estimateBitStreamSize($items, $prev);
1941
+ $version = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level);
1942
+ if ($version < 0) {
1943
+ return -1;
1944
+ }
1945
+ } while ($version > $prev);
1946
+ return $version;
1947
+ }
1948
+
1949
+ /**
1950
+ * lengthOfCode
1951
+ * @param $mode (int)
1952
+ * @param $version (int)
1953
+ * @param $bits (int)
1954
+ * @return int size
1955
+ */
1956
+ protected function lengthOfCode($mode, $version, $bits) {
1957
+ $payload = $bits - 4 - $this->lengthIndicator($mode, $version);
1958
+ switch($mode) {
1959
+ case QR_MODE_NM: {
1960
+ $chunks = (int)($payload / 10);
1961
+ $remain = $payload - $chunks * 10;
1962
+ $size = $chunks * 3;
1963
+ if ($remain >= 7) {
1964
+ $size += 2;
1965
+ } elseif ($remain >= 4) {
1966
+ $size += 1;
1967
+ }
1968
+ break;
1969
+ }
1970
+ case QR_MODE_AN: {
1971
+ $chunks = (int)($payload / 11);
1972
+ $remain = $payload - $chunks * 11;
1973
+ $size = $chunks * 2;
1974
+ if ($remain >= 6) {
1975
+ ++$size;
1976
+ }
1977
+ break;
1978
+ }
1979
+ case QR_MODE_8B: {
1980
+ $size = (int)($payload / 8);
1981
+ break;
1982
+ }
1983
+ case QR_MODE_KJ: {
1984
+ $size = (int)(($payload / 13) * 2);
1985
+ break;
1986
+ }
1987
+ case QR_MODE_ST: {
1988
+ $size = (int)($payload / 8);
1989
+ break;
1990
+ }
1991
+ default: {
1992
+ $size = 0;
1993
+ break;
1994
+ }
1995
+ }
1996
+ $maxsize = $this->maximumWords($mode, $version);
1997
+ if ($size < 0) {
1998
+ $size = 0;
1999
+ }
2000
+ if ($size > $maxsize) {
2001
+ $size = $maxsize;
2002
+ }
2003
+ return $size;
2004
+ }
2005
+
2006
+ /**
2007
+ * createBitStream
2008
+ * @param $items (array)
2009
+ * @return array of items and total bits
2010
+ */
2011
+ protected function createBitStream($items) {
2012
+ $total = 0;
2013
+ foreach ($items as $key => $item) {
2014
+ $items[$key] = $this->encodeBitStream($item, $this->version);
2015
+ $bits = count($items[$key]['bstream']);
2016
+ $total += $bits;
2017
+ }
2018
+ return array($items, $total);
2019
+ }
2020
+
2021
+ /**
2022
+ * convertData
2023
+ * @param $items (array)
2024
+ * @return array items
2025
+ */
2026
+ protected function convertData($items) {
2027
+ $ver = $this->estimateVersion($items);
2028
+ if ($ver > $this->version) {
2029
+ $this->version = $ver;
2030
+ }
2031
+ while (true) {
2032
+ $cbs = $this->createBitStream($items);
2033
+ $items = $cbs[0];
2034
+ $bits = $cbs[1];
2035
+ if ($bits < 0) {
2036
+ return -1;
2037
+ }
2038
+ $ver = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level);
2039
+ if ($ver < 0) {
2040
+ return -1;
2041
+ } elseif ($ver > $this->version) {
2042
+ $this->version = $ver;
2043
+ } else {
2044
+ break;
2045
+ }
2046
+ }
2047
+ return $items;
2048
+ }
2049
+
2050
+ /**
2051
+ * Append Padding Bit to bitstream
2052
+ * @param $bstream (array)
2053
+ * @return array bitstream
2054
+ */
2055
+ protected function appendPaddingBit($bstream) {
2056
+ if (is_null($bstream)) {
2057
+ return null;
2058
+ }
2059
+ $bits = count($bstream);
2060
+ $maxwords = $this->getDataLength($this->version, $this->level);
2061
+ $maxbits = $maxwords * 8;
2062
+ if ($maxbits == $bits) {
2063
+ return $bstream;
2064
+ }
2065
+ if ($maxbits - $bits < 5) {
2066
+ return $this->appendNum($bstream, $maxbits - $bits, 0);
2067
+ }
2068
+ $bits += 4;
2069
+ $words = (int)(($bits + 7) / 8);
2070
+ $padding = array();
2071
+ $padding = $this->appendNum($padding, $words * 8 - $bits + 4, 0);
2072
+ $padlen = $maxwords - $words;
2073
+ if ($padlen > 0) {
2074
+ $padbuf = array();
2075
+ for ($i=0; $i<$padlen; ++$i) {
2076
+ $padbuf[$i] = ($i&1)?0x11:0xec;
2077
+ }
2078
+ $padding = $this->appendBytes($padding, $padlen, $padbuf);
2079
+ }
2080
+ return $this->appendBitstream($bstream, $padding);
2081
+ }
2082
+
2083
+ /**
2084
+ * mergeBitStream
2085
+ * @param $items (array) items
2086
+ * @return array bitstream
2087
+ */
2088
+ protected function mergeBitStream($items) {
2089
+ $items = $this->convertData($items);
2090
+ if (!is_array($items)) {
2091
+ return null;
2092
+ }
2093
+ $bstream = array();
2094
+ foreach ($items as $item) {
2095
+ $bstream = $this->appendBitstream($bstream, $item['bstream']);
2096
+ }
2097
+ return $bstream;
2098
+ }
2099
+
2100
+ /**
2101
+ * Returns a stream of bits.
2102
+ * @param $items (int)
2103
+ * @return array padded merged byte stream
2104
+ */
2105
+ protected function getBitStream($items) {
2106
+ $bstream = $this->mergeBitStream($items);
2107
+ return $this->appendPaddingBit($bstream);
2108
+ }
2109
+
2110
+ /**
2111
+ * Pack all bit streams padding bits into a byte array.
2112
+ * @param $items (int)
2113
+ * @return array padded merged byte stream
2114
+ */
2115
+ protected function getByteStream($items) {
2116
+ $bstream = $this->getBitStream($items);
2117
+ return $this->bitstreamToByte($bstream);
2118
+ }
2119
+
2120
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
2121
+
2122
+ // QRbitstream
2123
+
2124
+ /**
2125
+ * Return an array with zeros
2126
+ * @param $setLength (int) array size
2127
+ * @return array
2128
+ */
2129
+ protected function allocate($setLength) {
2130
+ return array_fill(0, $setLength, 0);
2131
+ }
2132
+
2133
+ /**
2134
+ * Return new bitstream from number
2135
+ * @param $bits (int) number of bits
2136
+ * @param $num (int) number
2137
+ * @return array bitstream
2138
+ */
2139
+ protected function newFromNum($bits, $num) {
2140
+ $bstream = $this->allocate($bits);
2141
+ $mask = 1 << ($bits - 1);
2142
+ for ($i=0; $i<$bits; ++$i) {
2143
+ if ($num & $mask) {
2144
+ $bstream[$i] = 1;
2145
+ } else {
2146
+ $bstream[$i] = 0;
2147
+ }
2148
+ $mask = $mask >> 1;
2149
+ }
2150
+ return $bstream;
2151
+ }
2152
+
2153
+ /**
2154
+ * Return new bitstream from bytes
2155
+ * @param $size (int) size
2156
+ * @param $data (array) bytes
2157
+ * @return array bitstream
2158
+ */
2159
+ protected function newFromBytes($size, $data) {
2160
+ $bstream = $this->allocate($size * 8);
2161
+ $p=0;
2162
+ for ($i=0; $i<$size; ++$i) {
2163
+ $mask = 0x80;
2164
+ for ($j=0; $j<8; ++$j) {
2165
+ if ($data[$i] & $mask) {
2166
+ $bstream[$p] = 1;
2167
+ } else {
2168
+ $bstream[$p] = 0;
2169
+ }
2170
+ $p++;
2171
+ $mask = $mask >> 1;
2172
+ }
2173
+ }
2174
+ return $bstream;
2175
+ }
2176
+
2177
+ /**
2178
+ * Append one bitstream to another
2179
+ * @param $bitstream (array) original bitstream
2180
+ * @param $append (array) bitstream to append
2181
+ * @return array bitstream
2182
+ */
2183
+ protected function appendBitstream($bitstream, $append) {
2184
+ if ((!is_array($append)) OR (count($append) == 0)) {
2185
+ return $bitstream;
2186
+ }
2187
+ if (count($bitstream) == 0) {
2188
+ return $append;
2189
+ }
2190
+ return array_values(array_merge($bitstream, $append));
2191
+ }
2192
+
2193
+ /**
2194
+ * Append one bitstream created from number to another
2195
+ * @param $bitstream (array) original bitstream
2196
+ * @param $bits (int) number of bits
2197
+ * @param $num (int) number
2198
+ * @return array bitstream
2199
+ */
2200
+ protected function appendNum($bitstream, $bits, $num) {
2201
+ if ($bits == 0) {
2202
+ return 0;
2203
+ }
2204
+ $b = $this->newFromNum($bits, $num);
2205
+ return $this->appendBitstream($bitstream, $b);
2206
+ }
2207
+
2208
+ /**
2209
+ * Append one bitstream created from bytes to another
2210
+ * @param $bitstream (array) original bitstream
2211
+ * @param $size (int) size
2212
+ * @param $data (array) bytes
2213
+ * @return array bitstream
2214
+ */
2215
+ protected function appendBytes($bitstream, $size, $data) {
2216
+ if ($size == 0) {
2217
+ return 0;
2218
+ }
2219
+ $b = $this->newFromBytes($size, $data);
2220
+ return $this->appendBitstream($bitstream, $b);
2221
+ }
2222
+
2223
+ /**
2224
+ * Convert bitstream to bytes
2225
+ * @param $bstream (array) original bitstream
2226
+ * @return array of bytes
2227
+ */
2228
+ protected function bitstreamToByte($bstream) {
2229
+ if (is_null($bstream)) {
2230
+ return null;
2231
+ }
2232
+ $size = count($bstream);
2233
+ if ($size == 0) {
2234
+ return array();
2235
+ }
2236
+ $data = array_fill(0, (int)(($size + 7) / 8), 0);
2237
+ $bytes = (int)($size / 8);
2238
+ $p = 0;
2239
+ for ($i=0; $i<$bytes; $i++) {
2240
+ $v = 0;
2241
+ for ($j=0; $j<8; $j++) {
2242
+ $v = $v << 1;
2243
+ $v |= $bstream[$p];
2244
+ $p++;
2245
+ }
2246
+ $data[$i] = $v;
2247
+ }
2248
+ if ($size & 7) {
2249
+ $v = 0;
2250
+ for ($j=0; $j<($size & 7); $j++) {
2251
+ $v = $v << 1;
2252
+ $v |= $bstream[$p];
2253
+ $p++;
2254
+ }
2255
+ $data[$bytes] = $v;
2256
+ }
2257
+ return $data;
2258
+ }
2259
+
2260
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
2261
+
2262
+ // QRspec
2263
+
2264
+ /**
2265
+ * Replace a value on the array at the specified position
2266
+ * @param $srctab (array)
2267
+ * @param $x (int) X position
2268
+ * @param $y (int) Y position
2269
+ * @param $repl (string) value to replace
2270
+ * @param $replLen (int) length of the repl string
2271
+ * @return array srctab
2272
+ */
2273
+ protected function qrstrset($srctab, $x, $y, $repl, $replLen=false) {
2274
+ $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl));
2275
+ return $srctab;
2276
+ }
2277
+
2278
+ /**
2279
+ * Return maximum data code length (bytes) for the version.
2280
+ * @param $version (int) version
2281
+ * @param $level (int) error correction level
2282
+ * @return int maximum size (bytes)
2283
+ */
2284
+ protected function getDataLength($version, $level) {
2285
+ return $this->capacity[$version][QRCAP_WORDS] - $this->capacity[$version][QRCAP_EC][$level];
2286
+ }
2287
+
2288
+ /**
2289
+ * Return maximum error correction code length (bytes) for the version.
2290
+ * @param $version (int) version
2291
+ * @param $level (int) error correction level
2292
+ * @return int ECC size (bytes)
2293
+ */
2294
+ protected function getECCLength($version, $level){
2295
+ return $this->capacity[$version][QRCAP_EC][$level];
2296
+ }
2297
+
2298
+ /**
2299
+ * Return the width of the symbol for the version.
2300
+ * @param $version (int) version
2301
+ * @return int width
2302
+ */
2303
+ protected function getWidth($version) {
2304
+ return $this->capacity[$version][QRCAP_WIDTH];
2305
+ }
2306
+
2307
+ /**
2308
+ * Return the numer of remainder bits.
2309
+ * @param $version (int) version
2310
+ * @return int number of remainder bits
2311
+ */
2312
+ protected function getRemainder($version) {
2313
+ return $this->capacity[$version][QRCAP_REMINDER];
2314
+ }
2315
+
2316
+ /**
2317
+ * Return a version number that satisfies the input code length.
2318
+ * @param $size (int) input code length (bytes)
2319
+ * @param $level (int) error correction level
2320
+ * @return int version number
2321
+ */
2322
+ protected function getMinimumVersion($size, $level) {
2323
+ for ($i = 1; $i <= QRSPEC_VERSION_MAX; ++$i) {
2324
+ $words = ($this->capacity[$i][QRCAP_WORDS] - $this->capacity[$i][QRCAP_EC][$level]);
2325
+ if ($words >= $size) {
2326
+ return $i;
2327
+ }
2328
+ }
2329
+ // the size of input data is greater than QR capacity, try to lover the error correction mode
2330
+ return -1;
2331
+ }
2332
+
2333
+ /**
2334
+ * Return the size of length indicator for the mode and version.
2335
+ * @param $mode (int) encoding mode
2336
+ * @param $version (int) version
2337
+ * @return int the size of the appropriate length indicator (bits).
2338
+ */
2339
+ protected function lengthIndicator($mode, $version) {
2340
+ if ($mode == QR_MODE_ST) {
2341
+ return 0;
2342
+ }
2343
+ if ($version <= 9) {
2344
+ $l = 0;
2345
+ } elseif ($version <= 26) {
2346
+ $l = 1;
2347
+ } else {
2348
+ $l = 2;
2349
+ }
2350
+ return $this->lengthTableBits[$mode][$l];
2351
+ }
2352
+
2353
+ /**
2354
+ * Return the maximum length for the mode and version.
2355
+ * @param $mode (int) encoding mode
2356
+ * @param $version (int) version
2357
+ * @return int the maximum length (bytes)
2358
+ */
2359
+ protected function maximumWords($mode, $version) {
2360
+ if ($mode == QR_MODE_ST) {
2361
+ return 3;
2362
+ }
2363
+ if ($version <= 9) {
2364
+ $l = 0;
2365
+ } else if ($version <= 26) {
2366
+ $l = 1;
2367
+ } else {
2368
+ $l = 2;
2369
+ }
2370
+ $bits = $this->lengthTableBits[$mode][$l];
2371
+ $words = (1 << $bits) - 1;
2372
+ if ($mode == QR_MODE_KJ) {
2373
+ $words *= 2; // the number of bytes is required
2374
+ }
2375
+ return $words;
2376
+ }
2377
+
2378
+ /**
2379
+ * Return an array of ECC specification.
2380
+ * @param $version (int) version
2381
+ * @param $level (int) error correction level
2382
+ * @param $spec (array) an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code}
2383
+ * @return array spec
2384
+ */
2385
+ protected function getEccSpec($version, $level, $spec) {
2386
+ if (count($spec) < 5) {
2387
+ $spec = array(0, 0, 0, 0, 0);
2388
+ }
2389
+ $b1 = $this->eccTable[$version][$level][0];
2390
+ $b2 = $this->eccTable[$version][$level][1];
2391
+ $data = $this->getDataLength($version, $level);
2392
+ $ecc = $this->getECCLength($version, $level);
2393
+ if ($b2 == 0) {
2394
+ $spec[0] = $b1;
2395
+ $spec[1] = (int)($data / $b1);
2396
+ $spec[2] = (int)($ecc / $b1);
2397
+ $spec[3] = 0;
2398
+ $spec[4] = 0;
2399
+ } else {
2400
+ $spec[0] = $b1;
2401
+ $spec[1] = (int)($data / ($b1 + $b2));
2402
+ $spec[2] = (int)($ecc / ($b1 + $b2));
2403
+ $spec[3] = $b2;
2404
+ $spec[4] = $spec[1] + 1;
2405
+ }
2406
+ return $spec;
2407
+ }
2408
+
2409
+ /**
2410
+ * Put an alignment marker.
2411
+ * @param $frame (array) frame
2412
+ * @param $ox (int) X center coordinate of the pattern
2413
+ * @param $oy (int) Y center coordinate of the pattern
2414
+ * @return array frame
2415
+ */
2416
+ protected function putAlignmentMarker($frame, $ox, $oy) {
2417
+ $finder = array(
2418
+ "\xa1\xa1\xa1\xa1\xa1",
2419
+ "\xa1\xa0\xa0\xa0\xa1",
2420
+ "\xa1\xa0\xa1\xa0\xa1",
2421
+ "\xa1\xa0\xa0\xa0\xa1",
2422
+ "\xa1\xa1\xa1\xa1\xa1"
2423
+ );
2424
+ $yStart = $oy - 2;
2425
+ $xStart = $ox - 2;
2426
+ for ($y=0; $y < 5; $y++) {
2427
+ $frame = $this->qrstrset($frame, $xStart, $yStart+$y, $finder[$y]);
2428
+ }
2429
+ return $frame;
2430
+ }
2431
+
2432
+ /**
2433
+ * Put an alignment pattern.
2434
+ * @param $version (int) version
2435
+ * @param $frame (array) frame
2436
+ * @param $width (int) width
2437
+ * @return array frame
2438
+ */
2439
+ protected function putAlignmentPattern($version, $frame, $width) {
2440
+ if ($version < 2) {
2441
+ return $frame;
2442
+ }
2443
+ $d = $this->alignmentPattern[$version][1] - $this->alignmentPattern[$version][0];
2444
+ if ($d < 0) {
2445
+ $w = 2;
2446
+ } else {
2447
+ $w = (int)(($width - $this->alignmentPattern[$version][0]) / $d + 2);
2448
+ }
2449
+ if ($w * $w - 3 == 1) {
2450
+ $x = $this->alignmentPattern[$version][0];
2451
+ $y = $this->alignmentPattern[$version][0];
2452
+ $frame = $this->putAlignmentMarker($frame, $x, $y);
2453
+ return $frame;
2454
+ }
2455
+ $cx = $this->alignmentPattern[$version][0];
2456
+ $wo = $w - 1;
2457
+ for ($x=1; $x < $wo; ++$x) {
2458
+ $frame = $this->putAlignmentMarker($frame, 6, $cx);
2459
+ $frame = $this->putAlignmentMarker($frame, $cx, 6);
2460
+ $cx += $d;
2461
+ }
2462
+ $cy = $this->alignmentPattern[$version][0];
2463
+ for ($y=0; $y < $wo; ++$y) {
2464
+ $cx = $this->alignmentPattern[$version][0];
2465
+ for ($x=0; $x < $wo; ++$x) {
2466
+ $frame = $this->putAlignmentMarker($frame, $cx, $cy);
2467
+ $cx += $d;
2468
+ }
2469
+ $cy += $d;
2470
+ }
2471
+ return $frame;
2472
+ }
2473
+
2474
+ /**
2475
+ * Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits.
2476
+ * @param $version (int) version
2477
+ * @return BCH encoded version information pattern
2478
+ */
2479
+ protected function getVersionPattern($version) {
2480
+ if (($version < 7) OR ($version > QRSPEC_VERSION_MAX)) {
2481
+ return 0;
2482
+ }
2483
+ return $this->versionPattern[($version - 7)];
2484
+ }
2485
+
2486
+ /**
2487
+ * Return BCH encoded format information pattern.
2488
+ * @param $mask (array)
2489
+ * @param $level (int) error correction level
2490
+ * @return BCH encoded format information pattern
2491
+ */
2492
+ protected function getFormatInfo($mask, $level) {
2493
+ if (($mask < 0) OR ($mask > 7)) {
2494
+ return 0;
2495
+ }
2496
+ if (($level < 0) OR ($level > 3)) {
2497
+ return 0;
2498
+ }
2499
+ return $this->formatInfo[$level][$mask];
2500
+ }
2501
+
2502
+ /**
2503
+ * Put a finder pattern.
2504
+ * @param $frame (array) frame
2505
+ * @param $ox (int) X center coordinate of the pattern
2506
+ * @param $oy (int) Y center coordinate of the pattern
2507
+ * @return array frame
2508
+ */
2509
+ protected function putFinderPattern($frame, $ox, $oy) {
2510
+ $finder = array(
2511
+ "\xc1\xc1\xc1\xc1\xc1\xc1\xc1",
2512
+ "\xc1\xc0\xc0\xc0\xc0\xc0\xc1",
2513
+ "\xc1\xc0\xc1\xc1\xc1\xc0\xc1",
2514
+ "\xc1\xc0\xc1\xc1\xc1\xc0\xc1",
2515
+ "\xc1\xc0\xc1\xc1\xc1\xc0\xc1",
2516
+ "\xc1\xc0\xc0\xc0\xc0\xc0\xc1",
2517
+ "\xc1\xc1\xc1\xc1\xc1\xc1\xc1"
2518
+ );
2519
+ for ($y=0; $y < 7; $y++) {
2520
+ $frame = $this->qrstrset($frame, $ox, ($oy + $y), $finder[$y]);
2521
+ }
2522
+ return $frame;
2523
+ }
2524
+
2525
+ /**
2526
+ * Return a copy of initialized frame.
2527
+ * @param $version (int) version
2528
+ * @return Array of unsigned char.
2529
+ */
2530
+ protected function createFrame($version) {
2531
+ $width = $this->capacity[$version][QRCAP_WIDTH];
2532
+ $frameLine = str_repeat ("\0", $width);
2533
+ $frame = array_fill(0, $width, $frameLine);
2534
+ // Finder pattern
2535
+ $frame = $this->putFinderPattern($frame, 0, 0);
2536
+ $frame = $this->putFinderPattern($frame, $width - 7, 0);
2537
+ $frame = $this->putFinderPattern($frame, 0, $width - 7);
2538
+ // Separator
2539
+ $yOffset = $width - 7;
2540
+ for ($y=0; $y < 7; ++$y) {
2541
+ $frame[$y][7] = "\xc0";
2542
+ $frame[$y][$width - 8] = "\xc0";
2543
+ $frame[$yOffset][7] = "\xc0";
2544
+ ++$yOffset;
2545
+ }
2546
+ $setPattern = str_repeat("\xc0", 8);
2547
+ $frame = $this->qrstrset($frame, 0, 7, $setPattern);
2548
+ $frame = $this->qrstrset($frame, $width-8, 7, $setPattern);
2549
+ $frame = $this->qrstrset($frame, 0, $width - 8, $setPattern);
2550
+ // Format info
2551
+ $setPattern = str_repeat("\x84", 9);
2552
+ $frame = $this->qrstrset($frame, 0, 8, $setPattern);
2553
+ $frame = $this->qrstrset($frame, $width - 8, 8, $setPattern, 8);
2554
+ $yOffset = $width - 8;
2555
+ for ($y=0; $y < 8; ++$y,++$yOffset) {
2556
+ $frame[$y][8] = "\x84";
2557
+ $frame[$yOffset][8] = "\x84";
2558
+ }
2559
+ // Timing pattern
2560
+ $wo = $width - 15;
2561
+ for ($i=1; $i < $wo; ++$i) {
2562
+ $frame[6][7+$i] = chr(0x90 | ($i & 1));
2563
+ $frame[7+$i][6] = chr(0x90 | ($i & 1));
2564
+ }
2565
+ // Alignment pattern
2566
+ $frame = $this->putAlignmentPattern($version, $frame, $width);
2567
+ // Version information
2568
+ if ($version >= 7) {
2569
+ $vinf = $this->getVersionPattern($version);
2570
+ $v = $vinf;
2571
+ for ($x=0; $x<6; ++$x) {
2572
+ for ($y=0; $y<3; ++$y) {
2573
+ $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1));
2574
+ $v = $v >> 1;
2575
+ }
2576
+ }
2577
+ $v = $vinf;
2578
+ for ($y=0; $y<6; ++$y) {
2579
+ for ($x=0; $x<3; ++$x) {
2580
+ $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1));
2581
+ $v = $v >> 1;
2582
+ }
2583
+ }
2584
+ }
2585
+ // and a little bit...
2586
+ $frame[$width - 8][8] = "\x81";
2587
+ return $frame;
2588
+ }
2589
+
2590
+ /**
2591
+ * Set new frame for the specified version.
2592
+ * @param $version (int) version
2593
+ * @return Array of unsigned char.
2594
+ */
2595
+ protected function newFrame($version) {
2596
+ if (($version < 1) OR ($version > QRSPEC_VERSION_MAX)) {
2597
+ return NULL;
2598
+ }
2599
+ if (!isset($this->frames[$version])) {
2600
+ $this->frames[$version] = $this->createFrame($version);
2601
+ }
2602
+ if (is_null($this->frames[$version])) {
2603
+ return NULL;
2604
+ }
2605
+ return $this->frames[$version];
2606
+ }
2607
+
2608
+ /**
2609
+ * Return block number 0
2610
+ * @param $spec (array)
2611
+ * @return int value
2612
+ */
2613
+ protected function rsBlockNum($spec) {
2614
+ return ($spec[0] + $spec[3]);
2615
+ }
2616
+
2617
+ /**
2618
+ * Return block number 1
2619
+ * @param $spec (array)
2620
+ * @return int value
2621
+ */
2622
+ protected function rsBlockNum1($spec) {
2623
+ return $spec[0];
2624
+ }
2625
+
2626
+ /**
2627
+ * Return data codes 1
2628
+ * @param $spec (array)
2629
+ * @return int value
2630
+ */
2631
+ protected function rsDataCodes1($spec) {
2632
+ return $spec[1];
2633
+ }
2634
+
2635
+ /**
2636
+ * Return ecc codes 1
2637
+ * @param $spec (array)
2638
+ * @return int value
2639
+ */
2640
+ protected function rsEccCodes1($spec) {
2641
+ return $spec[2];
2642
+ }
2643
+
2644
+ /**
2645
+ * Return block number 2
2646
+ * @param $spec (array)
2647
+ * @return int value
2648
+ */
2649
+ protected function rsBlockNum2($spec) {
2650
+ return $spec[3];
2651
+ }
2652
+
2653
+ /**
2654
+ * Return data codes 2
2655
+ * @param $spec (array)
2656
+ * @return int value
2657
+ */
2658
+ protected function rsDataCodes2($spec) {
2659
+ return $spec[4];
2660
+ }
2661
+
2662
+ /**
2663
+ * Return ecc codes 2
2664
+ * @param $spec (array)
2665
+ * @return int value
2666
+ */
2667
+ protected function rsEccCodes2($spec) {
2668
+ return $spec[2];
2669
+ }
2670
+
2671
+ /**
2672
+ * Return data length
2673
+ * @param $spec (array)
2674
+ * @return int value
2675
+ */
2676
+ protected function rsDataLength($spec) {
2677
+ return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]);
2678
+ }
2679
+
2680
+ /**
2681
+ * Return ecc length
2682
+ * @param $spec (array)
2683
+ * @return int value
2684
+ */
2685
+ protected function rsEccLength($spec) {
2686
+ return ($spec[0] + $spec[3]) * $spec[2];
2687
+ }
2688
+
2689
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
2690
+
2691
+ // QRrs
2692
+
2693
+ /**
2694
+ * Initialize a Reed-Solomon codec and add it to existing rsitems
2695
+ * @param $symsize (int) symbol size, bits
2696
+ * @param $gfpoly (int) Field generator polynomial coefficients
2697
+ * @param $fcr (int) first root of RS code generator polynomial, index form
2698
+ * @param $prim (int) primitive element to generate polynomial roots
2699
+ * @param $nroots (int) RS code generator polynomial degree (number of roots)
2700
+ * @param $pad (int) padding bytes at front of shortened block
2701
+ * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
2702
+ */
2703
+ protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
2704
+ foreach ($this->rsitems as $rs) {
2705
+ if (($rs['pad'] != $pad) OR ($rs['nroots'] != $nroots) OR ($rs['mm'] != $symsize)
2706
+ OR ($rs['gfpoly'] != $gfpoly) OR ($rs['fcr'] != $fcr) OR ($rs['prim'] != $prim)) {
2707
+ continue;
2708
+ }
2709
+ return $rs;
2710
+ }
2711
+ $rs = $this->init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad);
2712
+ array_unshift($this->rsitems, $rs);
2713
+ return $rs;
2714
+ }
2715
+
2716
+ // - - - - - - - - - - - - - - - - - - - - - - - - -
2717
+
2718
+ // QRrsItem
2719
+
2720
+ /**
2721
+ * modnn
2722
+ * @param $rs (array) RS values
2723
+ * @param $x (int) X position
2724
+ * @return int X osition
2725
+ */
2726
+ protected function modnn($rs, $x) {
2727
+ while ($x >= $rs['nn']) {
2728
+ $x -= $rs['nn'];
2729
+ $x = ($x >> $rs['mm']) + ($x & $rs['nn']);
2730
+ }
2731
+ return $x;
2732
+ }
2733
+
2734
+ /**
2735
+ * Initialize a Reed-Solomon codec and returns an array of values.
2736
+ * @param $symsize (int) symbol size, bits
2737
+ * @param $gfpoly (int) Field generator polynomial coefficients
2738
+ * @param $fcr (int) first root of RS code generator polynomial, index form
2739
+ * @param $prim (int) primitive element to generate polynomial roots
2740
+ * @param $nroots (int) RS code generator polynomial degree (number of roots)
2741
+ * @param $pad (int) padding bytes at front of shortened block
2742
+ * @return array Array of RS values:<ul><li>mm = Bits per symbol;</li><li>nn = Symbols per block;</li><li>alpha_to = log lookup table array;</li><li>index_of = Antilog lookup table array;</li><li>genpoly = Generator polynomial array;</li><li>nroots = Number of generator;</li><li>roots = number of parity symbols;</li><li>fcr = First consecutive root, index form;</li><li>prim = Primitive element, index form;</li><li>iprim = prim-th root of 1, index form;</li><li>pad = Padding bytes in shortened block;</li><li>gfpoly</ul>.
2743
+ */
2744
+ protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) {
2745
+ // Based on Reed solomon encoder by Phil Karn, KA9Q (GNU-LGPLv2)
2746
+ $rs = null;
2747
+ // Check parameter ranges
2748
+ if (($symsize < 0) OR ($symsize > 8)) {
2749
+ return $rs;
2750
+ }
2751
+ if (($fcr < 0) OR ($fcr >= (1<<$symsize))) {
2752
+ return $rs;
2753
+ }
2754
+ if (($prim <= 0) OR ($prim >= (1<<$symsize))) {
2755
+ return $rs;
2756
+ }
2757
+ if (($nroots < 0) OR ($nroots >= (1<<$symsize))) {
2758
+ return $rs;
2759
+ }
2760
+ if (($pad < 0) OR ($pad >= ((1<<$symsize) -1 - $nroots))) {
2761
+ return $rs;
2762
+ }
2763
+ $rs = array();
2764
+ $rs['mm'] = $symsize;
2765
+ $rs['nn'] = (1 << $symsize) - 1;
2766
+ $rs['pad'] = $pad;
2767
+ $rs['alpha_to'] = array_fill(0, ($rs['nn'] + 1), 0);
2768
+ $rs['index_of'] = array_fill(0, ($rs['nn'] + 1), 0);
2769
+ // PHP style macro replacement ;)
2770
+ $NN =& $rs['nn'];
2771
+ $A0 =& $NN;
2772
+ // Generate Galois field lookup tables
2773
+ $rs['index_of'][0] = $A0; // log(zero) = -inf
2774
+ $rs['alpha_to'][$A0] = 0; // alpha**-inf = 0
2775
+ $sr = 1;
2776
+ for ($i=0; $i<$rs['nn']; ++$i) {
2777
+ $rs['index_of'][$sr] = $i;
2778
+ $rs['alpha_to'][$i] = $sr;
2779
+ $sr <<= 1;
2780
+ if ($sr & (1 << $symsize)) {
2781
+ $sr ^= $gfpoly;
2782
+ }
2783
+ $sr &= $rs['nn'];
2784
+ }
2785
+ if ($sr != 1) {
2786
+ // field generator polynomial is not primitive!
2787
+ return NULL;
2788
+ }
2789
+ // Form RS code generator polynomial from its roots
2790
+ $rs['genpoly'] = array_fill(0, ($nroots + 1), 0);
2791
+ $rs['fcr'] = $fcr;
2792
+ $rs['prim'] = $prim;
2793
+ $rs['nroots'] = $nroots;
2794
+ $rs['gfpoly'] = $gfpoly;
2795
+ // Find prim-th root of 1, used in decoding
2796
+ for ($iprim=1; ($iprim % $prim) != 0; $iprim += $rs['nn']) {
2797
+ ; // intentional empty-body loop!
2798
+ }
2799
+ $rs['iprim'] = (int)($iprim / $prim);
2800
+ $rs['genpoly'][0] = 1;
2801
+ for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) {
2802
+ $rs['genpoly'][$i+1] = 1;
2803
+ // Multiply rs->genpoly[] by @**(root + x)
2804
+ for ($j = $i; $j > 0; --$j) {
2805
+ if ($rs['genpoly'][$j] != 0) {
2806
+ $rs['genpoly'][$j] = $rs['genpoly'][$j-1] ^ $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][$j]] + $root)];
2807
+ } else {
2808
+ $rs['genpoly'][$j] = $rs['genpoly'][$j-1];
2809
+ }
2810
+ }
2811
+ // rs->genpoly[0] can never be zero
2812
+ $rs['genpoly'][0] = $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][0]] + $root)];
2813
+ }
2814
+ // convert rs->genpoly[] to index form for quicker encoding
2815
+ for ($i = 0; $i <= $nroots; ++$i) {
2816
+ $rs['genpoly'][$i] = $rs['index_of'][$rs['genpoly'][$i]];
2817
+ }
2818
+ return $rs;
2819
+ }
2820
+
2821
+ /**
2822
+ * Encode a Reed-Solomon codec and returns the parity array
2823
+ * @param $rs (array) RS values
2824
+ * @param $data (array) data
2825
+ * @param $parity (array) parity
2826
+ * @return parity array
2827
+ */
2828
+ protected function encode_rs_char($rs, $data, $parity) {
2829
+ $MM =& $rs['mm']; // bits per symbol
2830
+ $NN =& $rs['nn']; // the total number of symbols in a RS block
2831
+ $ALPHA_TO =& $rs['alpha_to']; // the address of an array of NN elements to convert Galois field elements in index (log) form to polynomial form
2832
+ $INDEX_OF =& $rs['index_of']; // the address of an array of NN elements to convert Galois field elements in polynomial form to index (log) form
2833
+ $GENPOLY =& $rs['genpoly']; // an array of NROOTS+1 elements containing the generator polynomial in index form
2834
+ $NROOTS =& $rs['nroots']; // the number of roots in the RS code generator polynomial, which is the same as the number of parity symbols in a block
2835
+ $FCR =& $rs['fcr']; // first consecutive root, index form
2836
+ $PRIM =& $rs['prim']; // primitive element, index form
2837
+ $IPRIM =& $rs['iprim']; // prim-th root of 1, index form
2838
+ $PAD =& $rs['pad']; // the number of pad symbols in a block
2839
+ $A0 =& $NN;
2840
+ $parity = array_fill(0, $NROOTS, 0);
2841
+ for ($i=0; $i < ($NN - $NROOTS - $PAD); $i++) {
2842
+ $feedback = $INDEX_OF[$data[$i] ^ $parity[0]];
2843
+ if ($feedback != $A0) {
2844
+ // feedback term is non-zero
2845
+ // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must
2846
+ // always be for the polynomials constructed by init_rs()
2847
+ $feedback = $this->modnn($rs, $NN - $GENPOLY[$NROOTS] + $feedback);
2848
+ for ($j=1; $j < $NROOTS; ++$j) {
2849
+ $parity[$j] ^= $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[($NROOTS - $j)])];
2850
+ }
2851
+ }
2852
+ // Shift
2853
+ array_shift($parity);
2854
+ if ($feedback != $A0) {
2855
+ array_push($parity, $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[0])]);
2856
+ } else {
2857
+ array_push($parity, 0);
2858
+ }
2859
+ }
2860
+ return $parity;
2861
+ }
2862
+
2863
+ } // end QRcode class
2864
+
2865
+ //============================================================+
2866
+ // END OF FILE
2867
+ //============================================================+
includes/lib/{tcpdf_min → tcpdf}/include/sRGB.icc RENAMED
File without changes
includes/lib/{tcpdf_min → tcpdf}/include/tcpdf_colors.php RENAMED
@@ -1,462 +1,462 @@
1
- <?php
2
- //============================================================+
3
- // File name : tcpdf_colors.php
4
- // Version : 1.0.004
5
- // Begin : 2002-04-09
6
- // Last Update : 2014-04-25
7
- // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
- // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
- // -------------------------------------------------------------------
10
- // Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD
11
- //
12
- // This file is part of TCPDF software library.
13
- //
14
- // TCPDF is free software: you can redistribute it and/or modify it
15
- // under the terms of the GNU Lesser General Public License as
16
- // published by the Free Software Foundation, either version 3 of the
17
- // License, or (at your option) any later version.
18
- //
19
- // TCPDF is distributed in the hope that it will be useful, but
20
- // WITHOUT ANY WARRANTY; without even the implied warranty of
21
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
- // See the GNU Lesser General Public License for more details.
23
- //
24
- // You should have received a copy of the GNU Lesser General Public License
25
- // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
- //
27
- // See LICENSE.TXT file for more information.
28
- // -------------------------------------------------------------------
29
- //
30
- // Description : Array of WEB safe colors
31
- //
32
- //============================================================+
33
-
34
- /**
35
- * @file
36
- * PHP color class for TCPDF
37
- * @author Nicola Asuni
38
- * @package com.tecnick.tcpdf
39
- */
40
-
41
- /**
42
- * @class TCPDF_COLORS
43
- * PHP color class for TCPDF
44
- * @package com.tecnick.tcpdf
45
- * @version 1.0.004
46
- * @author Nicola Asuni - info@tecnick.com
47
- */
48
- class TCPDF_COLORS {
49
-
50
- /**
51
- * Array of WEB safe colors
52
- * @public static
53
- */
54
- public static $webcolor = array (
55
- 'aliceblue' => 'f0f8ff',
56
- 'antiquewhite' => 'faebd7',
57
- 'aqua' => '00ffff',
58
- 'aquamarine' => '7fffd4',
59
- 'azure' => 'f0ffff',
60
- 'beige' => 'f5f5dc',
61
- 'bisque' => 'ffe4c4',
62
- 'black' => '000000',
63
- 'blanchedalmond' => 'ffebcd',
64
- 'blue' => '0000ff',
65
- 'blueviolet' => '8a2be2',
66
- 'brown' => 'a52a2a',
67
- 'burlywood' => 'deb887',
68
- 'cadetblue' => '5f9ea0',
69
- 'chartreuse' => '7fff00',
70
- 'chocolate' => 'd2691e',
71
- 'coral' => 'ff7f50',
72
- 'cornflowerblue' => '6495ed',
73
- 'cornsilk' => 'fff8dc',
74
- 'crimson' => 'dc143c',
75
- 'cyan' => '00ffff',
76
- 'darkblue' => '00008b',
77
- 'darkcyan' => '008b8b',
78
- 'darkgoldenrod' => 'b8860b',
79
- 'dkgray' => 'a9a9a9',
80
- 'darkgray' => 'a9a9a9',
81
- 'darkgrey' => 'a9a9a9',
82
- 'darkgreen' => '006400',
83
- 'darkkhaki' => 'bdb76b',
84
- 'darkmagenta' => '8b008b',
85
- 'darkolivegreen' => '556b2f',
86
- 'darkorange' => 'ff8c00',
87
- 'darkorchid' => '9932cc',
88
- 'darkred' => '8b0000',
89
- 'darksalmon' => 'e9967a',
90
- 'darkseagreen' => '8fbc8f',
91
- 'darkslateblue' => '483d8b',
92
- 'darkslategray' => '2f4f4f',
93
- 'darkslategrey' => '2f4f4f',
94
- 'darkturquoise' => '00ced1',
95
- 'darkviolet' => '9400d3',
96
- 'deeppink' => 'ff1493',
97
- 'deepskyblue' => '00bfff',
98
- 'dimgray' => '696969',
99
- 'dimgrey' => '696969',
100
- 'dodgerblue' => '1e90ff',
101
- 'firebrick' => 'b22222',
102
- 'floralwhite' => 'fffaf0',
103
- 'forestgreen' => '228b22',
104
- 'fuchsia' => 'ff00ff',
105
- 'gainsboro' => 'dcdcdc',
106
- 'ghostwhite' => 'f8f8ff',
107
- 'gold' => 'ffd700',
108
- 'goldenrod' => 'daa520',
109
- 'gray' => '808080',
110
- 'grey' => '808080',
111
- 'green' => '008000',
112
- 'greenyellow' => 'adff2f',
113
- 'honeydew' => 'f0fff0',
114
- 'hotpink' => 'ff69b4',
115
- 'indianred' => 'cd5c5c',
116
- 'indigo' => '4b0082',
117
- 'ivory' => 'fffff0',
118
- 'khaki' => 'f0e68c',
119
- 'lavender' => 'e6e6fa',
120
- 'lavenderblush' => 'fff0f5',
121
- 'lawngreen' => '7cfc00',
122
- 'lemonchiffon' => 'fffacd',
123
- 'lightblue' => 'add8e6',
124
- 'lightcoral' => 'f08080',
125
- 'lightcyan' => 'e0ffff',
126
- 'lightgoldenrodyellow' => 'fafad2',
127
- 'ltgray' => 'd3d3d3',
128
- 'lightgray' => 'd3d3d3',
129
- 'lightgrey' => 'd3d3d3',
130
- 'lightgreen' => '90ee90',
131
- 'lightpink' => 'ffb6c1',
132
- 'lightsalmon' => 'ffa07a',
133
- 'lightseagreen' => '20b2aa',
134
- 'lightskyblue' => '87cefa',
135
- 'lightslategray' => '778899',
136
- 'lightslategrey' => '778899',
137
- 'lightsteelblue' => 'b0c4de',
138
- 'lightyellow' => 'ffffe0',
139
- 'lime' => '00ff00',
140
- 'limegreen' => '32cd32',
141
- 'linen' => 'faf0e6',
142
- 'magenta' => 'ff00ff',
143
- 'maroon' => '800000',
144
- 'mediumaquamarine' => '66cdaa',
145
- 'mediumblue' => '0000cd',
146
- 'mediumorchid' => 'ba55d3',
147
- 'mediumpurple' => '9370d8',
148
- 'mediumseagreen' => '3cb371',
149
- 'mediumslateblue' => '7b68ee',
150
- 'mediumspringgreen' => '00fa9a',
151
- 'mediumturquoise' => '48d1cc',
152
- 'mediumvioletred' => 'c71585',
153
- 'midnightblue' => '191970',
154
- 'mintcream' => 'f5fffa',
155
- 'mistyrose' => 'ffe4e1',
156
- 'moccasin' => 'ffe4b5',
157
- 'navajowhite' => 'ffdead',
158
- 'navy' => '000080',
159
- 'oldlace' => 'fdf5e6',
160
- 'olive' => '808000',
161
- 'olivedrab' => '6b8e23',
162
- 'orange' => 'ffa500',
163
- 'orangered' => 'ff4500',
164
- 'orchid' => 'da70d6',
165
- 'palegoldenrod' => 'eee8aa',
166
- 'palegreen' => '98fb98',
167
- 'paleturquoise' => 'afeeee',
168
- 'palevioletred' => 'd87093',
169
- 'papayawhip' => 'ffefd5',
170
- 'peachpuff' => 'ffdab9',
171
- 'peru' => 'cd853f',
172
- 'pink' => 'ffc0cb',
173
- 'plum' => 'dda0dd',
174
- 'powderblue' => 'b0e0e6',
175
- 'purple' => '800080',
176
- 'red' => 'ff0000',
177
- 'rosybrown' => 'bc8f8f',
178
- 'royalblue' => '4169e1',
179
- 'saddlebrown' => '8b4513',
180
- 'salmon' => 'fa8072',
181
- 'sandybrown' => 'f4a460',
182
- 'seagreen' => '2e8b57',
183
- 'seashell' => 'fff5ee',
184
- 'sienna' => 'a0522d',
185
- 'silver' => 'c0c0c0',
186
- 'skyblue' => '87ceeb',
187
- 'slateblue' => '6a5acd',
188
- 'slategray' => '708090',
189
- 'slategrey' => '708090',
190
- 'snow' => 'fffafa',
191
- 'springgreen' => '00ff7f',
192
- 'steelblue' => '4682b4',
193
- 'tan' => 'd2b48c',
194
- 'teal' => '008080',
195
- 'thistle' => 'd8bfd8',
196
- 'tomato' => 'ff6347',
197
- 'turquoise' => '40e0d0',
198
- 'violet' => 'ee82ee',
199
- 'wheat' => 'f5deb3',
200
- 'white' => 'ffffff',
201
- 'whitesmoke' => 'f5f5f5',
202
- 'yellow' => 'ffff00',
203
- 'yellowgreen' => '9acd32'
204
- ); // end of web colors
205
-
206
- /**
207
- * Array of valid JavaScript color names
208
- * @public static
209
- */
210
- public static $jscolor = array ('transparent', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dkGray', 'gray', 'ltGray');
211
-
212
- /**
213
- * Array of Spot colors (C,M,Y,K,name)
214
- * Color keys must be in lowercase and without spaces.
215
- * As long as no open standard for spot colours exists, you have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly.
216
- * Common industry standard spot colors are: ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH.
217
- * @public static
218
- */
219
- public static $spotcolor = array (
220
- // special registration colors
221
- 'none' => array( 0, 0, 0, 0, 'None'),
222
- 'all' => array(100, 100, 100, 100, 'All'),
223
- // standard CMYK colors
224
- 'cyan' => array(100, 0, 0, 0, 'Cyan'),
225
- 'magenta' => array( 0, 100, 0, 0, 'Magenta'),
226
- 'yellow' => array( 0, 0, 100, 0, 'Yellow'),
227
- 'key' => array( 0, 0, 0, 100, 'Key'),
228
- // alias
229
- 'white' => array( 0, 0, 0, 0, 'White'),
230
- 'black' => array( 0, 0, 0, 100, 'Black'),
231
- // standard RGB colors
232
- 'red' => array( 0, 100, 100, 0, 'Red'),
233
- 'green' => array(100, 0, 100, 0, 'Green'),
234
- 'blue' => array(100, 100, 0, 0, 'Blue'),
235
- // Add here standard spot colors or dynamically define them with AddSpotColor()
236
- // ...
237
- ); // end of spot colors
238
-
239
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
240
-
241
- /**
242
- * Return the Spot color array.
243
- * @param $name (string) Name of the spot color.
244
- * @param $spotc (array) Reference to an array of spot colors.
245
- * @return (array) Spot color array or false if not defined.
246
- * @since 5.9.125 (2011-10-03)
247
- * @public static
248
- */
249
- public static function getSpotColor($name, &$spotc) {
250
- if (isset($spotc[$name])) {
251
- return $spotc[$name];
252
- }
253
- $color = preg_replace('/[\s]*/', '', $name); // remove extra spaces
254
- $color = strtolower($color);
255
- if (isset(self::$spotcolor[$color])) {
256
- if (!isset($spotc[$name])) {
257
- $i = (1 + count($spotc));
258
- $spotc[$name] = array('C' => self::$spotcolor[$color][0], 'M' => self::$spotcolor[$color][1], 'Y' => self::$spotcolor[$color][2], 'K' => self::$spotcolor[$color][3], 'name' => self::$spotcolor[$color][4], 'i' => $i);
259
- }
260
- return $spotc[self::$spotcolor[$color][4]];
261
- }
262
- return false;
263
- }
264
-
265
- /**
266
- * Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name.
267
- * @param $hcolor (string) HTML color.
268
- * @param $spotc (array) Reference to an array of spot colors.
269
- * @param $defcol (array) Color to return in case of error.
270
- * @return array RGB or CMYK color, or false in case of error.
271
- * @public static
272
- */
273
- public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'=>128,'G'=>128,'B'=>128)) {
274
- $color = preg_replace('/[\s]*/', '', $hcolor); // remove extra spaces
275
- $color = strtolower($color);
276
- // check for javascript color array syntax
277
- if (strpos($color, '[') !== false) {
278
- if (preg_match('/[\[][\"\'](t|g|rgb|cmyk)[\"\'][\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\]]/', $color, $m) > 0) {
279
- $returncolor = array();
280
- switch ($m[1]) {
281
- case 'cmyk': {
282
- // RGB
283
- $returncolor['C'] = max(0, min(100, (floatval($m[2]) * 100)));
284
- $returncolor['M'] = max(0, min(100, (floatval($m[3]) * 100)));
285
- $returncolor['Y'] = max(0, min(100, (floatval($m[4]) * 100)));
286
- $returncolor['K'] = max(0, min(100, (floatval($m[5]) * 100)));
287
- break;
288
- }
289
- case 'rgb': {
290
- // RGB
291
- $returncolor['R'] = max(0, min(255, (floatval($m[2]) * 255)));
292
- $returncolor['G'] = max(0, min(255, (floatval($m[3]) * 255)));
293
- $returncolor['B'] = max(0, min(255, (floatval($m[4]) * 255)));
294
- break;
295
- }
296
- case 'g': {
297
- // grayscale
298
- $returncolor['G'] = max(0, min(255, (floatval($m[2]) * 255)));
299
- break;
300
- }
301
- case 't':
302
- default: {
303
- // transparent (empty array)
304
- break;
305
- }
306
- }
307
- return $returncolor;
308
- }
309
- } elseif ((substr($color, 0, 4) != 'cmyk') AND (substr($color, 0, 3) != 'rgb') AND (($dotpos = strpos($color, '.')) !== false)) {
310
- // remove class parent (i.e.: color.red)
311
- $color = substr($color, ($dotpos + 1));
312
- if ($color == 'transparent') {
313
- // transparent (empty array)
314
- return array();
315
- }
316
- }
317
- if (strlen($color) == 0) {
318
- return $defcol;
319
- }
320
- // RGB ARRAY
321
- if (substr($color, 0, 3) == 'rgb') {
322
- $codes = substr($color, 4);
323
- $codes = str_replace(')', '', $codes);
324
- $returncolor = explode(',', $codes);
325
- foreach ($returncolor as $key => $val) {
326
- if (strpos($val, '%') > 0) {
327
- // percentage
328
- $returncolor[$key] = (255 * intval($val) / 100);
329
- } else {
330
- $returncolor[$key] = intval($val);
331
- }
332
- // normalize value
333
- $returncolor[$key] = max(0, min(255, $returncolor[$key]));
334
- }
335
- return $returncolor;
336
- }
337
- // CMYK ARRAY
338
- if (substr($color, 0, 4) == 'cmyk') {
339
- $codes = substr($color, 5);
340
- $codes = str_replace(')', '', $codes);
341
- $returncolor = explode(',', $codes);
342
- foreach ($returncolor as $key => $val) {
343
- if (strpos($val, '%') !== false) {
344
- // percentage
345
- $returncolor[$key] = (100 * intval($val) / 100);
346
- } else {
347
- $returncolor[$key] = intval($val);
348
- }
349
- // normalize value
350
- $returncolor[$key] = max(0, min(100, $returncolor[$key]));
351
- }
352
- return $returncolor;
353
- }
354
- if ($color[0] != '#') {
355
- // COLOR NAME
356
- if (isset(self::$webcolor[$color])) {
357
- // web color
358
- $color_code = self::$webcolor[$color];
359
- } else {
360
- // spot color
361
- $returncolor = self::getSpotColor($color, $spotc);
362
- if ($returncolor === false) {
363
- $returncolor = $defcol;
364
- }
365
- return $returncolor;
366
- }
367
- } else {
368
- $color_code = substr($color, 1);
369
- }
370
- // HEXADECIMAL REPRESENTATION
371
- switch (strlen($color_code)) {
372
- case 3: {
373
- // 3-digit RGB hexadecimal representation
374
- $r = substr($color_code, 0, 1);
375
- $g = substr($color_code, 1, 1);
376
- $b = substr($color_code, 2, 1);
377
- $returncolor = array();
378
- $returncolor['R'] = max(0, min(255, hexdec($r.$r)));
379
- $returncolor['G'] = max(0, min(255, hexdec($g.$g)));
380
- $returncolor['B'] = max(0, min(255, hexdec($b.$b)));
381
- break;
382
- }
383
- case 6: {
384
- // 6-digit RGB hexadecimal representation
385
- $returncolor = array();
386
- $returncolor['R'] = max(0, min(255, hexdec(substr($color_code, 0, 2))));
387
- $returncolor['G'] = max(0, min(255, hexdec(substr($color_code, 2, 2))));
388
- $returncolor['B'] = max(0, min(255, hexdec(substr($color_code, 4, 2))));
389
- break;
390
- }
391
- case 8: {
392
- // 8-digit CMYK hexadecimal representation
393
- $returncolor = array();
394
- $returncolor['C'] = max(0, min(100, round(hexdec(substr($color_code, 0, 2)) / 2.55)));
395
- $returncolor['M'] = max(0, min(100, round(hexdec(substr($color_code, 2, 2)) / 2.55)));
396
- $returncolor['Y'] = max(0, min(100, round(hexdec(substr($color_code, 4, 2)) / 2.55)));
397
- $returncolor['K'] = max(0, min(100, round(hexdec(substr($color_code, 6, 2)) / 2.55)));
398
- break;
399
- }
400
- default: {
401
- $returncolor = $defcol;
402
- break;
403
- }
404
- }
405
- return $returncolor;
406
- }
407
-
408
- /**
409
- * Convert a color array into a string representation.
410
- * @param $c (array) Array of colors.
411
- * @return (string) The color array representation.
412
- * @since 5.9.137 (2011-12-01)
413
- * @public static
414
- */
415
- public static function getColorStringFromArray($c) {
416
- $c = array_values($c);
417
- $color = '[';
418
- switch (count($c)) {
419
- case 4: {
420
- // CMYK
421
- $color .= sprintf('%F %F %F %F', (max(0, min(100, floatval($c[0]))) / 100), (max(0, min(100, floatval($c[1]))) / 100), (max(0, min(100, floatval($c[2]))) / 100), (max(0, min(100, floatval($c[3]))) / 100));
422
- break;
423
- }
424
- case 3: {
425
- // RGB
426
- $color .= sprintf('%F %F %F', (max(0, min(255, floatval($c[0]))) / 255), (max(0, min(255, floatval($c[1]))) / 255), (max(0, min(255, floatval($c[2]))) / 255));
427
- break;
428
- }
429
- case 1: {
430
- // grayscale
431
- $color .= sprintf('%F', (max(0, min(255, floatval($c[0]))) / 255));
432
- break;
433
- }
434
- }
435
- $color .= ']';
436
- return $color;
437
- }
438
-
439
- /**
440
- * Convert color to javascript color.
441
- * @param $color (string) color name or "#RRGGBB"
442
- * @protected
443
- * @since 2.1.002 (2008-02-12)
444
- * @public static
445
- */
446
- public static function _JScolor($color) {
447
- if (substr($color, 0, 1) == '#') {
448
- return sprintf("['RGB',%F,%F,%F]", (hexdec(substr($color, 1, 2)) / 255), (hexdec(substr($color, 3, 2)) / 255), (hexdec(substr($color, 5, 2)) / 255));
449
- }
450
- if (!in_array($color, self::$jscolor)) {
451
- // default transparent color
452
- $color = $jscolor[0];
453
- }
454
- return 'color.'.$color;
455
- }
456
-
457
-
458
- } // END OF TCPDF_COLORS CLASS
459
-
460
- //============================================================+
461
- // END OF FILE
462
- //============================================================+
1
+ <?php
2
+ //============================================================+
3
+ // File name : tcpdf_colors.php
4
+ // Version : 1.0.004
5
+ // Begin : 2002-04-09
6
+ // Last Update : 2014-04-25
7
+ // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
+ // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
+ // -------------------------------------------------------------------
10
+ // Copyright (C) 2002-2013 Nicola Asuni - Tecnick.com LTD
11
+ //
12
+ // This file is part of TCPDF software library.
13
+ //
14
+ // TCPDF is free software: you can redistribute it and/or modify it
15
+ // under the terms of the GNU Lesser General Public License as
16
+ // published by the Free Software Foundation, either version 3 of the
17
+ // License, or (at your option) any later version.
18
+ //
19
+ // TCPDF is distributed in the hope that it will be useful, but
20
+ // WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
+ // See the GNU Lesser General Public License for more details.
23
+ //
24
+ // You should have received a copy of the GNU Lesser General Public License
25
+ // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
+ //
27
+ // See LICENSE.TXT file for more information.
28
+ // -------------------------------------------------------------------
29
+ //
30
+ // Description : Array of WEB safe colors
31
+ //
32
+ //============================================================+
33
+
34
+ /**
35
+ * @file
36
+ * PHP color class for TCPDF
37
+ * @author Nicola Asuni
38
+ * @package com.tecnick.tcpdf
39
+ */
40
+
41
+ /**
42
+ * @class TCPDF_COLORS
43
+ * PHP color class for TCPDF
44
+ * @package com.tecnick.tcpdf
45
+ * @version 1.0.004
46
+ * @author Nicola Asuni - info@tecnick.com
47
+ */
48
+ class TCPDF_COLORS {
49
+
50
+ /**
51
+ * Array of WEB safe colors
52
+ * @public static
53
+ */
54
+ public static $webcolor = array (
55
+ 'aliceblue' => 'f0f8ff',
56
+ 'antiquewhite' => 'faebd7',
57
+ 'aqua' => '00ffff',
58
+ 'aquamarine' => '7fffd4',
59
+ 'azure' => 'f0ffff',
60
+ 'beige' => 'f5f5dc',
61
+ 'bisque' => 'ffe4c4',
62
+ 'black' => '000000',
63
+ 'blanchedalmond' => 'ffebcd',
64
+ 'blue' => '0000ff',
65
+ 'blueviolet' => '8a2be2',
66
+ 'brown' => 'a52a2a',
67
+ 'burlywood' => 'deb887',
68
+ 'cadetblue' => '5f9ea0',
69
+ 'chartreuse' => '7fff00',
70
+ 'chocolate' => 'd2691e',
71
+ 'coral' => 'ff7f50',
72
+ 'cornflowerblue' => '6495ed',
73
+ 'cornsilk' => 'fff8dc',
74
+ 'crimson' => 'dc143c',
75
+ 'cyan' => '00ffff',
76
+ 'darkblue' => '00008b',
77
+ 'darkcyan' => '008b8b',
78
+ 'darkgoldenrod' => 'b8860b',
79
+ 'dkgray' => 'a9a9a9',
80
+ 'darkgray' => 'a9a9a9',
81
+ 'darkgrey' => 'a9a9a9',
82
+ 'darkgreen' => '006400',
83
+ 'darkkhaki' => 'bdb76b',
84
+ 'darkmagenta' => '8b008b',
85
+ 'darkolivegreen' => '556b2f',
86
+ 'darkorange' => 'ff8c00',
87
+ 'darkorchid' => '9932cc',
88
+ 'darkred' => '8b0000',
89
+ 'darksalmon' => 'e9967a',
90
+ 'darkseagreen' => '8fbc8f',
91
+ 'darkslateblue' => '483d8b',
92
+ 'darkslategray' => '2f4f4f',
93
+ 'darkslategrey' => '2f4f4f',
94
+ 'darkturquoise' => '00ced1',
95
+ 'darkviolet' => '9400d3',
96
+ 'deeppink' => 'ff1493',
97
+ 'deepskyblue' => '00bfff',
98
+ 'dimgray' => '696969',
99
+ 'dimgrey' => '696969',
100
+ 'dodgerblue' => '1e90ff',
101
+ 'firebrick' => 'b22222',
102
+ 'floralwhite' => 'fffaf0',
103
+ 'forestgreen' => '228b22',
104
+ 'fuchsia' => 'ff00ff',
105
+ 'gainsboro' => 'dcdcdc',
106
+ 'ghostwhite' => 'f8f8ff',
107
+ 'gold' => 'ffd700',
108
+ 'goldenrod' => 'daa520',
109
+ 'gray' => '808080',
110
+ 'grey' => '808080',
111
+ 'green' => '008000',
112
+ 'greenyellow' => 'adff2f',
113
+ 'honeydew' => 'f0fff0',
114
+ 'hotpink' => 'ff69b4',
115
+ 'indianred' => 'cd5c5c',
116
+ 'indigo' => '4b0082',
117
+ 'ivory' => 'fffff0',
118
+ 'khaki' => 'f0e68c',
119
+ 'lavender' => 'e6e6fa',
120
+ 'lavenderblush' => 'fff0f5',
121
+ 'lawngreen' => '7cfc00',
122
+ 'lemonchiffon' => 'fffacd',
123
+ 'lightblue' => 'add8e6',
124
+ 'lightcoral' => 'f08080',
125
+ 'lightcyan' => 'e0ffff',
126
+ 'lightgoldenrodyellow' => 'fafad2',
127
+ 'ltgray' => 'd3d3d3',
128
+ 'lightgray' => 'd3d3d3',
129
+ 'lightgrey' => 'd3d3d3',
130
+ 'lightgreen' => '90ee90',
131
+ 'lightpink' => 'ffb6c1',
132
+ 'lightsalmon' => 'ffa07a',
133
+ 'lightseagreen' => '20b2aa',
134
+ 'lightskyblue' => '87cefa',
135
+ 'lightslategray' => '778899',
136
+ 'lightslategrey' => '778899',
137
+ 'lightsteelblue' => 'b0c4de',
138
+ 'lightyellow' => 'ffffe0',
139
+ 'lime' => '00ff00',
140
+ 'limegreen' => '32cd32',
141
+ 'linen' => 'faf0e6',
142
+ 'magenta' => 'ff00ff',
143
+ 'maroon' => '800000',
144
+ 'mediumaquamarine' => '66cdaa',
145
+ 'mediumblue' => '0000cd',
146
+ 'mediumorchid' => 'ba55d3',
147
+ 'mediumpurple' => '9370d8',
148
+ 'mediumseagreen' => '3cb371',
149
+ 'mediumslateblue' => '7b68ee',
150
+ 'mediumspringgreen' => '00fa9a',
151
+ 'mediumturquoise' => '48d1cc',
152
+ 'mediumvioletred' => 'c71585',
153
+ 'midnightblue' => '191970',
154
+ 'mintcream' => 'f5fffa',
155
+ 'mistyrose' => 'ffe4e1',
156
+ 'moccasin' => 'ffe4b5',
157
+ 'navajowhite' => 'ffdead',
158
+ 'navy' => '000080',
159
+ 'oldlace' => 'fdf5e6',
160
+ 'olive' => '808000',
161
+ 'olivedrab' => '6b8e23',
162
+ 'orange' => 'ffa500',
163
+ 'orangered' => 'ff4500',
164
+ 'orchid' => 'da70d6',
165
+ 'palegoldenrod' => 'eee8aa',
166
+ 'palegreen' => '98fb98',
167
+ 'paleturquoise' => 'afeeee',
168
+ 'palevioletred' => 'd87093',
169
+ 'papayawhip' => 'ffefd5',
170
+ 'peachpuff' => 'ffdab9',
171
+ 'peru' => 'cd853f',
172
+ 'pink' => 'ffc0cb',
173
+ 'plum' => 'dda0dd',
174
+ 'powderblue' => 'b0e0e6',
175
+ 'purple' => '800080',
176
+ 'red' => 'ff0000',
177
+ 'rosybrown' => 'bc8f8f',
178
+ 'royalblue' => '4169e1',
179
+ 'saddlebrown' => '8b4513',
180
+ 'salmon' => 'fa8072',
181
+ 'sandybrown' => 'f4a460',
182
+ 'seagreen' => '2e8b57',
183
+ 'seashell' => 'fff5ee',
184
+ 'sienna' => 'a0522d',
185
+ 'silver' => 'c0c0c0',
186
+ 'skyblue' => '87ceeb',
187
+ 'slateblue' => '6a5acd',
188
+ 'slategray' => '708090',
189
+ 'slategrey' => '708090',
190
+ 'snow' => 'fffafa',
191
+ 'springgreen' => '00ff7f',
192
+ 'steelblue' => '4682b4',
193
+ 'tan' => 'd2b48c',
194
+ 'teal' => '008080',
195
+ 'thistle' => 'd8bfd8',
196
+ 'tomato' => 'ff6347',
197
+ 'turquoise' => '40e0d0',
198
+ 'violet' => 'ee82ee',
199
+ 'wheat' => 'f5deb3',
200
+ 'white' => 'ffffff',
201
+ 'whitesmoke' => 'f5f5f5',
202
+ 'yellow' => 'ffff00',
203
+ 'yellowgreen' => '9acd32'
204
+ ); // end of web colors
205
+
206
+ /**
207
+ * Array of valid JavaScript color names
208
+ * @public static
209
+ */
210
+ public static $jscolor = array ('transparent', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dkGray', 'gray', 'ltGray');
211
+
212
+ /**
213
+ * Array of Spot colors (C,M,Y,K,name)
214
+ * Color keys must be in lowercase and without spaces.
215
+ * As long as no open standard for spot colours exists, you have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly.
216
+ * Common industry standard spot colors are: ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH.
217
+ * @public static
218
+ */
219
+ public static $spotcolor = array (
220
+ // special registration colors
221
+ 'none' => array( 0, 0, 0, 0, 'None'),
222
+ 'all' => array(100, 100, 100, 100, 'All'),
223
+ // standard CMYK colors
224
+ 'cyan' => array(100, 0, 0, 0, 'Cyan'),
225
+ 'magenta' => array( 0, 100, 0, 0, 'Magenta'),
226
+ 'yellow' => array( 0, 0, 100, 0, 'Yellow'),
227
+ 'key' => array( 0, 0, 0, 100, 'Key'),
228
+ // alias
229
+ 'white' => array( 0, 0, 0, 0, 'White'),
230
+ 'black' => array( 0, 0, 0, 100, 'Black'),
231
+ // standard RGB colors
232
+ 'red' => array( 0, 100, 100, 0, 'Red'),
233
+ 'green' => array(100, 0, 100, 0, 'Green'),
234
+ 'blue' => array(100, 100, 0, 0, 'Blue'),
235
+ // Add here standard spot colors or dynamically define them with AddSpotColor()
236
+ // ...
237
+ ); // end of spot colors
238
+
239
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
240
+
241
+ /**
242
+ * Return the Spot color array.
243
+ * @param $name (string) Name of the spot color.
244
+ * @param $spotc (array) Reference to an array of spot colors.
245
+ * @return (array) Spot color array or false if not defined.
246
+ * @since 5.9.125 (2011-10-03)
247
+ * @public static
248
+ */
249
+ public static function getSpotColor($name, &$spotc) {
250
+ if (isset($spotc[$name])) {
251
+ return $spotc[$name];
252
+ }
253
+ $color = preg_replace('/[\s]*/', '', $name); // remove extra spaces
254
+ $color = strtolower($color);
255
+ if (isset(self::$spotcolor[$color])) {
256
+ if (!isset($spotc[$name])) {
257
+ $i = (1 + count($spotc));
258
+ $spotc[$name] = array('C' => self::$spotcolor[$color][0], 'M' => self::$spotcolor[$color][1], 'Y' => self::$spotcolor[$color][2], 'K' => self::$spotcolor[$color][3], 'name' => self::$spotcolor[$color][4], 'i' => $i);
259
+ }
260
+ return $spotc[self::$spotcolor[$color][4]];
261
+ }
262
+ return false;
263
+ }
264
+
265
+ /**
266
+ * Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name.
267
+ * @param $hcolor (string) HTML color.
268
+ * @param $spotc (array) Reference to an array of spot colors.
269
+ * @param $defcol (array) Color to return in case of error.
270
+ * @return array RGB or CMYK color, or false in case of error.
271
+ * @public static
272
+ */
273
+ public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'=>128,'G'=>128,'B'=>128)) {
274
+ $color = preg_replace('/[\s]*/', '', $hcolor); // remove extra spaces
275
+ $color = strtolower($color);
276
+ // check for javascript color array syntax
277
+ if (strpos($color, '[') !== false) {
278
+ if (preg_match('/[\[][\"\'](t|g|rgb|cmyk)[\"\'][\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\]]/', $color, $m) > 0) {
279
+ $returncolor = array();
280
+ switch ($m[1]) {
281
+ case 'cmyk': {
282
+ // RGB
283
+ $returncolor['C'] = max(0, min(100, (floatval($m[2]) * 100)));
284
+ $returncolor['M'] = max(0, min(100, (floatval($m[3]) * 100)));
285
+ $returncolor['Y'] = max(0, min(100, (floatval($m[4]) * 100)));
286
+ $returncolor['K'] = max(0, min(100, (floatval($m[5]) * 100)));
287
+ break;
288
+ }
289
+ case 'rgb': {
290
+ // RGB
291
+ $returncolor['R'] = max(0, min(255, (floatval($m[2]) * 255)));
292
+ $returncolor['G'] = max(0, min(255, (floatval($m[3]) * 255)));
293
+ $returncolor['B'] = max(0, min(255, (floatval($m[4]) * 255)));
294
+ break;
295
+ }
296
+ case 'g': {
297
+ // grayscale
298
+ $returncolor['G'] = max(0, min(255, (floatval($m[2]) * 255)));
299
+ break;
300
+ }
301
+ case 't':
302
+ default: {
303
+ // transparent (empty array)
304
+ break;
305
+ }
306
+ }
307
+ return $returncolor;
308
+ }
309
+ } elseif ((substr($color, 0, 4) != 'cmyk') AND (substr($color, 0, 3) != 'rgb') AND (($dotpos = strpos($color, '.')) !== false)) {
310
+ // remove class parent (i.e.: color.red)
311
+ $color = substr($color, ($dotpos + 1));
312
+ if ($color == 'transparent') {
313
+ // transparent (empty array)
314
+ return array();
315
+ }
316
+ }
317
+ if (strlen($color) == 0) {
318
+ return $defcol;
319
+ }
320
+ // RGB ARRAY
321
+ if (substr($color, 0, 3) == 'rgb') {
322
+ $codes = substr($color, 4);
323
+ $codes = str_replace(')', '', $codes);
324
+ $returncolor = explode(',', $codes);
325
+ foreach ($returncolor as $key => $val) {
326
+ if (strpos($val, '%') > 0) {
327
+ // percentage
328
+ $returncolor[$key] = (255 * intval($val) / 100);
329
+ } else {
330
+ $returncolor[$key] = intval($val);
331
+ }
332
+ // normalize value
333
+ $returncolor[$key] = max(0, min(255, $returncolor[$key]));
334
+ }
335
+ return $returncolor;
336
+ }
337
+ // CMYK ARRAY
338
+ if (substr($color, 0, 4) == 'cmyk') {
339
+ $codes = substr($color, 5);
340
+ $codes = str_replace(')', '', $codes);
341
+ $returncolor = explode(',', $codes);
342
+ foreach ($returncolor as $key => $val) {
343
+ if (strpos($val, '%') !== false) {
344
+ // percentage
345
+ $returncolor[$key] = (100 * intval($val) / 100);
346
+ } else {
347
+ $returncolor[$key] = intval($val);
348
+ }
349
+ // normalize value
350
+ $returncolor[$key] = max(0, min(100, $returncolor[$key]));
351
+ }
352
+ return $returncolor;
353
+ }
354
+ if ($color[0] != '#') {
355
+ // COLOR NAME
356
+ if (isset(self::$webcolor[$color])) {
357
+ // web color
358
+ $color_code = self::$webcolor[$color];
359
+ } else {
360
+ // spot color
361
+ $returncolor = self::getSpotColor($color, $spotc);
362
+ if ($returncolor === false) {
363
+ $returncolor = $defcol;
364
+ }
365
+ return $returncolor;
366
+ }
367
+ } else {
368
+ $color_code = substr($color, 1);
369
+ }
370
+ // HEXADECIMAL REPRESENTATION
371
+ switch (strlen($color_code)) {
372
+ case 3: {
373
+ // 3-digit RGB hexadecimal representation
374
+ $r = substr($color_code, 0, 1);
375
+ $g = substr($color_code, 1, 1);
376
+ $b = substr($color_code, 2, 1);
377
+ $returncolor = array();
378
+ $returncolor['R'] = max(0, min(255, hexdec($r.$r)));
379
+ $returncolor['G'] = max(0, min(255, hexdec($g.$g)));
380
+ $returncolor['B'] = max(0, min(255, hexdec($b.$b)));
381
+ break;
382
+ }
383
+ case 6: {
384
+ // 6-digit RGB hexadecimal representation
385
+ $returncolor = array();
386
+ $returncolor['R'] = max(0, min(255, hexdec(substr($color_code, 0, 2))));
387
+ $returncolor['G'] = max(0, min(255, hexdec(substr($color_code, 2, 2))));
388
+ $returncolor['B'] = max(0, min(255, hexdec(substr($color_code, 4, 2))));
389
+ break;
390
+ }
391
+ case 8: {
392
+ // 8-digit CMYK hexadecimal representation
393
+ $returncolor = array();
394
+ $returncolor['C'] = max(0, min(100, round(hexdec(substr($color_code, 0, 2)) / 2.55)));
395
+ $returncolor['M'] = max(0, min(100, round(hexdec(substr($color_code, 2, 2)) / 2.55)));
396
+ $returncolor['Y'] = max(0, min(100, round(hexdec(substr($color_code, 4, 2)) / 2.55)));
397
+ $returncolor['K'] = max(0, min(100, round(hexdec(substr($color_code, 6, 2)) / 2.55)));
398
+ break;
399
+ }
400
+ default: {
401
+ $returncolor = $defcol;
402
+ break;
403
+ }
404
+ }
405
+ return $returncolor;
406
+ }
407
+
408
+ /**
409
+ * Convert a color array into a string representation.
410
+ * @param $c (array) Array of colors.
411
+ * @return (string) The color array representation.
412
+ * @since 5.9.137 (2011-12-01)
413
+ * @public static
414
+ */
415
+ public static function getColorStringFromArray($c) {
416
+ $c = array_values($c);
417
+ $color = '[';
418
+ switch (count($c)) {
419
+ case 4: {
420
+ // CMYK
421
+ $color .= sprintf('%F %F %F %F', (max(0, min(100, floatval($c[0]))) / 100), (max(0, min(100, floatval($c[1]))) / 100), (max(0, min(100, floatval($c[2]))) / 100), (max(0, min(100, floatval($c[3]))) / 100));
422
+ break;
423
+ }
424
+ case 3: {
425
+ // RGB
426
+ $color .= sprintf('%F %F %F', (max(0, min(255, floatval($c[0]))) / 255), (max(0, min(255, floatval($c[1]))) / 255), (max(0, min(255, floatval($c[2]))) / 255));
427
+ break;
428
+ }
429
+ case 1: {
430
+ // grayscale
431
+ $color .= sprintf('%F', (max(0, min(255, floatval($c[0]))) / 255));
432
+ break;
433
+ }
434
+ }
435
+ $color .= ']';
436
+ return $color;
437
+ }
438
+
439
+ /**
440
+ * Convert color to javascript color.
441
+ * @param $color (string) color name or "#RRGGBB"
442
+ * @protected
443
+ * @since 2.1.002 (2008-02-12)
444
+ * @public static
445
+ */
446
+ public static function _JScolor($color) {
447
+ if (substr($color, 0, 1) == '#') {
448
+ return sprintf("['RGB',%F,%F,%F]", (hexdec(substr($color, 1, 2)) / 255), (hexdec(substr($color, 3, 2)) / 255), (hexdec(substr($color, 5, 2)) / 255));
449
+ }
450
+ if (!in_array($color, self::$jscolor)) {
451
+ // default transparent color
452
+ $color = $jscolor[0];
453
+ }
454
+ return 'color.'.$color;
455
+ }
456
+
457
+
458
+ } // END OF TCPDF_COLORS CLASS
459
+
460
+ //============================================================+
461
+ // END OF FILE
462
+ //============================================================+
includes/lib/{tcpdf_min → tcpdf}/include/tcpdf_filters.php RENAMED
@@ -1,481 +1,481 @@
1
- <?php
2
- //============================================================+
3
- // File name : tcpdf_filters.php
4
- // Version : 1.0.001
5
- // Begin : 2011-05-23
6
- // Last Update : 2014-04-25
7
- // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
- // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
- // -------------------------------------------------------------------
10
- // Copyright (C) 2011-2013 Nicola Asuni - Tecnick.com LTD
11
- //
12
- // This file is part of TCPDF software library.
13
- //
14
- // TCPDF is free software: you can redistribute it and/or modify it
15
- // under the terms of the GNU Lesser General Public License as
16
- // published by the Free Software Foundation, either version 3 of the
17
- // License, or (at your option) any later version.
18
- //
19
- // TCPDF is distributed in the hope that it will be useful, but
20
- // WITHOUT ANY WARRANTY; without even the implied warranty of
21
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
- // See the GNU Lesser General Public License for more details.
23
- //
24
- // You should have received a copy of the License
25
- // along with TCPDF. If not, see
26
- // <http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT>.
27
- //
28
- // See LICENSE.TXT file for more information.
29
- // -------------------------------------------------------------------
30
- //
31
- // Description : This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).
32
- //
33
- //============================================================+
34
-
35
- /**
36
- * @file
37
- * This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).<br>
38
- * @package com.tecnick.tcpdf
39
- * @author Nicola Asuni
40
- * @version 1.0.001
41
- */
42
-
43
- /**
44
- * @class TCPDF_FILTERS
45
- * This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).<br>
46
- * @package com.tecnick.tcpdf
47
- * @brief This is a PHP class for decoding common PDF filters.
48
- * @version 1.0.001
49
- * @author Nicola Asuni - info@tecnick.com
50
- */
51
- class TCPDF_FILTERS {
52
-
53
- /**
54
- * Define a list of available filter decoders.
55
- * @private static
56
- */
57
- private static $available_filters = array('ASCIIHexDecode', 'ASCII85Decode', 'LZWDecode', 'FlateDecode', 'RunLengthDecode');
58
-
59
- // -----------------------------------------------------------------------------
60
-
61
- /**
62
- * Get a list of available decoding filters.
63
- * @return (array) Array of available filter decoders.
64
- * @since 1.0.000 (2011-05-23)
65
- * @public static
66
- */
67
- public static function getAvailableFilters() {
68
- return self::$available_filters;
69
- }
70
-
71
- /**
72
- * Decode data using the specified filter type.
73
- * @param $filter (string) Filter name.
74
- * @param $data (string) Data to decode.
75
- * @return Decoded data string.
76
- * @since 1.0.000 (2011-05-23)
77
- * @public static
78
- */
79
- public static function decodeFilter($filter, $data) {
80
- switch ($filter) {
81
- case 'ASCIIHexDecode': {
82
- return self::decodeFilterASCIIHexDecode($data);
83
- break;
84
- }
85
- case 'ASCII85Decode': {
86
- return self::decodeFilterASCII85Decode($data);
87
- break;
88
- }
89
- case 'LZWDecode': {
90
- return self::decodeFilterLZWDecode($data);
91
- break;
92
- }
93
- case 'FlateDecode': {
94
- return self::decodeFilterFlateDecode($data);
95
- break;
96
- }
97
- case 'RunLengthDecode': {
98
- return self::decodeFilterRunLengthDecode($data);
99
- break;
100
- }
101
- case 'CCITTFaxDecode': {
102
- return self::decodeFilterCCITTFaxDecode($data);
103
- break;
104
- }
105
- case 'JBIG2Decode': {
106
- return self::decodeFilterJBIG2Decode($data);
107
- break;
108
- }
109
- case 'DCTDecode': {
110
- return self::decodeFilterDCTDecode($data);
111
- break;
112
- }
113
- case 'JPXDecode': {
114
- return self::decodeFilterJPXDecode($data);
115
- break;
116
- }
117
- case 'Crypt': {
118
- return self::decodeFilterCrypt($data);
119
- break;
120
- }
121
- default: {
122
- return self::decodeFilterStandard($data);
123
- break;
124
- }
125
- }
126
- }
127
-
128
- // --- FILTERS (PDF 32000-2008 - 7.4 Filters) ------------------------------
129
-
130
- /**
131
- * Standard
132
- * Default decoding filter (leaves data unchanged).
133
- * @param $data (string) Data to decode.
134
- * @return Decoded data string.
135
- * @since 1.0.000 (2011-05-23)
136
- * @public static
137
- */
138
- public static function decodeFilterStandard($data) {
139
- return $data;
140
- }
141
-
142
- /**
143
- * ASCIIHexDecode
144
- * Decodes data encoded in an ASCII hexadecimal representation, reproducing the original binary data.
145
- * @param $data (string) Data to decode.
146
- * @return Decoded data string.
147
- * @since 1.0.000 (2011-05-23)
148
- * @public static
149
- */
150
- public static function decodeFilterASCIIHexDecode($data) {
151
- // intialize string to return
152
- $decoded = '';
153
- // all white-space characters shall be ignored
154
- $data = preg_replace('/[\s]/', '', $data);
155
- // check for EOD character: GREATER-THAN SIGN (3Eh)
156
- $eod = strpos($data, '>');
157
- if ($eod !== false) {
158
- // remove EOD and extra data (if any)
159
- $data = substr($data, 0, $eod);
160
- $eod = true;
161
- }
162
- // get data length
163
- $data_length = strlen($data);
164
- if (($data_length % 2) != 0) {
165
- // odd number of hexadecimal digits
166
- if ($eod) {
167
- // EOD shall behave as if a 0 (zero) followed the last digit
168
- $data = substr($data, 0, -1).'0'.substr($data, -1);
169
- } else {
170
- self::Error('decodeFilterASCIIHexDecode: invalid code');
171
- }
172
- }
173
- // check for invalid characters
174
- if (preg_match('/[^a-fA-F\d]/', $data) > 0) {
175
- self::Error('decodeFilterASCIIHexDecode: invalid code');
176
- }
177
- // get one byte of binary data for each pair of ASCII hexadecimal digits
178
- $decoded = pack('H*', $data);
179
- return $decoded;
180
- }
181
-
182
- /**
183
- * ASCII85Decode
184
- * Decodes data encoded in an ASCII base-85 representation, reproducing the original binary data.
185
- * @param $data (string) Data to decode.
186
- * @return Decoded data string.
187
- * @since 1.0.000 (2011-05-23)
188
- * @public static
189
- */
190
- public static function decodeFilterASCII85Decode($data) {
191
- // intialize string to return
192
- $decoded = '';
193
- // all white-space characters shall be ignored
194
- $data = preg_replace('/[\s]/', '', $data);
195
- // remove start sequence 2-character sequence <~ (3Ch)(7Eh)
196
- if (strpos($data, '<~') !== false) {
197
- // remove EOD and extra data (if any)
198
- $data = substr($data, 2);
199
- }
200
- // check for EOD: 2-character sequence ~> (7Eh)(3Eh)
201
- $eod = strpos($data, '~>');
202
- if ($eod !== false) {
203
- // remove EOD and extra data (if any)
204
- $data = substr($data, 0, $eod);
205
- }
206
- // data length
207
- $data_length = strlen($data);
208
- // check for invalid characters
209
- if (preg_match('/[^\x21-\x75,\x74]/', $data) > 0) {
210
- self::Error('decodeFilterASCII85Decode: invalid code');
211
- }
212
- // z sequence
213
- $zseq = chr(0).chr(0).chr(0).chr(0);
214
- // position inside a group of 4 bytes (0-3)
215
- $group_pos = 0;
216
- $tuple = 0;
217
- $pow85 = array((85*85*85*85), (85*85*85), (85*85), 85, 1);
218
- $last_pos = ($data_length - 1);
219
- // for each byte
220
- for ($i = 0; $i < $data_length; ++$i) {
221
- // get char value
222
- $char = ord($data[$i]);
223
- if ($char == 122) { // 'z'
224
- if ($group_pos == 0) {
225
- $decoded .= $zseq;
226
- } else {
227
- self::Error('decodeFilterASCII85Decode: invalid code');
228
- }
229
- } else {
230
- // the value represented by a group of 5 characters should never be greater than 2^32 - 1
231
- $tuple += (($char - 33) * $pow85[$group_pos]);
232
- if ($group_pos == 4) {
233
- $decoded .= chr($tuple >> 24).chr($tuple >> 16).chr($tuple >> 8).chr($tuple);
234
- $tuple = 0;
235
- $group_pos = 0;
236
- } else {
237
- ++$group_pos;
238
- }
239
- }
240
- }
241
- if ($group_pos > 1) {
242
- $tuple += $pow85[($group_pos - 1)];
243
- }
244
- // last tuple (if any)
245
- switch ($group_pos) {
246
- case 4: {
247
- $decoded .= chr($tuple >> 24).chr($tuple >> 16).chr($tuple >> 8);
248
- break;
249
- }
250
- case 3: {
251
- $decoded .= chr($tuple >> 24).chr($tuple >> 16);
252
- break;
253
- }
254
- case 2: {
255
- $decoded .= chr($tuple >> 24);
256
- break;
257
- }
258
- case 1: {
259
- self::Error('decodeFilterASCII85Decode: invalid code');
260
- break;
261
- }
262
- }
263
- return $decoded;
264
- }
265
-
266
- /**
267
- * LZWDecode
268
- * Decompresses data encoded using the LZW (Lempel-Ziv-Welch) adaptive compression method, reproducing the original text or binary data.
269
- * @param $data (string) Data to decode.
270
- * @return Decoded data string.
271
- * @since 1.0.000 (2011-05-23)
272
- * @public static
273
- */
274
- public static function decodeFilterLZWDecode($data) {
275
- // intialize string to return
276
- $decoded = '';
277
- // data length
278
- $data_length = strlen($data);
279
- // convert string to binary string
280
- $bitstring = '';
281
- for ($i = 0; $i < $data_length; ++$i) {
282
- $bitstring .= sprintf('%08b', ord($data{$i}));
283
- }
284
- // get the number of bits
285
- $data_length = strlen($bitstring);
286
- // initialize code length in bits
287
- $bitlen = 9;
288
- // initialize dictionary index
289
- $dix = 258;
290
- // initialize the dictionary (with the first 256 entries).
291
- $dictionary = array();
292
- for ($i = 0; $i < 256; ++$i) {
293
- $dictionary[$i] = chr($i);
294
- }
295
- // previous val
296
- $prev_index = 0;
297
- // while we encounter EOD marker (257), read code_length bits
298
- while (($data_length > 0) AND (($index = bindec(substr($bitstring, 0, $bitlen))) != 257)) {
299
- // remove read bits from string
300
- $bitstring = substr($bitstring, $bitlen);
301
- // update number of bits
302
- $data_length -= $bitlen;
303
- if ($index == 256) { // clear-table marker
304
- // reset code length in bits
305
- $bitlen = 9;
306
- // reset dictionary index
307
- $dix = 258;
308
- $prev_index = 256;
309
- // reset the dictionary (with the first 256 entries).
310
- $dictionary = array();
311
- for ($i = 0; $i < 256; ++$i) {
312
- $dictionary[$i] = chr($i);
313
- }
314
- } elseif ($prev_index == 256) {
315
- // first entry
316
- $decoded .= $dictionary[$index];
317
- $prev_index = $index;
318
- } else {
319
- // check if index exist in the dictionary
320
- if ($index < $dix) {
321
- // index exist on dictionary
322
- $decoded .= $dictionary[$index];
323
- $dic_val = $dictionary[$prev_index].$dictionary[$index][0];
324
- // store current index
325
- $prev_index = $index;
326
- } else {
327
- // index do not exist on dictionary
328
- $dic_val = $dictionary[$prev_index].$dictionary[$prev_index][0];
329
- $decoded .= $dic_val;
330
- }
331
- // update dictionary
332
- $dictionary[$dix] = $dic_val;
333
- ++$dix;
334
- // change bit length by case
335
- if ($dix == 2047) {
336
- $bitlen = 12;
337
- } elseif ($dix == 1023) {
338
- $bitlen = 11;
339
- } elseif ($dix == 511) {
340
- $bitlen = 10;
341
- }
342
- }
343
- }
344
- return $decoded;
345
- }
346
-
347
- /**
348
- * FlateDecode
349
- * Decompresses data encoded using the zlib/deflate compression method, reproducing the original text or binary data.
350
- * @param $data (string) Data to decode.
351
- * @return Decoded data string.
352
- * @since 1.0.000 (2011-05-23)
353
- * @public static
354
- */
355
- public static function decodeFilterFlateDecode($data) {
356
- // intialize string to return
357
- $decoded = @gzuncompress($data);
358
- if ($decoded === false) {
359
- self::Error('decodeFilterFlateDecode: invalid code');
360
- }
361
- return $decoded;
362
- }
363
-
364
- /**
365
- * RunLengthDecode
366
- * Decompresses data encoded using a byte-oriented run-length encoding algorithm.
367
- * @param $data (string) Data to decode.
368
- * @since 1.0.000 (2011-05-23)
369
- * @public static
370
- */
371
- public static function decodeFilterRunLengthDecode($data) {
372
- // intialize string to return
373
- $decoded = '';
374
- // data length
375
- $data_length = strlen($data);
376
- $i = 0;
377
- while($i < $data_length) {
378
- // get current byte value
379
- $byte = ord($data{$i});
380
- if ($byte == 128) {
381
- // a length value of 128 denote EOD
382
- break;
383
- } elseif ($byte < 128) {
384
- // if the length byte is in the range 0 to 127
385
- // the following length + 1 (1 to 128) bytes shall be copied literally during decompression
386
- $decoded .= substr($data, ($i + 1), ($byte + 1));
387
- // move to next block
388
- $i += ($byte + 2);
389
- } else {
390
- // if length is in the range 129 to 255,
391
- // the following single byte shall be copied 257 - length (2 to 128) times during decompression
392
- $decoded .= str_repeat($data{($i + 1)}, (257 - $byte));
393
- // move to next block
394
- $i += 2;
395
- }
396
- }
397
- return $decoded;
398
- }
399
-
400
- /**
401
- * CCITTFaxDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
402
- * Decompresses data encoded using the CCITT facsimile standard, reproducing the original data (typically monochrome image data at 1 bit per pixel).
403
- * @param $data (string) Data to decode.
404
- * @return Decoded data string.
405
- * @since 1.0.000 (2011-05-23)
406
- * @public static
407
- */
408
- public static function decodeFilterCCITTFaxDecode($data) {
409
- self::Error('~decodeFilterCCITTFaxDecode: this method has not been yet implemented');
410
- //return $data;
411
- }
412
-
413
- /**
414
- * JBIG2Decode (NOT IMPLEMETED - RETURN AN EXCEPTION)
415
- * Decompresses data encoded using the JBIG2 standard, reproducing the original monochrome (1 bit per pixel) image data (or an approximation of that data).
416
- * @param $data (string) Data to decode.
417
- * @return Decoded data string.
418
- * @since 1.0.000 (2011-05-23)
419
- * @public static
420
- */
421
- public static function decodeFilterJBIG2Decode($data) {
422
- self::Error('~decodeFilterJBIG2Decode: this method has not been yet implemented');
423
- //return $data;
424
- }
425
-
426
- /**
427
- * DCTDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
428
- * Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard, reproducing image sample data that approximates the original data.
429
- * @param $data (string) Data to decode.
430
- * @return Decoded data string.
431
- * @since 1.0.000 (2011-05-23)
432
- * @public static
433
- */
434
- public static function decodeFilterDCTDecode($data) {
435
- self::Error('~decodeFilterDCTDecode: this method has not been yet implemented');
436
- //return $data;
437
- }
438
-
439
- /**
440
- * JPXDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
441
- * Decompresses data encoded using the wavelet-based JPEG2000 standard, reproducing the original image data.
442
- * @param $data (string) Data to decode.
443
- * @return Decoded data string.
444
- * @since 1.0.000 (2011-05-23)
445
- * @public static
446
- */
447
- public static function decodeFilterJPXDecode($data) {
448
- self::Error('~decodeFilterJPXDecode: this method has not been yet implemented');
449
- //return $data;
450
- }
451
-
452
- /**
453
- * Crypt (NOT IMPLEMETED - RETURN AN EXCEPTION)
454
- * Decrypts data encrypted by a security handler, reproducing the data as it was before encryption.
455
- * @param $data (string) Data to decode.
456
- * @return Decoded data string.
457
- * @since 1.0.000 (2011-05-23)
458
- * @public static
459
- */
460
- public static function decodeFilterCrypt($data) {
461
- self::Error('~decodeFilterCrypt: this method has not been yet implemented');
462
- //return $data;
463
- }
464
-
465
- // --- END FILTERS SECTION -------------------------------------------------
466
-
467
- /**
468
- * Throw an exception.
469
- * @param $msg (string) The error message
470
- * @since 1.0.000 (2011-05-23)
471
- * @public static
472
- */
473
- public static function Error($msg) {
474
- throw new Exception('TCPDF_PARSER ERROR: '.$msg);
475
- }
476
-
477
- } // END OF TCPDF_FILTERS CLASS
478
-
479
- //============================================================+
480
- // END OF FILE
481
- //============================================================+
1
+ <?php
2
+ //============================================================+
3
+ // File name : tcpdf_filters.php
4
+ // Version : 1.0.001
5
+ // Begin : 2011-05-23
6
+ // Last Update : 2014-04-25
7
+ // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
+ // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
+ // -------------------------------------------------------------------
10
+ // Copyright (C) 2011-2013 Nicola Asuni - Tecnick.com LTD
11
+ //
12
+ // This file is part of TCPDF software library.
13
+ //
14
+ // TCPDF is free software: you can redistribute it and/or modify it
15
+ // under the terms of the GNU Lesser General Public License as
16
+ // published by the Free Software Foundation, either version 3 of the
17
+ // License, or (at your option) any later version.
18
+ //
19
+ // TCPDF is distributed in the hope that it will be useful, but
20
+ // WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
+ // See the GNU Lesser General Public License for more details.
23
+ //
24
+ // You should have received a copy of the License
25
+ // along with TCPDF. If not, see
26
+ // <http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT>.
27
+ //
28
+ // See LICENSE.TXT file for more information.
29
+ // -------------------------------------------------------------------
30
+ //
31
+ // Description : This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).
32
+ //
33
+ //============================================================+
34
+
35
+ /**
36
+ * @file
37
+ * This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).<br>
38
+ * @package com.tecnick.tcpdf
39
+ * @author Nicola Asuni
40
+ * @version 1.0.001
41
+ */
42
+
43
+ /**
44
+ * @class TCPDF_FILTERS
45
+ * This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).<br>
46
+ * @package com.tecnick.tcpdf
47
+ * @brief This is a PHP class for decoding common PDF filters.
48
+ * @version 1.0.001
49
+ * @author Nicola Asuni - info@tecnick.com
50
+ */
51
+ class TCPDF_FILTERS {
52
+
53
+ /**
54
+ * Define a list of available filter decoders.
55
+ * @private static
56
+ */
57
+ private static $available_filters = array('ASCIIHexDecode', 'ASCII85Decode', 'LZWDecode', 'FlateDecode', 'RunLengthDecode');
58
+
59
+ // -----------------------------------------------------------------------------
60
+
61
+ /**
62
+ * Get a list of available decoding filters.
63
+ * @return (array) Array of available filter decoders.
64
+ * @since 1.0.000 (2011-05-23)
65
+ * @public static
66
+ */
67
+ public static function getAvailableFilters() {
68
+ return self::$available_filters;
69
+ }
70
+
71
+ /**
72
+ * Decode data using the specified filter type.
73
+ * @param $filter (string) Filter name.
74
+ * @param $data (string) Data to decode.
75
+ * @return Decoded data string.
76
+ * @since 1.0.000 (2011-05-23)
77
+ * @public static
78
+ */
79
+ public static function decodeFilter($filter, $data) {
80
+ switch ($filter) {
81
+ case 'ASCIIHexDecode': {
82
+ return self::decodeFilterASCIIHexDecode($data);
83
+ break;
84
+ }
85
+ case 'ASCII85Decode': {
86
+ return self::decodeFilterASCII85Decode($data);
87
+ break;
88
+ }
89
+ case 'LZWDecode': {
90
+ return self::decodeFilterLZWDecode($data);
91
+ break;
92
+ }
93
+ case 'FlateDecode': {
94
+ return self::decodeFilterFlateDecode($data);
95
+ break;
96
+ }
97
+ case 'RunLengthDecode': {
98
+ return self::decodeFilterRunLengthDecode($data);
99
+ break;
100
+ }
101
+ case 'CCITTFaxDecode': {
102
+ return self::decodeFilterCCITTFaxDecode($data);
103
+ break;
104
+ }
105
+ case 'JBIG2Decode': {
106
+ return self::decodeFilterJBIG2Decode($data);
107
+ break;
108
+ }
109
+ case 'DCTDecode': {
110
+ return self::decodeFilterDCTDecode($data);
111
+ break;
112
+ }
113
+ case 'JPXDecode': {
114
+ return self::decodeFilterJPXDecode($data);
115
+ break;
116
+ }
117
+ case 'Crypt': {
118
+ return self::decodeFilterCrypt($data);
119
+ break;
120
+ }
121
+ default: {
122
+ return self::decodeFilterStandard($data);
123
+ break;
124
+ }
125
+ }
126
+ }
127
+
128
+ // --- FILTERS (PDF 32000-2008 - 7.4 Filters) ------------------------------
129
+
130
+ /**
131
+ * Standard
132
+ * Default decoding filter (leaves data unchanged).
133
+ * @param $data (string) Data to decode.
134
+ * @return Decoded data string.
135
+ * @since 1.0.000 (2011-05-23)
136
+ * @public static
137
+ */
138
+ public static function decodeFilterStandard($data) {
139
+ return $data;
140
+ }
141
+
142
+ /**
143
+ * ASCIIHexDecode
144
+ * Decodes data encoded in an ASCII hexadecimal representation, reproducing the original binary data.
145
+ * @param $data (string) Data to decode.
146
+ * @return Decoded data string.
147
+ * @since 1.0.000 (2011-05-23)
148
+ * @public static
149
+ */
150
+ public static function decodeFilterASCIIHexDecode($data) {
151
+ // initialize string to return
152
+ $decoded = '';
153
+ // all white-space characters shall be ignored
154
+ $data = preg_replace('/[\s]/', '', $data);
155
+ // check for EOD character: GREATER-THAN SIGN (3Eh)
156
+ $eod = strpos($data, '>');
157
+ if ($eod !== false) {
158
+ // remove EOD and extra data (if any)
159
+ $data = substr($data, 0, $eod);
160
+ $eod = true;
161
+ }
162
+ // get data length
163
+ $data_length = strlen($data);
164
+ if (($data_length % 2) != 0) {
165
+ // odd number of hexadecimal digits
166
+ if ($eod) {
167
+ // EOD shall behave as if a 0 (zero) followed the last digit
168
+ $data = substr($data, 0, -1).'0'.substr($data, -1);
169
+ } else {
170
+ self::Error('decodeFilterASCIIHexDecode: invalid code');
171
+ }
172
+ }
173
+ // check for invalid characters
174
+ if (preg_match('/[^a-fA-F\d]/', $data) > 0) {
175
+ self::Error('decodeFilterASCIIHexDecode: invalid code');
176
+ }
177
+ // get one byte of binary data for each pair of ASCII hexadecimal digits
178
+ $decoded = pack('H*', $data);
179
+ return $decoded;
180
+ }
181
+
182
+ /**
183
+ * ASCII85Decode
184
+ * Decodes data encoded in an ASCII base-85 representation, reproducing the original binary data.
185
+ * @param $data (string) Data to decode.
186
+ * @return Decoded data string.
187
+ * @since 1.0.000 (2011-05-23)
188
+ * @public static
189
+ */
190
+ public static function decodeFilterASCII85Decode($data) {
191
+ // initialize string to return
192
+ $decoded = '';
193
+ // all white-space characters shall be ignored
194
+ $data = preg_replace('/[\s]/', '', $data);
195
+ // remove start sequence 2-character sequence <~ (3Ch)(7Eh)
196
+ if (strpos($data, '<~') !== false) {
197
+ // remove EOD and extra data (if any)
198
+ $data = substr($data, 2);
199
+ }
200
+ // check for EOD: 2-character sequence ~> (7Eh)(3Eh)
201
+ $eod = strpos($data, '~>');
202
+ if ($eod !== false) {
203
+ // remove EOD and extra data (if any)
204
+ $data = substr($data, 0, $eod);
205
+ }
206
+ // data length
207
+ $data_length = strlen($data);
208
+ // check for invalid characters
209
+ if (preg_match('/[^\x21-\x75,\x74]/', $data) > 0) {
210
+ self::Error('decodeFilterASCII85Decode: invalid code');
211
+ }
212
+ // z sequence
213
+ $zseq = chr(0).chr(0).chr(0).chr(0);
214
+ // position inside a group of 4 bytes (0-3)
215
+ $group_pos = 0;
216
+ $tuple = 0;
217
+ $pow85 = array((85*85*85*85), (85*85*85), (85*85), 85, 1);
218
+ $last_pos = ($data_length - 1);
219
+ // for each byte
220
+ for ($i = 0; $i < $data_length; ++$i) {
221
+ // get char value
222
+ $char = ord($data[$i]);
223
+ if ($char == 122) { // 'z'
224
+ if ($group_pos == 0) {
225
+ $decoded .= $zseq;
226
+ } else {
227
+ self::Error('decodeFilterASCII85Decode: invalid code');
228
+ }
229
+ } else {
230
+ // the value represented by a group of 5 characters should never be greater than 2^32 - 1
231
+ $tuple += (($char - 33) * $pow85[$group_pos]);
232
+ if ($group_pos == 4) {
233
+ $decoded .= chr($tuple >> 24).chr($tuple >> 16).chr($tuple >> 8).chr($tuple);
234
+ $tuple = 0;
235
+ $group_pos = 0;
236
+ } else {
237
+ ++$group_pos;
238
+ }
239
+ }
240
+ }
241
+ if ($group_pos > 1) {
242
+ $tuple += $pow85[($group_pos - 1)];
243
+ }
244
+ // last tuple (if any)
245
+ switch ($group_pos) {
246
+ case 4: {
247
+ $decoded .= chr($tuple >> 24).chr($tuple >> 16).chr($tuple >> 8);
248
+ break;
249
+ }
250
+ case 3: {
251
+ $decoded .= chr($tuple >> 24).chr($tuple >> 16);
252
+ break;
253
+ }
254
+ case 2: {
255
+ $decoded .= chr($tuple >> 24);
256
+ break;
257
+ }
258
+ case 1: {
259
+ self::Error('decodeFilterASCII85Decode: invalid code');
260
+ break;
261
+ }
262
+ }
263
+ return $decoded;
264
+ }
265
+
266
+ /**
267
+ * LZWDecode
268
+ * Decompresses data encoded using the LZW (Lempel-Ziv-Welch) adaptive compression method, reproducing the original text or binary data.
269
+ * @param $data (string) Data to decode.
270
+ * @return Decoded data string.
271
+ * @since 1.0.000 (2011-05-23)
272
+ * @public static
273
+ */
274
+ public static function decodeFilterLZWDecode($data) {
275
+ // initialize string to return
276
+ $decoded = '';
277
+ // data length
278
+ $data_length = strlen($data);
279
+ // convert string to binary string
280
+ $bitstring = '';
281
+ for ($i = 0; $i < $data_length; ++$i) {
282
+ $bitstring .= sprintf('%08b', ord($data{$i}));
283
+ }
284
+ // get the number of bits
285
+ $data_length = strlen($bitstring);
286
+ // initialize code length in bits
287
+ $bitlen = 9;
288
+ // initialize dictionary index
289
+ $dix = 258;
290
+ // initialize the dictionary (with the first 256 entries).
291
+ $dictionary = array();
292
+ for ($i = 0; $i < 256; ++$i) {
293
+ $dictionary[$i] = chr($i);
294
+ }
295
+ // previous val
296
+ $prev_index = 0;
297
+ // while we encounter EOD marker (257), read code_length bits
298
+ while (($data_length > 0) AND (($index = bindec(substr($bitstring, 0, $bitlen))) != 257)) {
299
+ // remove read bits from string
300
+ $bitstring = substr($bitstring, $bitlen);
301
+ // update number of bits
302
+ $data_length -= $bitlen;
303
+ if ($index == 256) { // clear-table marker
304
+ // reset code length in bits
305
+ $bitlen = 9;
306
+ // reset dictionary index
307
+ $dix = 258;
308
+ $prev_index = 256;
309
+ // reset the dictionary (with the first 256 entries).
310
+ $dictionary = array();
311
+ for ($i = 0; $i < 256; ++$i) {
312
+ $dictionary[$i] = chr($i);
313
+ }
314
+ } elseif ($prev_index == 256) {
315
+ // first entry
316
+ $decoded .= $dictionary[$index];
317
+ $prev_index = $index;
318
+ } else {
319
+ // check if index exist in the dictionary
320
+ if ($index < $dix) {
321
+ // index exist on dictionary
322
+ $decoded .= $dictionary[$index];
323
+ $dic_val = $dictionary[$prev_index].$dictionary[$index][0];
324
+ // store current index
325
+ $prev_index = $index;
326
+ } else {
327
+ // index do not exist on dictionary
328
+ $dic_val = $dictionary[$prev_index].$dictionary[$prev_index][0];
329
+ $decoded .= $dic_val;
330
+ }
331
+ // update dictionary
332
+ $dictionary[$dix] = $dic_val;
333
+ ++$dix;
334
+ // change bit length by case
335
+ if ($dix == 2047) {
336
+ $bitlen = 12;
337
+ } elseif ($dix == 1023) {
338
+ $bitlen = 11;
339
+ } elseif ($dix == 511) {
340
+ $bitlen = 10;
341
+ }
342
+ }
343
+ }
344
+ return $decoded;
345
+ }
346
+
347
+ /**
348
+ * FlateDecode
349
+ * Decompresses data encoded using the zlib/deflate compression method, reproducing the original text or binary data.
350
+ * @param $data (string) Data to decode.
351
+ * @return Decoded data string.
352
+ * @since 1.0.000 (2011-05-23)
353
+ * @public static
354
+ */
355
+ public static function decodeFilterFlateDecode($data) {
356
+ // initialize string to return
357
+ $decoded = @gzuncompress($data);
358
+ if ($decoded === false) {
359
+ self::Error('decodeFilterFlateDecode: invalid code');
360
+ }
361
+ return $decoded;
362
+ }
363
+
364
+ /**
365
+ * RunLengthDecode
366
+ * Decompresses data encoded using a byte-oriented run-length encoding algorithm.
367
+ * @param $data (string) Data to decode.
368
+ * @since 1.0.000 (2011-05-23)
369
+ * @public static
370
+ */
371
+ public static function decodeFilterRunLengthDecode($data) {
372
+ // initialize string to return
373
+ $decoded = '';
374
+ // data length
375
+ $data_length = strlen($data);
376
+ $i = 0;
377
+ while($i < $data_length) {
378
+ // get current byte value
379
+ $byte = ord($data{$i});
380
+ if ($byte == 128) {
381
+ // a length value of 128 denote EOD
382
+ break;
383
+ } elseif ($byte < 128) {
384
+ // if the length byte is in the range 0 to 127
385
+ // the following length + 1 (1 to 128) bytes shall be copied literally during decompression
386
+ $decoded .= substr($data, ($i + 1), ($byte + 1));
387
+ // move to next block
388
+ $i += ($byte + 2);
389
+ } else {
390
+ // if length is in the range 129 to 255,
391
+ // the following single byte shall be copied 257 - length (2 to 128) times during decompression
392
+ $decoded .= str_repeat($data{($i + 1)}, (257 - $byte));
393
+ // move to next block
394
+ $i += 2;
395
+ }
396
+ }
397
+ return $decoded;
398
+ }
399
+
400
+ /**
401
+ * CCITTFaxDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
402
+ * Decompresses data encoded using the CCITT facsimile standard, reproducing the original data (typically monochrome image data at 1 bit per pixel).
403
+ * @param $data (string) Data to decode.
404
+ * @return Decoded data string.
405
+ * @since 1.0.000 (2011-05-23)
406
+ * @public static
407
+ */
408
+ public static function decodeFilterCCITTFaxDecode($data) {
409
+ self::Error('~decodeFilterCCITTFaxDecode: this method has not been yet implemented');
410
+ //return $data;
411
+ }
412
+
413
+ /**
414
+ * JBIG2Decode (NOT IMPLEMETED - RETURN AN EXCEPTION)
415
+ * Decompresses data encoded using the JBIG2 standard, reproducing the original monochrome (1 bit per pixel) image data (or an approximation of that data).
416
+ * @param $data (string) Data to decode.
417
+ * @return Decoded data string.
418
+ * @since 1.0.000 (2011-05-23)
419
+ * @public static
420
+ */
421
+ public static function decodeFilterJBIG2Decode($data) {
422
+ self::Error('~decodeFilterJBIG2Decode: this method has not been yet implemented');
423
+ //return $data;
424
+ }
425
+
426
+ /**
427
+ * DCTDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
428
+ * Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard, reproducing image sample data that approximates the original data.
429
+ * @param $data (string) Data to decode.
430
+ * @return Decoded data string.
431
+ * @since 1.0.000 (2011-05-23)
432
+ * @public static
433
+ */
434
+ public static function decodeFilterDCTDecode($data) {
435
+ self::Error('~decodeFilterDCTDecode: this method has not been yet implemented');
436
+ //return $data;
437
+ }
438
+
439
+ /**
440
+ * JPXDecode (NOT IMPLEMETED - RETURN AN EXCEPTION)
441
+ * Decompresses data encoded using the wavelet-based JPEG2000 standard, reproducing the original image data.
442
+ * @param $data (string) Data to decode.
443
+ * @return Decoded data string.
444
+ * @since 1.0.000 (2011-05-23)
445
+ * @public static
446
+ */
447
+ public static function decodeFilterJPXDecode($data) {
448
+ self::Error('~decodeFilterJPXDecode: this method has not been yet implemented');
449
+ //return $data;
450
+ }
451
+
452
+ /**
453
+ * Crypt (NOT IMPLEMETED - RETURN AN EXCEPTION)
454
+ * Decrypts data encrypted by a security handler, reproducing the data as it was before encryption.
455
+ * @param $data (string) Data to decode.
456
+ * @return Decoded data string.
457
+ * @since 1.0.000 (2011-05-23)
458
+ * @public static
459
+ */
460
+ public static function decodeFilterCrypt($data) {
461
+ self::Error('~decodeFilterCrypt: this method has not been yet implemented');
462
+ //return $data;
463
+ }
464
+
465
+ // --- END FILTERS SECTION -------------------------------------------------
466
+
467
+ /**
468
+ * Throw an exception.
469
+ * @param $msg (string) The error message
470
+ * @since 1.0.000 (2011-05-23)
471
+ * @public static
472
+ */
473
+ public static function Error($msg) {
474
+ throw new Exception('TCPDF_PARSER ERROR: '.$msg);
475
+ }
476
+
477
+ } // END OF TCPDF_FILTERS CLASS
478
+
479
+ //============================================================+
480
+ // END OF FILE
481
+ //============================================================+
includes/lib/{tcpdf_min → tcpdf}/include/tcpdf_font_data.php RENAMED
@@ -1,18451 +1,18447 @@
1
- <?php
2
- //============================================================+
3
- // File name : tcpdf_font_data.php
4
- // Version : 1.0.001
5
- // Begin : 2008-01-01
6
- // Last Update : 2013-04-01
7
- // Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
8
- // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
9
- // -------------------------------------------------------------------
10
- // Copyright (C) 2008-2013 Nicola Asuni - Tecnick.com LTD
11
- //
12
- // This file is part of TCPDF software library.
13
- //
14
- // TCPDF is free software: you can redistribute it and/or modify it
15
- // under the terms of the GNU Lesser General Public License as
16
- // published by the Free Software Foundation, either version 3 of the
17
- // License, or (at your option) any later version.
18
- //
19
- // TCPDF is distributed in the hope that it will be useful, but
20
- // WITHOUT ANY WARRANTY; without even the implied warranty of
21
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22
- // See the GNU Lesser General Public License for more details.
23
- //
24
- // You should have received a copy of the GNU Lesser General Public License
25
- // along with TCPDF. If not, see <http://www.gnu.org/licenses/>.
26
- //
27
- // See LICENSE.TXT file for more information.
28
- // -------------------------------------------------------------------
29
- //
30
- // Description : Unicode data and encoding maps for TCPDF.
31
- //
32
- //============================================================+
33
-
34
- /**
35
- * @file
36
- * Unicode data and encoding maps for TCPDF.
37
- * @author Nicola Asuni
38
- * @package com.tecnick.tcpdf
39
- */
40
-
41
- /**
42
- * @class TCPDF_FONT_DATA
43
- * Unicode data and encoding maps for TCPDF.
44
- * @package com.tecnick.tcpdf
45
- * @version 1.0.001
46
- * @author Nicola Asuni - info@tecnick.com
47
- */
48
-
49
- // Added by Algoritmika
50
- if ( class_exists( 'TCPDF_FONT_DATA' ) ) return;
51
-
52
- class TCPDF_FONT_DATA {
53
-
54
- /**
55
- * Unicode code for Left-to-Right Mark.
56
- * @public
57
- */
58
- public static $uni_LRM = 8206;
59
-
60
- /**
61
- * Unicode code for Right-to-Left Mark.
62
- * @public
63
- */
64
- public static $uni_RLM = 8207;
65
-
66
- /**
67
- * Unicode code for Left-to-Right Embedding.
68
- * @public
69
- */
70
- public static $uni_LRE = 8234;
71
-
72
- /**
73
- * Unicode code for Right-to-Left Embedding.
74
- * @public
75
- */
76
- public static $uni_RLE = 8235;
77
-
78
- /**
79
- * Unicode code for Pop Directional Format.
80
- * @public
81
- */
82
- public static $uni_PDF = 8236;
83
-
84
- /**
85
- * Unicode code for Left-to-Right Override.
86
- * @public
87
- */
88
- public static $uni_LRO = 8237;
89
-
90
- /**
91
- * Unicode code for Right-to-Left Override.
92
- * @public
93
- */
94
- public static $uni_RLO = 8238;
95
-
96
- /**
97
- * Pattern to test RTL (Righ-To-Left) strings using regular expressions.
98
- * @public
99
- */
100
- public static $uni_RE_PATTERN_RTL = "/(
101
- \xD6\xBE # R
102
- | \xD7[\x80\x83\x86\x90-\xAA\xB0-\xB4] # R
103
- | \xDF[\x80-\xAA\xB4\xB5\xBA] # R
104
- | \xE2\x80\x8F # R
105
- | \xEF\xAC[\x9D\x9F\xA0-\xA8\xAA-\xB6\xB8-\xBC\xBE] # R
106
- | \xEF\xAD[\x80\x81\x83\x84\x86-\x8F] # R
107
- | \xF0\x90\xA0[\x80-\x85\x88\x8A-\xB5\xB7\xB8\xBC\xBF] # R
108
- | \xF0\x90\xA4[\x80-\x99] # R
109
- | \xF0\x90\xA8[\x80\x90-\x93\x95-\x97\x99-\xB3] # R
110
- | \xF0\x90\xA9[\x80-\x87\x90-\x98] # R
111
- | \xE2\x80[\xAB\xAE] # RLE & RLO
112
- )/x";
113
-
114
- /**
115
- * Pattern to test Arabic strings using regular expressions. Source: http://www.w3.org/International/questions/qa-forms-utf-8
116
- * @public
117
- */
118
- public static $uni_RE_PATTERN_ARABIC = "/(
119
- \xD8[\x80-\x83\x8B\x8D\x9B\x9E\x9F\xA1-\xBA] # AL
120
- | \xD9[\x80-\x8A\xAD-\xAF\xB1-\xBF] # AL
121
- | \xDA[\x80-\xBF] # AL
122
- | \xDB[\x80-\x95\x9D\xA5\xA6\xAE\xAF\xBA-\xBF] # AL
123
- | \xDC[\x80-\x8D\x90\x92-\xAF] # AL
124
- | \xDD[\x8D-\xAD] # AL
125
- | \xDE[\x80-\xA5\xB1] # AL
126
- | \xEF\xAD[\x90-\xBF] # AL
127
- | \xEF\xAE[\x80-\xB1] # AL
128
- | \xEF\xAF[\x93-\xBF] # AL
129
- | \xEF[\xB0-\xB3][\x80-\xBF] # AL
130
- | \xEF\xB4[\x80-\xBD] # AL
131
- | \xEF\xB5[\x90-\xBF] # AL
132
- | \xEF\xB6[\x80-\x8F\x92-\xBF] # AL
133
- | \xEF\xB7[\x80-\x87\xB0-\xBC] # AL
134
- | \xEF\xB9[\xB0-\xB4\xB6-\xBF] # AL
135
- | \xEF\xBA[\x80-\xBF] # AL
136
- | \xEF\xBB[\x80-\xBC] # AL
137
- | \xD9[\xA0-\xA9\xAB\xAC] # AN
138
- )/x";
139
-
140
- /**
141
- * Array of Unicode types.
142
- * @public
143
- */
144
- public static $uni_type = array(
145
- 0=>'BN',
146
- 1=>'BN',
147
- 2=>'BN',
148
- 3=>'BN',
149
- 4=>'BN',
150
- 5=>'BN',
151
- 6=>'BN',
152
- 7=>'BN',
153
- 8=>'BN',
154
- 9=>'S',
155
- 10=>'B',
156
- 11=>'S',
157
- 12=>'WS',
158
- 13=>'B',
159
- 14=>'BN',
160
- 15=>'BN',
161
- 16=>'BN',
162
- 17=>'BN',
163
- 18=>'BN',
164
- 19=>'BN',
165
- 20=>'BN',
166
- 21=>'BN',
167
- 22=>'BN',
168
- 23=>'BN',
169
- 24=>'BN',
170
- 25=>'BN',
171
- 26=>'BN',
172
- 27=>'BN',
173
- 28=>'B',
174
- 29=>'B',
175
- 30=>'B',
176
- 31=>'S',
177
- 32=>'WS',
178
- 33=>'ON',
179
- 34=>'ON',
180
- 35=>'ET',
181
- 36=>'ET',
182
- 37=>'ET',
183
- 38=>'ON',
184
- 39=>'ON',
185
- 40=>'ON',
186
- 41=>'ON',
187
- 42=>'ON',
188
- 43=>'ES',
189
- 44=>'CS',
190
- 45=>'ES',
191
- 46=>'CS',
192
- 47=>'CS',
193
- 48=>'EN',
194
- 49=>'EN',
195
- 50=>'EN',
196
- 51=>'EN',
197
- 52=>'EN',
198
- 53=>'EN',
199
- 54=>'EN',
200
- 55=>'EN',
201
- 56=>'EN',
202
- 57=>'EN',
203
- 58=>'CS',
204
- 59=>'ON',
205
- 60=>'ON',
206
- 61=>'ON',
207
- 62=>'ON',
208
- 63=>'ON',
209
- 64=>'ON',
210
- 65=>'L',
211
- 66=>'L',
212
- 67=>'L',
213
- 68=>'L',
214
- 69=>'L',
215
- 70=>'L',
216
- 71=>'L',
217
- 72=>'L',
218
- 73=>'L',
219
- 74=>'L',
220
- 75=>'L',
221
- 76=>'L',
222
- 77=>'L',
223
- 78=>'L',
224
- 79=>'L',
225
- 80=>'L',
226
- 81=>'L',
227
- 82=>'L',
228
- 83=>'L',
229
- 84=>'L',
230
- 85=>'L',
231
- 86=>'L',
232
- 87=>'L',
233
- 88=>'L',
234
- 89=>'L',
235
- 90=>'L',
236
- 91=>'ON',
237
- 92=>'ON',
238
- 93=>'ON',
239
- 94=>'ON',
240
- 95=>'ON',
241
- 96=>'ON',
242
- 97=>'L',
243
- 98=>'L',
244
- 99=>'L',
245
- 100=>'L',
246
- 101=>'L',
247
- 102=>'L',
248
- 103=>'L',
249
- 104=>'L',
250
- 105=>'L',
251
- 106=>'L',
252
- 107=>'L',
253
- 108=>'L',
254
- 109=>'L',
255
- 110=>'L',
256
- 111=>'L',
257
- 112=>'L',
258
- 113=>'L',
259
- 114=>'L',
260
- 115=>'L',
261
- 116=>'L',
262
- 117=>'L',
263
- 118=>'L',
264
- 119=>'L',
265
- 120=>'L',
266
- 121=>'L',
267
- 122=>'L',
268
- 123=>'ON',
269
- 124=>'ON',
270
- 125=>'ON',
271
- 126=>'ON',
272
- 127=>'BN',
273
- 128=>'BN',
274
- 129=>'BN',
275
- 130=>'BN',
276
- 131=>'BN',
277
- 132=>'BN',
278
- 133=>'B',
279
- 134=>'BN',
280
- 135=>'BN',
281
- 136=>'BN',
282
- 137=>'BN',
283
- 138=>'BN',
284
- 139=>'BN',
285
- 140=>'BN',
286
- 141=>'BN',
287
- 142=>'BN',
288
- 143=>'BN',
289
- 144=>'BN',
290
- 145=>'BN',
291
- 146=>'BN',
292
- 147=>'BN',
293
- 148=>'BN',
294
- 149=>'BN',
295
- 150=>'BN',
296
- 151=>'BN',
297
- 152=>'BN',
298
- 153=>'BN',
299
- 154=>'BN',
300
- 155=>'BN',
301
- 156=>'BN',
302
- 157=>'BN',
303
- 158=>'BN',
304
- 159=>'BN',
305
- 160=>'CS',
306
- 161=>'ON',
307
- 162=>'ET',
308
- 163=>'ET',
309
- 164=>'ET',
310
- 165=>'ET',
311
- 166=>'ON',
312
- 167=>'ON',
313
- 168=>'ON',
314
- 169=>'ON',
315
- 170=>'L',
316
- 171=>'ON',
317
- 172=>'ON',
318
- 173=>'BN',
319
- 174=>'ON',
320
- 175=>'ON',
321
- 176=>'ET',
322
- 177=>'ET',
323
- 178=>'EN',
324
- 179=>'EN',
325
- 180=>'ON',
326
- 181=>'L',
327
- 182=>'ON',
328
- 183=>'ON',
329
- 184=>'ON',
330
- 185=>'EN',
331
- 186=>'L',
332
- 187=>'ON',
333
- 188=>'ON',
334
- 189=>'ON',
335
- 190=>'ON',
336
- 191=>'ON',
337
- 192=>'L',
338
- 193=>'L',
339
- 194=>'L',
340
- 195=>'L',
341
- 196=>'L',
342
- 197=>'L',
343
- 198=>'L',
344
- 199=>'L',
345
- 200=>'L',
346
- 201=>'L',
347
- 202=>'L',
348
- 203=>'L',
349
- 204=>'L',
350
- 205=>'L',
351
- 206=>'L',
352
- 207=>'L',
353
- 208=>'L',
354
- 209=>'L',
355
- 210=>'L',
356
- 211=>'L',
357
- 212=>'L',
358
- 213=>'L',
359
- 214=>'L',
360
- 215=>'ON',
361
- 216=>'L',
362
- 217=>'L',
363
- 218=>'L',
364
- 219=>'L',
365
- 220=>'L',
366
- 221=>'L',
367
- 222=>'L',
368
- 223=>'L',
369
- 224=>'L',
370
- 225=>'L',
371
- 226=>'L',
372
- 227=>'L',
373
- 228=>'L',
374
- 229=>'L',
375
- 230=>'L',
376
- 231=>'L',
377
- 232=>'L',
378
- 233=>'L',
379
- 234=>'L',
380
- 235=>'L',
381
- 236=>'L',
382
- 237=>'L',
383
- 238=>'L',
384
- 239=>'L',
385
- 240=>'L',
386
- 241=>'L',
387
- 242=>'L',
388
- 243=>'L',
389
- 244=>'L',
390
- 245=>'L',
391
- 246=>'L',
392
- 247=>'ON',
393
- 248=>'L',
394
- 249=>'L',
395
- 250=>'L',
396
- 251=>'L',
397
- 252=>'L',
398
- 253=>'L',
399
- 254=>'L',
400
- 255=>'L',
401
- 256=>'L',
402
- 257=>'L',
403
- 258=>'L',
404
- 259=>'L',
405
- 260=>'L',
406
- 261=>'L',
407
- 262=>'L',
408
- 263=>'L',
409
- 264=>'L',
410
- 265=>'L',
411
- 266=>'L',
412
- 267=>'L',
413
- 268=>'L',
414
- 269=>'L',
415
- 270=>'L',
416
- 271=>'L',
417
- 272=>'L',
418
- 273=>'L',
419
- 274=>'L',
420
- 275=>'L',
421
- 276=>'L',
422
- 277=>'L',
423
- 278=>'L',
424
- 279=>'L',
425
- 280=>'L',
426
- 281=>'L',
427
- 282=>'L',
428
- 283=>'L',
429
- 284=>'L',
430
- 285=>'L',
431
- 286=>'L',
432
- 287=>'L',
433
- 288=>'L',
434
- 289=>'L',
435
- 290=>'L',
436
- 291=>'L',
437
- 292=>'L',
438
- 293=>'L',
439
- 294=>'L',
440
- 295=>'L',
441
- 296=>'L',
442
- 297=>'L',
443
- 298=>'L',
444
- 299=>'L',
445
- 300=>'L',
446
- 301=>'L',
447
- 302=>'L',
448
- 303=>'L',
449
- 304=>'L',
450
- 305=>'L',
451
- 306=>'L',
452
- 307=>'L',
453
- 308=>'L',
454
- 309=>'L',
455
- 310=>'L',
456
- 311=>'L',
457
- 312=>'L',
458
- 313=>'L',
459
- 314=>'L',
460
- 315=>'L',
461
- 316=>'L',
462
- 317=>'L',
463
- 318=>'L',
464
- 319=>'L',
465
- 320=>'L',
466
- 321=>'L',
467
- 322=>'L',
468
- 323=>'L',
469
- 324=>'L',
470
- 325=>'L',
471
- 326=>'L',
472
- 327=>'L',
473
- 328=>'L',
474
- 329=>'L',
475
- 330=>'L',
476
- 331=>'L',
477
- 332=>'L',
478
- 333=>'L',
479
- 334=>'L',
480
- 335=>'L',
481
- 336=>'L',
482
- 337=>'L',
483
- 338=>'L',
484
- 339=>'L',
485
- 340=>'L',
486
- 341=>'L',
487
- 342=>'L',
488
- 343=>'L',
489
- 344=>'L',
490
- 345=>'L',
491
- 346=>'L',
492
- 347=>'L',
493
- 348=>'L',
494
- 349=>'L',
495
- 350=>'L',
496
- 351=>'L',
497
- 352=>'L',
498
- 353=>'L',
499
- 354=>'L',
500
- 355=>'L',
501
- 356=>'L',
502
- 357=>'L',
503
- 358=>'L',
504
- 359=>'L',
505
- 360=>'L',
506
- 361=>'L',
507
- 362=>'L',
508
- 363=>'L',
509
- 364=>'L',
510
- 365=>'L',
511
- 366=>'L',
512
- 367=>'L',
513
- 368=>'L',
514
- 369=>'L',
515
- 370=>'L',
516
- 371=>'L',
517
- 372=>'L',
518
- 373=>'L',
519
- 374=>'L',
520
- 375=>'L',
521
- 376=>'L',
522
- 377=>'L',
523
- 378=>'L',
524
- 379=>'L',
525
- 380=>'L',
526
- 381=>'L',
527
- 382=>'L',
528
- 383=>'L',
529
- 384=>'L',
530
- 385=>'L',
531
- 386=>'L',
532
- 387=>'L',
533
- 388=>'L',
534
- 389=>'L',
535
- 390=>'L',
536
- 391=>'L',
537
- 392=>'L',
538
- 393=>'L',
539
- 394=>'L',
540
- 395=>'L',
541
- 396=>'L',
542
- 397=>'L',
543
- 398=>'L',
544
- 399=>'L',
545
- 400=>'L',
546
- 401=>'L',
547
- 402=>'L',
548
- 403=>'L',
549
- 404=>'L',
550
- 405=>'L',
551
- 406=>'L',
552
- 407=>'L',
553
- 408=>'L',
554
- 409=>'L',
555
- 410=>'L',
556
- 411=>'L',
557
- 412=>'L',
558
- 413=>'L',
559
- 414=>'L',
560
- 415=>'L',
561
- 416=>'L',
562
- 417=>'L',
563
- 418=>'L',
564
- 419=>'L',
565
- 420=>'L',
566
- 421=>'L',
567
- 422=>'L',
568
- 423=>'L',
569
- 424=>'L',
570
- 425=>'L',
571
- 426=>'L',
572
- 427=>'L',
573
- 428=>'L',
574
- 429=>'L',
575
- 430=>'L',
576
- 431=>'L',
577
- 432=>'L',
578
- 433=>'L',
579
- 434=>'L',
580
- 435=>'L',
581
- 436=>'L',
582
- 437=>'L',
583
- 438=>'L',
584
- 439=>'L',
585
- 440=>'L',
586
- 441=>'L',
587
- 442=>'L',
588
- 443=>'L',
589
- 444=>'L',
590
- 445=>'L',
591
- 446=>'L',
592
- 447=>'L',
593
- 448=>'L',
594
- 449=>'L',
595
- 450=>'L',
596
- 451=>'L',
597
- 452=>'L',
598
- 453=>'L',
599
- 454=>'L',
600
- 455=>'L',
601
- 456=>'L',
602
- 457=>'L',
603
- 458=>'L',
604
- 459=>'L',
605
- 460=>'L',
606
- 461=>'L',
607
- 462=>'L',
608
- 463=>'L',
609
- 464=>'L',
610
- 465=>'L',
611
- 466=>'L',
612
- 467=>'L',
613
- 468=>'L',
614
- 469=>'L',
615
- 470=>'L',
616
- 471=>'L',
617
- 472=>'L',
618
- 473=>'L',
619
- 474=>'L',
620
- 475=>'L',
621
- 476=>'L',
622
- 477=>'L',
623
- 478=>'L',
624
- 479=>'L',
625
- 480=>'L',
626
- 481=>'L',
627
- 482=>'L',
628
- 483=>'L',
629
- 484=>'L',
630
- 485=>'L',
631
- 486=>'L',
632
- 487=>'L',
633
- 488=>'L',
634
- 489=>'L',
635
- 490=>'L',
636
- 491=>'L',
637
- 492=>'L',
638
- 493=>'L',
639
- 494=>'L',
640
- 495=>'L',
641
- 496=>'L',
642
- 497=>'L',
643
- 498=>'L',
644
- 499=>'L',
645
- 500=>'L',
646
- 501=>'L',
647
- 502=>'L',
648
- 503=>'L',
649
- 504=>'L',
650
- 505=>'L',
651
- 506=>'L',
652
- 507=>'L',
653
- 508=>'L',
654
- 509=>'L',
655
- 510=>'L',
656
- 511=>'L',
657
- 512=>'L',
658
- 513=>'L',
659
- 514=>'L',
660
- 515=>'L',
661
- 516=>'L',
662
- 517=>'L',
663
- 518=>'L',
664
- 519=>'L',
665
- 520=>'L',
666
- 521=>'L',
667
- 522=>'L',
668
- 523=>'L',
669
- 524=>'L',
670
- 525=>'L',
671
- 526=>'L',
672
- 527=>'L',
673
- 528=>'L',
674
- 529=>'L',
675
- 530=>'L',
676
- 531=>'L',
677
- 532=>'L',
678
- 533=>'L',
679
- 534=>'L',
680
- 535=>'L',
681
- 536=>'L',
682
- 537=>'L',
683
- 538=>'L',
684
- 539=>'L',
685
- 540=>'L',
686
- 541=>'L',
687
- 542=>'L',
688
- 543=>'L',
689
- 544=>'L',
690
- 545=>'L',
691
- 546=>'L',
692
- 547=>'L',
693
- 548=>'L',
694
- 549=>'L',
695
- 550=>'L',
696
- 551=>'L',
697
- 552=>'L',
698
- 553=>'L',
699
- 554=>'L',
700
- 555=>'L',
701
- 556=>'L',
702
- 557=>'L',
703
- 558=>'L',
704
- 559=>'L',
705
- 560=>'L',
706
- 561=>'L',
707
- 562=>'L',
708
- 563=>'L',
709
- 564=>'L',
710
- 565=>'L',
711
- 566=>'L',
712
- 567=>'L',
713
- 568=>'L',
714
- 569=>'L',
715
- 570=>'L',
716
- 571=>'L',
717
- 572=>'L',
718
- 573=>'L',
719
- 574=>'L',
720
- 575=>'L',
721
- 576=>'L',
722
- 577=>'L',
723
- 578=>'L',
724
- 579=>'L',
725
- 580=>'L',
726
- 581=>'L',
727
- 582=>'L',
728
- 583=>'L',
729
- 584=>'L',
730
- 585=>'L',
731
- 586=>'L',
732
- 587=>'L',
733
- 588=>'L',
734
- 589=>'L',
735
- 590=>'L',
736
- 591=>'L',
737
- 592=>'L',
738
- 593=>'L',
739
- 594=>'L',
740
- 595=>'L',
741
- 596=>'L',
742
- 597=>'L',
743
- 598=>'L',
744
- 599=>'L',
745
- 600=>'L',
746
- 601=>'L',
747
- 602=>'L',
748
- 603=>'L',
749
- 604=>'L',
750
- 605=>'L',
751
- 606=>'L',
752
- 607=>'L',
753
- 608=>'L',
754
- 609=>'L',
755
- 610=>'L',
756
- 611=>'L',
757
- 612=>'L',
758
- 613=>'L',
759
- 614=>'L',
760
- 615=>'L',
761
- 616=>'L',
762
- 617=>'L',
763
- 618=>'L',
764
- 619=>'L',
765
- 620=>'L',
766
- 621=>'L',
767
- 622=>'L',
768
- 623=>'L',
769
- 624=>'L',
770
- 625=>'L',
771
- 626=>'L',
772
- 627=>'L',
773
- 628=>'L',
774
- 629=>'L',
775
- 630=>'L',
776
- 631=>'L',
777
- 632=>'L',
778
- 633=>'L',
779
- 634=>'L',
780
- 635=>'L',
781
- 636=>'L',
782
- 637=>'L',
783
- 638=>'L',
784
- 639=>'L',
785
- 640=>'L',
786
- 641=>'L',
787
- 642=>'L',
788
- 643=>'L',
789
- 644=>'L',
790
- 645=>'L',
791
- 646=>'L',
792
- 647=>'L',
793
- 648=>'L',
794
- 649=>'L',
795
- 650=>'L',
796
- 651=>'L',
797
- 652=>'L',
798
- 653=>'L',
799
- 654=>'L',
800
- 655=>'L',
801
- 656=>'L',
802
- 657=>'L',
803
- 658=>'L',
804
- 659=>'L',
805
- 660=>'L',
806
- 661=>'L',
807
- 662=>'L',
808
- 663=>'L',
809
- 664=>'L',
810
- 665=>'L',
811
- 666=>'L',
812
- 667=>'L',
813
- 668=>'L',
814
- 669=>'L',
815
- 670=>'L',
816
- 671=>'L',
817
- 672=>'L',
818
- 673=>'L',
819
- 674=>'L',
820
- 675=>'L',
821
- 676=>'L',
822
- 677=>'L',
823
- 678=>'L',
824
- 679=>'L',
825
- 680=>'L',
826
- 681=>'L',
827
- 682=>'L',
828
- 683=>'L',
829
- 684=>'L',
830
- 685=>'L',
831
- 686=>'L',
832
- 687=>'L',
833
- 688=>'L',
834
- 689=>'L',
835
- 690=>'L',
836
- 691=>'L',
837
- 692=>'L',
838
- 693=>'L',
839
- 694=>'L',
840
- 695=>'L',
841
- 696=>'L',
842
- 697=>'ON',
843
- 698=>'ON',
844
- 699=>'L',
845
- 700=>'L',
846
- 701=>'L',
847
- 702=>'L',
848
- 703=>'L',
849
- 704=>'L',
850
- 705=>'L',
851
- 706=>'ON',
852
- 707=>'ON',
853
- 708=>'ON',
854
- 709=>'ON',
855
- 710=>'ON',
856
- 711=>'ON',
857
- 712=>'ON',
858
- 713=>'ON',
859
- 714=>'ON',
860
- 715=>'ON',
861
- 716=>'ON',
862
- 717=>'ON',
863
- 718=>'ON',
864
- 719=>'ON',
865
- 720=>'L',
866
- 721=>'L',
867
- 722=>'ON',
868
- 723=>'ON',
869
- 724=>'ON',
870
- 725=>'ON',
871
- 726=>'ON',
872
- 727=>'ON',
873
- 728=>'ON',
874
- 729=>'ON',
875
- 730=>'ON',
876
- 731=>'ON',
877
- 732=>'ON',
878
- 733=>'ON',
879
- 734=>'ON',
880
- 735=>'ON',
881
- 736=>'L',
882
- 737=>'L',
883
- 738=>'L',
884
- 739=>'L',
885
- 740=>'L',
886
- 741=>'ON',
887
- 742=>'ON',
888
- 743=>'ON',
889
- 744=>'ON',
890
- 745=>'ON',
891
- 746=>'ON',
892
- 747=>'ON',
893
- 748=>'ON',
894
- 749=>'ON',
895
- 750=>'L',
896
- 751=>'ON',
897
- 752=>'ON',
898
- 753=>'ON',
899
- 754=>'ON',
900
- 755=>'ON',
901
- 756=>'ON',
902
- 757=>'ON',
903
- 758=>'ON',
904
- 759=>'ON',
905
- 760=>'ON',
906
- 761=>'ON',
907
- 762=>'ON',
908
- 763=>'ON',
909
- 764=>'ON',
910
- 765=>'ON',
911
- 766=>'ON',
912
- 767=>'ON',
913
- 768=>'NSM',
914
- 769=>'NSM',
915
- 770=>'NSM',
916
- 771=>'NSM',
917
- 772=>'NSM',
918
- 773=>'NSM',
919
- 774=>'NSM',
920
- 775=>'NSM',
921
- 776=>'NSM',
922
- 777=>'NSM',
923
- 778=>'NSM',
924
- 779=>'NSM',
925
- 780=>'NSM',
926
- 781=>'NSM',
927
- 782=>'NSM',
928
- 783=>'NSM',
929
- 784=>'NSM',
930
- 785=>'NSM',
931
- 786=>'NSM',
932
- 787=>'NSM',
933
- 788=>'NSM',
934
- 789=>'NSM',
935
- 790=>'NSM',
936
- 791=>'NSM',
937
- 792=>'NSM',
938
- 793=>'NSM',
939
- 794=>'NSM',
940
- 795=>'NSM',
941
- 796=>'NSM',
942
- 797=>'NSM',
943
- 798=>'NSM',
944
- 799=>'NSM',
945
- 800=>'NSM',
946
- 801=>'NSM',
947
- 802=>'NSM',
948
- 803=>'NSM',
949
- 804=>'NSM',
950
- 805=>'NSM',
951
- 806=>'NSM',
952
- 807=>'NSM',
953
- 808=>'NSM',
954
- 809=>'NSM',
955
- 810=>'NSM',
956
- 811=>'NSM',
957
- 812=>'NSM',
958
- 813=>'NSM',
959
- 814=>'NSM',
960
- 815=>'NSM',
961
- 816=>'NSM',
962
- 817=>'NSM',
963
- 818=>'NSM',
964
- 819=>'NSM',
965
- 820=>'NSM',
966
- 821=>'NSM',
967
- 822=>'NSM',
968
- 823=>'NSM',
969
- 824=>'NSM',
970
- 825=>'NSM',
971
- 826=>'NSM',
972
- 827=>'NSM',
973
- 828=>'NSM',
974
- 829=>'NSM',
975
- 830=>'NSM',
976
- 831=>'NSM',
977
- 832=>'NSM',
978
- 833=>'NSM',
979
- 834=>'NSM',
980
- 835=>'NSM',
981
- 836=>'NSM',
982
- 837=>'NSM',
983
- 838=>'NSM',
984
- 839=>'NSM',
985
- 840=>'NSM',
986
- 841=>'NSM',
987
- 842=>'NSM',
988
- 843=>'NSM',
989
- 844=>'NSM',
990
- 845=>'NSM',
991
- 846=>'NSM',
992
- 847=>'NSM',
993
- 848=>'NSM',
994
- 849=>'NSM',
995
- 850=>'NSM',
996
- 851=>'NSM',
997
- 852=>'NSM',
998
- 853=>'NSM',
999
- 854=>'NSM',
1000
- 855=>'NSM',
1001
- 856=>'NSM',
1002
- 857=>'NSM',
1003
- 858=>'NSM',
1004
- 859=>'NSM',
1005
- 860=>'NSM',
1006
- 861=>'NSM',
1007
- 862=>'NSM',
1008
- 863=>'NSM',
1009
- 864=>'NSM',
1010
- 865=>'NSM',
1011
- 866=>'NSM',
1012
- 867=>'NSM',
1013
- 868=>'NSM',
1014
- 869=>'NSM',
1015
- 870=>'NSM',
1016
- 871=>'NSM',
1017
- 872=>'NSM',
1018
- 873=>'NSM',
1019
- 874=>'NSM',
1020
- 875=>'NSM',
1021
- 876=>'NSM',
1022
- 877=>'NSM',
1023
- 878=>'NSM',
1024
- 879=>'NSM',
1025
- 884=>'ON',
1026
- 885=>'ON',
1027
- 890=>'L',
1028
- 891=>'L',
1029
- 892=>'L',
1030
- 893=>'L',
1031
- 894=>'ON',
1032
- 900=>'ON',
1033
- 901=>'ON',
1034
- 902=>'L',
1035
- 903=>'ON',
1036
- 904=>'L',
1037
- 905=>'L',
1038
- 906=>'L',
1039
- 908=>'L',
1040
- 910=>'L',
1041
- 911=>'L',
1042
- 912=>'L',
1043
- 913=>'L',
1044
- 914=>'L',
1045
- 915=>'L',
1046
- 916=>'L',
1047
- 917=>'L',
1048
- 918=>'L',
1049
- 919=>'L',
1050
- 920=>'L',
1051
- 921=>'L',
1052
- 922=>'L',
1053
- 923=>'L',
1054
- 924=>'L',
1055
- 925=>'L',
1056
- 926=>'L',
1057
- 927=>'L',
1058
- 928=>'L',
1059
- 929=>'L',
1060
- 931=>'L',
1061
- 932=>'L',
1062
- 933=>'L',
1063
- 934=>'L',
1064
- 935=>'L',
1065
- 936=>'L',
1066
- 937=>'L',
1067
- 938=>'L',
1068
- 939=>'L',
1069
- 940=>'L',
1070
- 941=>'L',
1071
- 942=>'L',
1072
- 943=>'L',
1073
- 944=>'L',
1074
- 945=>'L',
1075
- 946=>'L',
1076
- 947=>'L',
1077
- 948=>'L',
1078
- 949=>'L',
1079
- 950=>'L',
1080
- 951=>'L',
1081
- 952=>'L',
1082
- 953=>'L',
1083
- 954=>'L',
1084
- 955=>'L',
1085
- 956=>'L',
1086
- 957=>'L',
1087
- 958=>'L',
1088
- 959=>'L',
1089
- 960=>'L',
1090
- 961=>'L',
1091
- 962=>'L',
1092
- 963=>'L',
1093
- 964=>'L',
1094
- 965=>'L',
1095
- 966=>'L',
1096
- 967=>'L',
1097
- 968=>'L',
1098
- 969=>'L',
1099
- 970=>'L',
1100
- 971=>'L',
1101
- 972=>'L',
1102
- 973=>'L',
1103
- 974=>'L',
1104
- 976=>'L',
1105
- 977=>'L',
1106
- 978=>'L',
1107
- 979=>'L',
1108
- 980=>'L',
1109
- 981=>'L',
1110
- 982=>'L',
1111
- 983=>'L',
1112
- 984=>'L',
1113
- 985=>'L',
1114
- 986=>'L',
1115
- 987=>'L',
1116
- 988=>'L',
1117
- 989=>'L',
1118
- 990=>'L',
1119
- 991=>'L',
1120
- 992=>'L',
1121
- 993=>'L',
1122
- 994=>'L',
1123
- 995=>'L',
1124
- 996=>'L',
1125
- 997=>'L',
1126
- 998=>'L',
1127
- 999=>'L',
1128
- 1000=>'L',
1129
- 1001=>'L',
1130
- 1002=>'L',
1131
- 1003=>'L',
1132
- 1004=>'L',
1133
- 1005=>'L',
1134
- 1006=>'L',
1135
- 1007=>'L',
1136
- 1008=>'L',
1137
- 1009=>'L',
1138
- 1010=>'L',
1139
- 1011=>'L',
1140
- 1012=>'L',
1141
- 1013=>'L',
1142
- 1014=>'ON',
1143
- 1015=>'L',
1144
- 1016=>'L',
1145
- 1017=>'L',
1146
- 1018=>'L',
1147
- 1019=>'L',
1148
- 1020=>'L',
1149
- 1021=>'L',
1150
- 1022=>'L',
1151
- 1023=>'L',
1152
- 1024=>'L',
1153
- 1025=>'L',
1154
- 1026=>'L',
1155
- 1027=>'L',
1156
- 1028=>'L',
1157
- 1029=>'L',
1158
- 1030=>'L',
1159
- 1031=>'L',
1160
- 1032=>'L',
1161
- 1033=>'L',
1162
- 1034=>'L',
1163
- 1035=>'L',
1164
- 1036=>'L',
1165
- 1037=>'L',
1166
- 1038=>'L',
1167
- 1039=>'L',
1168
- 1040=>'L',
1169
- 1041=>'L',
1170
- 1042=>'L',
1171
- 1043=>'L',
1172
- 1044=>'L',
1173
- 1045=>'L',
1174
- 1046=>'L',
1175
- 1047=>'L',
1176
- 1048=>'L',
1177
- 1049=>'L',
1178
- 1050=>'L',
1179
- 1051=>'L',
1180
- 1052=>'L',
1181
- 1053=>'L',
1182
- 1054=>'L',
1183
- 1055=>'L',
1184
- 1056=>'L',
1185
- 1057=>'L',
1186
- 1058=>'L',
1187
- 1059=>'L',
1188
- 1060=>'L',
1189
- 1061=>'L',
1190
- 1062=>'L',
1191
- 1063=>'L',
1192
- 1064=>'L',
1193
- 1065=>'L',
1194
- 1066=>'L',
1195
- 1067=>'L',
1196
- 1068=>'L',
1197
- 1069=>'L',
1198
- 1070=>'L',
1199
- 1071=>'L',
1200
- 1072=>'L',
1201
- 1073=>'L',
1202
- 1074=>'L',
1203
- 1075=>'L',
1204
- 1076=>'L',
1205
- 1077=>'L',
1206
- 1078=>'L',
1207
- 1079=>'L',
1208
- 1080=>'L',
1209
- 1081=>'L',
1210
- 1082=>'L',
1211
- 1083=>'L',
1212
- 1084=>'L',
1213
- 1085=>'L',
1214
- 1086=>'L',
1215
- 1087=>'L',
1216
- 1088=>'L',
1217
- 1089=>'L',
1218
- 1090=>'L',
1219
- 1091=>'L',
1220
- 1092=>'L',
1221
- 1093=>'L',
1222
- 1094=>'L',
1223
- 1095=>'L',
1224
- 1096=>'L',
1225
- 1097=>'L',
1226
- 1098=>'L',
1227
- 1099=>'L',
1228
- 1100=>'L',
1229
- 1101=>'L',
1230
- 1102=>'L',
1231
- 1103=>'L',
1232
- 1104=>'L',
1233
- 1105=>'L',
1234
- 1106=>'L',
1235
- 1107=>'L',
1236
- 1108=>'L',
1237
- 1109=>'L',
1238
- 1110=>'L',
1239
- 1111=>'L',
1240
- 1112=>'L',
1241
- 1113=>'L',
1242
- 1114=>'L',
1243
- 1115=>'L',
1244
- 1116=>'L',
1245
- 1117=>'L',
1246
- 1118=>'L',
1247
- 1119=>'L',
1248
- 1120=>'L',
1249
- 1121=>'L',
1250
- 1122=>'L',
1251
- 1123=>'L',
1252
- 1124=>'L',
1253
- 1125=>'L',
1254
- 1126=>'L',
1255
- 1127=>'L',
1256
- 1128=>'L',
1257
- 1129=>'L',
1258
- 1130=>'L',
1259
- 1131=>'L',
1260
- 1132=>'L',
1261
- 1133=>'L',
1262
- 1134=>'L',
1263
- 1135=>'L',
1264
- 1136=>'L',
1265
- 1137=>'L',
1266
- 1138=>'L',
1267
- 1139=>'L',
1268
- 1140=>'L',
1269
- 1141=>'L',
1270
- 1142=>'L',
1271
- 1143=>'L',
1272
- 1144=>'L',
1273
- 1145=>'L',
1274
- 1146=>'L',
1275
- 1147=>'L',
1276
- 1148=>'L',
1277
- 1149=>'L',
1278
- 1150=>'L',
1279
- 1151=>'L',
1280
- 1152=>'L',
1281
- 1153=>'L',
1282
- 1154=>'L',
1283
- 1155=>'NSM',
1284
- 1156=>'NSM',
1285
- 1157=>'NSM',
1286
- 1158=>'NSM',
1287
- 1160=>'NSM',
1288
- 1161=>'NSM',
1289
- 1162=>'L',
1290
- 1163=>'L',
1291
- 1164=>'L',
1292
- 1165=>'L',
1293
- 1166=>'L',
1294
- 1167=>'L',
1295
- 1168=>'L',
1296
- 1169=>'L',
1297
- 1170=>'L',
1298
- 1171=>'L',
1299
- 1172=>'L',
1300
- 1173=>'L',
1301
- 1174=>'L',
1302
- 1175=>'L',
1303
- 1176=>'L',
1304
- 1177=>'L',
1305
- 1178=>'L',
1306
- 1179=>'L',
1307
- 1180=>'L',
1308
- 1181=>'L',
1309
- 1182=>'L',
1310
- 1183=>'L',
1311
- 1184=>'L',
1312
- 1185=>'L',
1313
- 1186=>'L',
1314
- 1187=>'L',
1315
- 1188=>'L',
1316
- 1189=>'L',
1317
- 1190=>'L',
1318
- 1191=>'L',
1319
- 1192=>'L',
1320
- 1193=>'L',
1321
- 1194=>'L',
1322
- 1195=>'L',
1323
- 1196=>'L',
1324
- 1197=>'L',
1325
- 1198=>'L',
1326
- 1199=>'L',
1327
- 1200=>'L',
1328
- 1201=>'L',
1329
- 1202=>'L',
1330
- 1203=>'L',
1331
- 1204=>'L',
1332
- 1205=>'L',
1333
- 1206=>'L',
1334
- 1207=>'L',
1335
- 1208=>'L',
1336
- 1209=>'L',
1337
- 1210=>'L',
1338
- 1211=>'L',
1339
- 1212=>'L',
1340
- 1213=>'L',
1341
- 1214=>'L',
1342
- 1215=>'L',
1343
- 1216=>'L',
1344
- 1217=>'L',
1345
- 1218=>'L',
1346
- 1219=>'L',
1347
- 1220=>'L',
1348
- 1221=>'L',
1349
- 1222=>'L',
1350
- 1223=>'L',
1351
- 1224=>'L',
1352
- 1225=>'L',
1353
- 1226=>'L',
1354
- 1227=>'L',
1355
- 1228=>'L',
1356
- 1229=>'L',
1357
- 1230=>'L',
1358
- 1231=>'L',
1359
- 1232=>'L',
1360
- 1233=>'L',
1361
- 1234=>'L',
1362
- 1235=>'L',
1363
- 1236=>'L',
1364
- 1237=>'L',
1365
- 1238=>'L',
1366
- 1239=>'L',
1367
- 1240=>'L',
1368
- 1241=>'L',
1369
- 1242=>'L',
1370
- 1243=>'L',
1371
- 1244=>'L',
1372
- 1245=>'L',
1373
- 1246=>'L',
1374
- 1247=>'L',
1375
- 1248=>'L',
1376
- 1249=>'L',
1377
- 1250=>'L',
1378
- 1251=>'L',
1379
- 1252=>'L',
1380
- 1253=>'L',
1381
- 1254=>'L',
1382
- 1255=>'L',
1383
- 1256=>'L',
1384
- 1257=>'L',
1385
- 1258=>'L',
1386
- 1259=>'L',
1387
- 1260=>'L',
1388
- 1261=>'L',
1389
- 1262=>'L',
1390
- 1263=>'L',
1391
- 1264=>'L',
1392
- 1265=>'L',
1393
- 1266=>'L',
1394
- 1267=>'L',
1395
- 1268=>'L',
1396
- 1269=>'L',
1397
- 1270=>'L',
1398
- 1271=>'L',
1399
- 1272=>'L',
1400
- 1273=>'L',
1401
- 1274=>'L',
1402
- 1275=>'L',
1403
- 1276=>'L',
1404
- 1277=>'L',
1405
- 1278=>'L',
1406
- 1279=>'L',
1407
- 1280=>'L',
1408
- 1281=>'L',
1409
- 1282=>'L',
1410
- 1283=>'L',
1411
- 1284=>'L',
1412
- 1285=>'L',
1413
- 1286=>'L',
1414
- 1287=>'L',
1415
- 1288=>'L',
1416
- 1289=>'L',
1417
- 1290=>'L',
1418
- 1291=>'L',
1419
- 1292=>'L',
1420
- 1293=>'L',
1421
- 1294=>'L',
1422
- 1295=>'L',
1423
- 1296=>'L',
1424
- 1297=>'L',
1425
- 1298=>'L',
1426
- 1299=>'L',
1427
- 1329=>'L',
1428
- 1330=>'L',
1429
- 1331=>'L',
1430
- 1332=>'L',
1431
- 1333=>'L',
1432
- 1334=>'L',
1433
- 1335=>'L',
1434
- 1336=>'L',
1435
- 1337=>'L',
1436
- 1338=>'L',
1437
- 1339=>'L',
1438
- 1340=>'L',
1439
- 1341=>'L',
1440
- 1342=>'L',
1441
- 1343=>'L',
1442
- 1344=>'L',
1443
- 1345=>'L',
1444
- 1346=>'L',
1445
- 1347=>'L',
1446
- 1348=>'L',
1447
- 1349=>'L',
1448
- 1350=>'L',
1449
- 1351=>'L',
1450
- 1352=>'L',
1451
- 1353=>'L',
1452
- 1354=>'L',
1453
- 1355=>'L',
1454
- 1356=>'L',
1455
- 1357=>'L',
1456
- 1358=>'L',
1457
- 1359=>'L',
1458
- 1360=>'L',
1459
- 1361=>'L',
1460
- 1362=>'L',
1461
- 1363=>'L',
1462
- 1364=>'L',
1463
- 1365=>'L',
1464
- 1366=>'L',
1465
- 1369=>'L',
1466
- 1370=>'L',
1467
- 1371=>'L',
1468
- 1372=>'L',
1469
- 1373=>'L',
1470
- 1374=>'L',
1471
- 1375=>'L',
1472
- 1377=>'L',
1473
- 1378=>'L',
1474
- 1379=>'L',
1475
- 1380=>'L',
1476
- 1381=>'L',
1477
- 1382=>'L',
1478
- 1383=>'L',
1479
- 1384=>'L',
1480
- 1385=>'L',
1481
- 1386=>'L',
1482
- 1387=>'