WooCommerce PDF Invoices & Packing Slips - Version 1.1.5

Version Description

  • Feature: German translations added - thanks Christian!
  • Fix: dompdf 0.6.0 proved to be less stable, so switching back to beta3 for now.
Download this release

Release Info

Developer pomegranate
Plugin Icon 128x128 WooCommerce PDF Invoices & Packing Slips
Version 1.1.5
Comparing to
See all releases

Code changes from version 1.1.4 to 1.1.5

includes/class-wcpdf-export.php CHANGED
@@ -79,6 +79,8 @@ if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
79
  // if (!file_exists($template_wrapper)) echo 'Template wrapper not found! <pre>'.$template_wrapper.'</pre><br/>';
80
  // if (!file_exists($template)) echo 'Template not found! <pre>'.$template.'</pre><br/>';
81
  // die($complete_pdf); //output html to browser for debug
 
 
82
 
83
  require_once( WooCommerce_PDF_Invoices::$plugin_path . "lib/dompdf/dompdf_config.inc.php" );
84
  $dompdf = new DOMPDF();
@@ -301,8 +303,17 @@ if ( ! class_exists( 'WooCommerce_PDF_Invoices_Export' ) ) {
301
  // Set the thumbnail id
302
  $data['thumbnail_id'] = $this->get_thumbnail_id( $product->id );
303
 
304
- // Set the thumbnail (full img tag)
305
- $data['thumbnail'] = $product->get_image( 'shop_thumbnail', array( 'title' => '' ) );
 
 
 
 
 
 
 
 
 
306
 
307
  // Set the single price (turned off to use more consistent calculated price)
308
  // $data['single_price'] = woocommerce_price ( $product->get_price() );
79
  // if (!file_exists($template_wrapper)) echo 'Template wrapper not found! <pre>'.$template_wrapper.'</pre><br/>';
80
  // if (!file_exists($template)) echo 'Template not found! <pre>'.$template.'</pre><br/>';
81
  // die($complete_pdf); //output html to browser for debug
82
+ // NOTE! images will be loaded with the server path by default
83
+ // use the wpo_wcpdf_use_path filter (return false) to change this to http urls
84
 
85
  require_once( WooCommerce_PDF_Invoices::$plugin_path . "lib/dompdf/dompdf_config.inc.php" );
86
  $dompdf = new DOMPDF();
303
  // Set the thumbnail id
304
  $data['thumbnail_id'] = $this->get_thumbnail_id( $product->id );
305
 
306
+ // Set the thumbnail server path
307
+ $data['thumbnail_path'] = get_attached_file( $data['thumbnail_id'] );
308
+
309
+ // Thumbnail (full img tag)
310
+ if (apply_filters('wpo_wcpdf_use_path', true)) {
311
+ // load img with server path by default
312
+ $data['thumbnail'] = sprintf('<img width="90" height="90" src="%s" class="attachment-shop_thumbnail wp-post-image">', $data['thumbnail_path']);
313
+ } else {
314
+ // load img with http url when filtered
315
+ $data['thumbnail'] = $product->get_image( 'shop_thumbnail', array( 'title' => '' ) );
316
+ }
317
 
318
  // Set the single price (turned off to use more consistent calculated price)
319
  // $data['single_price'] = woocommerce_price ( $product->get_price() );
languages/wpo_wcpdf-de_DE.mo ADDED
Binary file
languages/wpo_wcpdf-de_DE.po ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WooCommerce PDF Invoices & Packing Slips\n"
4
+ "POT-Creation-Date: 2014-01-23 12:32+0100\n"
5
+ "PO-Revision-Date: 2014-01-28 20:08+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: WP Overnight <support@wpovernight.com>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.6.3\n"
12
+ "X-Poedit-Basepath: ../\n"
13
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;_x;_n:1,2\n"
16
+ "Language: de_DE\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: woocommerce-pdf-invoices-packingslips.php:96
20
+ #, php-format
21
+ msgid ""
22
+ "WooCommerce PDF Invoices & Packing Slips requires %sWooCommerce%s to be "
23
+ "installed & activated!"
24
+ msgstr "WooCommerce PDF Invoices & Packing Slips benötigt %sWooCommerce%s !"
25
+
26
+ #: woocommerce-pdf-invoices-packingslips.php:183
27
+ #: woocommerce-pdf-invoices-packingslips.php:219
28
+ msgid "N/A"
29
+ msgstr "N/A"
30
+
31
+ #: woocommerce-pdf-invoices-packingslips.php:320
32
+ msgid "Subtotal"
33
+ msgstr "Zwischensumme"
34
+
35
+ #: woocommerce-pdf-invoices-packingslips.php:338
36
+ msgid "Shipping"
37
+ msgstr "Versand"
38
+
39
+ #: woocommerce-pdf-invoices-packingslips.php:353
40
+ msgid "Discount"
41
+ msgstr "Rabatt"
42
+
43
+ #: woocommerce-pdf-invoices-packingslips.php:418
44
+ msgid "Total ex. VAT"
45
+ msgstr "Gesamtsumme ohne MwSt"
46
+
47
+ #: woocommerce-pdf-invoices-packingslips.php:421
48
+ msgid "Total"
49
+ msgstr "Gesamtsumme"
50
+
51
+ #: includes/class-wcpdf-export.php:98 includes/class-wcpdf-export.php:103
52
+ #: includes/class-wcpdf-export.php:108
53
+ msgid "You do not have sufficient permissions to access this page."
54
+ msgstr "Du hast keine Berechtigung diese Seite anzuzeigen."
55
+
56
+ # This is a filename (prefix). do not use spaces or special characters!
57
+ #: includes/class-wcpdf-export.php:115 includes/class-wcpdf-export.php:175
58
+ msgid "invoice"
59
+ msgid_plural "invoices"
60
+ msgstr[0] "Rechnung"
61
+ msgstr[1] "Rechnungen"
62
+
63
+ # This is a filename (prefix). do not use spaces or special characters!
64
+ #: includes/class-wcpdf-export.php:117
65
+ msgid "packing-slip"
66
+ msgid_plural "packing-slips"
67
+ msgstr[0] "Packzettel"
68
+ msgstr[1] "Packzettel"
69
+
70
+ #: includes/class-wcpdf-settings.php:36 includes/class-wcpdf-settings.php:37
71
+ #: includes/class-wcpdf-writepanels.php:115
72
+ #: includes/class-wcpdf-writepanels.php:116
73
+ msgid "PDF Invoices"
74
+ msgstr "PDF Rechnungen"
75
+
76
+ #: includes/class-wcpdf-settings.php:60
77
+ msgid "Settings"
78
+ msgstr "Einstellungen"
79
+
80
+ #: includes/class-wcpdf-settings.php:75
81
+ msgid "..."
82
+ msgstr "..."
83
+
84
+ #: includes/class-wcpdf-settings.php:86
85
+ msgid "WooCommerce PDF Invoices"
86
+ msgstr "WooCommerce PDF Rechnungen"
87
+
88
+ #: includes/class-wcpdf-settings.php:88
89
+ msgid "General"
90
+ msgstr "Allgemein"
91
+
92
+ #: includes/class-wcpdf-settings.php:89
93
+ msgid "Template"
94
+ msgstr "Vorlage"
95
+
96
+ #: includes/class-wcpdf-settings.php:97
97
+ #, php-format
98
+ msgid ""
99
+ "Looking for more advanced templates? Check out the Premium PDF Invoice & "
100
+ "Packing Slips templates at %s."
101
+ msgstr ""
102
+ "Suchst du weitere, forgeschrittenere Templates? Besuche die Premium PDF "
103
+ "Invoice & Packing Slips Templates auf %s."
104
+
105
+ #: includes/class-wcpdf-settings.php:151
106
+ msgid "General settings"
107
+ msgstr "Allgemeine Einstellungen"
108
+
109
+ #: includes/class-wcpdf-settings.php:158
110
+ msgid "How do you want to view the PDF?"
111
+ msgstr "Wie soll das PDF angezeigt werden?"
112
+
113
+ #: includes/class-wcpdf-settings.php:166
114
+ msgid "Download the PDF"
115
+ msgstr "PDF runterladen"
116
+
117
+ #: includes/class-wcpdf-settings.php:167
118
+ msgid "Open the PDF in a new browser tab/window"
119
+ msgstr "PDF in einem neuen Browser Tab/Fenster öffnen"
120
+
121
+ #: includes/class-wcpdf-settings.php:177
122
+ msgid "Email invoice (attach to order confirmation or invoice email)"
123
+ msgstr "Email-Rechnung (als Anhang zur Bestätigungsmail)"
124
+
125
+ #: includes/class-wcpdf-settings.php:184
126
+ #, php-format
127
+ msgid ""
128
+ "It looks like the temp folder (<code>%s</code>) is not writable, check the "
129
+ "permissions for this folder! Without having write access to this folder, the "
130
+ "plugin will not be able to email invoices."
131
+ msgstr ""
132
+ "Das temporäre Verzeichnis (<code>%s</code>) ist nicht beschreibbar, bitte "
133
+ "überprüfe die Berechtigungen dieses Verzeichnisses. Ohne Schreibrechte "
134
+ "können keine E-Mail - Rechnungen verschickt werden."
135
+
136
+ #: includes/class-wcpdf-settings.php:206
137
+ msgid "PDF Template settings"
138
+ msgstr "PDF Vorlageneinstellungen"
139
+
140
+ #: includes/class-wcpdf-settings.php:213
141
+ msgid "Choose a template"
142
+ msgstr "Wähle eine Vorlage"
143
+
144
+ #: includes/class-wcpdf-settings.php:221
145
+ msgid ""
146
+ "Want to use your own template? Copy all the files from <code>woocommerce-pdf-"
147
+ "invoices-packing-slips/templates/pdf/Simple/</code> to <code>yourtheme/"
148
+ "woocommerce/pdf/yourtemplate/</code> to customize them"
149
+ msgstr ""
150
+ "Wenn du eigene Vorlagen verwenden willst, dann kopiere alle Dateien von "
151
+ "<code>woocommerce-pdf-invoices-packing-slips/templates/pdf/Simple/</code> "
152
+ "nach <code>deinTheme/woocommerce/pdf/deineVorlage/</code> und passe sie dort "
153
+ "an."
154
+
155
+ #: includes/class-wcpdf-settings.php:227
156
+ msgid "Paper size"
157
+ msgstr "Papierformat"
158
+
159
+ #: includes/class-wcpdf-settings.php:235
160
+ msgid "A4"
161
+ msgstr "A4"
162
+
163
+ #: includes/class-wcpdf-settings.php:236
164
+ msgid "Letter"
165
+ msgstr "Letter (US)"
166
+
167
+ #: includes/class-wcpdf-settings.php:243
168
+ msgid "Shop header/logo"
169
+ msgstr "Briefkopf-Logo"
170
+
171
+ #: includes/class-wcpdf-settings.php:250
172
+ msgid "Select or upload your invoice header/logo"
173
+ msgstr "Auswählen oder hochladen des Logos"
174
+
175
+ #: includes/class-wcpdf-settings.php:251
176
+ msgid "Set image"
177
+ msgstr "Logo festlegen"
178
+
179
+ #: includes/class-wcpdf-settings.php:252
180
+ msgid "Remove image"
181
+ msgstr "Logo entfernen"
182
+
183
+ #: includes/class-wcpdf-settings.php:259
184
+ msgid "Shop Name"
185
+ msgstr "Shop Name"
186
+
187
+ #: includes/class-wcpdf-settings.php:272
188
+ msgid "Shop Address"
189
+ msgstr "Shop Adresse"
190
+
191
+ #: includes/class-wcpdf-settings.php:304
192
+ msgid "Footer: terms & conditions, policies, etc."
193
+ msgstr "Fußzeile: allgemeine Bestimmungen, etc."
194
+
195
+ #: includes/class-wcpdf-settings.php:320
196
+ msgid "Extra template fields"
197
+ msgstr "Zusätzliche Vorlagenfelder"
198
+
199
+ #: includes/class-wcpdf-settings.php:327
200
+ msgid "Extra field 1"
201
+ msgstr "Zusatzfeld 1"
202
+
203
+ #: includes/class-wcpdf-settings.php:336
204
+ msgid "This is footer column 1 in the <i>Modern (Premium)</i> template"
205
+ msgstr ""
206
+ "Das ist die Spalte 1 in der Fußzeile der <i>Modern (Premium)</i> Vorlage"
207
+
208
+ #: includes/class-wcpdf-settings.php:342
209
+ msgid "Extra field 2"
210
+ msgstr "Zusatzfeld 2"
211
+
212
+ #: includes/class-wcpdf-settings.php:351
213
+ msgid "This is footer column 2 in the <i>Modern (Premium)</i> template"
214
+ msgstr ""
215
+ "Das ist die Spalte 2 in der Fußzeile der <i>Modern (Premium)</i> Vorlage"
216
+
217
+ #: includes/class-wcpdf-settings.php:357
218
+ msgid "Extra field 3"
219
+ msgstr "Zusatzfeld 3"
220
+
221
+ #: includes/class-wcpdf-settings.php:366
222
+ msgid "This is footer column 3 in the <i>Modern (Premium)</i> template"
223
+ msgstr ""
224
+ "Das ist die Spalte 3 in der Fußzeile der <i>Modern (Premium)</i> Vorlage"
225
+
226
+ #: includes/class-wcpdf-settings.php:579
227
+ msgid "Image resolution"
228
+ msgstr "Bildauflösung"
229
+
230
+ #: includes/class-wcpdf-settings.php:609
231
+ msgid ""
232
+ "These are used for the (optional) footer columns in the <em>Modern "
233
+ "(Premium)</em> template, but can also be used for other elements in your "
234
+ "custom template"
235
+ msgstr ""
236
+ "Diese Felder werden in den Spalten der (optionalen) Fußzeile der <em>Modern "
237
+ "(Premium)</em> Vorlage verwendet, können aber auch für andere Elemente in "
238
+ "deiner angepassten Vorlage verwendet werden."
239
+
240
+ #: includes/class-wcpdf-writepanels.php:81
241
+ msgid "Create PDF"
242
+ msgstr "PDF Erzeugen"
243
+
244
+ #: includes/class-wcpdf-writepanels.php:87
245
+ msgid "Download invoice (PDF)"
246
+ msgstr "PDF Rechnung runterlaten"
247
+
248
+ #: includes/class-wcpdf-writepanels.php:100
249
+ msgid "PDF invoice"
250
+ msgstr "PDF Rechnung"
251
+
252
+ #: includes/class-wcpdf-writepanels.php:101
253
+ msgid "PDF Packing Slip"
254
+ msgstr "PDF Packliste"
255
+
256
+ #: includes/class-wcpdf-writepanels.php:117
257
+ #: includes/class-wcpdf-writepanels.php:118
258
+ msgid "PDF Packing Slips"
259
+ msgstr "PDF Packlisten"
260
+
261
+ #: templates/pdf/Simple/invoice.php:9 templates/pdf/Simple/invoice.php:21
262
+ msgid "Invoice"
263
+ msgstr "Rechnung"
264
+
265
+ #: templates/pdf/Simple/invoice.php:30
266
+ #: templates/pdf/Simple/packing-slip.php:30
267
+ msgid "Order Date:"
268
+ msgstr "Bestelldatum:"
269
+
270
+ #: templates/pdf/Simple/invoice.php:32
271
+ #: templates/pdf/Simple/packing-slip.php:32
272
+ msgid "Order Number:"
273
+ msgstr "Bestellnummer:"
274
+
275
+ #: templates/pdf/Simple/invoice.php:34
276
+ msgid "Payment Method:"
277
+ msgstr "Zahlungsart:"
278
+
279
+ #: templates/pdf/Simple/invoice.php:47
280
+ #: templates/pdf/Simple/packing-slip.php:45
281
+ msgid "Product"
282
+ msgstr "Produkt"
283
+
284
+ #: templates/pdf/Simple/invoice.php:48
285
+ #: templates/pdf/Simple/packing-slip.php:46
286
+ msgid "Quantity"
287
+ msgstr "Anzahl"
288
+
289
+ #: templates/pdf/Simple/invoice.php:49
290
+ msgid "Price"
291
+ msgstr "Preis"
292
+
293
+ #: templates/pdf/Simple/invoice.php:57
294
+ #: templates/pdf/Simple/packing-slip.php:54
295
+ msgid "SKU:"
296
+ msgstr "SKU:"
297
+
298
+ #: templates/pdf/Simple/invoice.php:58
299
+ #: templates/pdf/Simple/packing-slip.php:55
300
+ msgid "Weight:"
301
+ msgstr "Gewicht:"
302
+
303
+ #: templates/pdf/Simple/invoice.php:91
304
+ #: templates/pdf/Simple/packing-slip.php:69
305
+ msgid "Customer Notes"
306
+ msgstr "Kundenanmerkungen"
307
+
308
+ #: templates/pdf/Simple/packing-slip.php:9
309
+ #: templates/pdf/Simple/packing-slip.php:21
310
+ msgid "Packing Slip"
311
+ msgstr "Packliste"
lib/dompdf/.gitattributes DELETED
@@ -1,13 +0,0 @@
1
- *.json text
2
- *.xml text
3
- *.php text
4
- *.LGPL text
5
- *.md text
6
- *.skel text
7
- *.css text
8
- *.inc text
9
- *.js text
10
- *.html text
11
- *.txt text
12
- *.svg text
13
-
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/dompdf/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- .DS_Store
2
- composer.lock
3
- vendor
4
- .idea
5
- .project
6
- lib/fonts/*.afm.php
7
- lib/fonts/*.ufm.php
8
- lib/fonts/log.htm
 
 
 
 
 
 
 
 
lib/dompdf/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "lib/php-font-lib"]
2
- path = lib/php-font-lib
3
- url = https://github.com/PhenX/php-font-lib.git
 
 
 
lib/dompdf/CONTRIBUTING.md CHANGED
@@ -7,14 +7,12 @@
7
  ## Getting help
8
 
9
  Community discussion, questions, and informal bug reporting is done on the
10
- [dompdf Google group](http://groups.google.com/group/dompdf). You may also
11
- seek help on
12
- [StackOverflow](http://stackoverflow.com/questions/tagged/dompdf).
13
 
14
  ## Submitting bug reports
15
 
16
  The preferred way to report bugs is to use the
17
- [GitHub issue tracker](http://github.com/dompdf/dompdf/issues). Before
18
  reporting a bug, read these pointers.
19
 
20
  **Please search inside the bug tracker to see if the bug you found is not already reported.**
@@ -57,8 +55,7 @@ Questions should be asked on the
57
  - Make sure you have a [GitHub Account](https://github.com/signup/free)
58
  - Fork [dompdf](https://github.com/dompdf/dompdf/)
59
  ([how to fork a repo](https://help.github.com/articles/fork-a-repo))
60
- - *Make your changes on the dev branch* or the most appropriate feature branch. Please only patch
61
- the master branch if you are attempting to address an urgent bug in the released code.
62
  - Add a simple test file in `www/test/`, with a comprehensive name.
63
  - Submit a pull request
64
  ([how to create a pull request](https://help.github.com/articles/fork-a-repo))
@@ -73,4 +70,4 @@ if ( $foo == "bar" ) {
73
  }
74
  ```
75
  - booleans in lowercase
76
- - opening braces *always* on the same line
7
  ## Getting help
8
 
9
  Community discussion, questions, and informal bug reporting is done on the
10
+ [dompdf Google group](http://groups.google.com/group/dompdf).
 
 
11
 
12
  ## Submitting bug reports
13
 
14
  The preferred way to report bugs is to use the
15
+ [GitHub issue tracker](http://github.com/dompdf/dompdf/issues). Before
16
  reporting a bug, read these pointers.
17
 
18
  **Please search inside the bug tracker to see if the bug you found is not already reported.**
55
  - Make sure you have a [GitHub Account](https://github.com/signup/free)
56
  - Fork [dompdf](https://github.com/dompdf/dompdf/)
57
  ([how to fork a repo](https://help.github.com/articles/fork-a-repo))
58
+ - Make your changes
 
59
  - Add a simple test file in `www/test/`, with a comprehensive name.
60
  - Submit a pull request
61
  ([how to create a pull request](https://help.github.com/articles/fork-a-repo))
70
  }
71
  ```
72
  - booleans in lowercase
73
+ - opening braces *always* on the same line
lib/dompdf/dompdf_config.inc.php CHANGED
@@ -8,8 +8,6 @@
8
  * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
9
  */
10
 
11
- if ( class_exists( 'DOMPDF' , false ) ) { return; }
12
-
13
  //error_reporting(E_STRICT | E_ALL | E_DEPRECATED);
14
  //ini_set("display_errors", 1);
15
 
@@ -57,7 +55,7 @@ require_once(DOMPDF_INC_DIR . "/functions.inc.php");
57
  * Username and password used by the configuration utility in www/
58
  */
59
  def("DOMPDF_ADMIN_USERNAME", "user");
60
- def("DOMPDF_ADMIN_PASSWORD", "password");
61
 
62
  /**
63
  * The location of the DOMPDF font directory
@@ -197,7 +195,7 @@ def("DOMPDF_DEFAULT_MEDIA_TYPE", "screen");
197
  *
198
  * @see CPDF_Adapter::PAPER_SIZES for valid sizes
199
  */
200
- def("DOMPDF_DEFAULT_PAPER_SIZE", "letter");
201
 
202
  /**
203
  * The default font family
@@ -205,7 +203,7 @@ def("DOMPDF_DEFAULT_PAPER_SIZE", "letter");
205
  * Used if no suitable fonts can be found. This must exist in the font folder.
206
  * @var string
207
  */
208
- def("DOMPDF_DEFAULT_FONT", "serif");
209
 
210
  /**
211
  * Image DPI setting
@@ -331,7 +329,7 @@ require_once(DOMPDF_LIB_DIR . "/html5lib/Parser.php");
331
  */
332
  if (DOMPDF_ENABLE_AUTOLOAD) {
333
  require_once(DOMPDF_INC_DIR . "/autoload.inc.php");
334
- require_once(DOMPDF_LIB_DIR . "/php-font-lib/classes/Font.php");
335
  }
336
 
337
  /**
8
  * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
9
  */
10
 
 
 
11
  //error_reporting(E_STRICT | E_ALL | E_DEPRECATED);
12
  //ini_set("display_errors", 1);
13
 
55
  * Username and password used by the configuration utility in www/
56
  */
57
  def("DOMPDF_ADMIN_USERNAME", "user");
58
+ def("DOMPDF_ADMIN_PASSWORD", "wpovernight");
59
 
60
  /**
61
  * The location of the DOMPDF font directory
195
  *
196
  * @see CPDF_Adapter::PAPER_SIZES for valid sizes
197
  */
198
+ def("DOMPDF_DEFAULT_PAPER_SIZE", "a4");
199
 
200
  /**
201
  * The default font family
203
  * Used if no suitable fonts can be found. This must exist in the font folder.
204
  * @var string
205
  */
206
+ def("DOMPDF_DEFAULT_FONT", "sans-serif");
207
 
208
  /**
209
  * Image DPI setting
329
  */
330
  if (DOMPDF_ENABLE_AUTOLOAD) {
331
  require_once(DOMPDF_INC_DIR . "/autoload.inc.php");
332
+ require_once(DOMPDF_LIB_DIR . "/php-font-lib/classes/font.cls.php");
333
  }
334
 
335
  /**
lib/dompdf/include/css_color.cls.php CHANGED
@@ -193,7 +193,7 @@ class CSS_Color {
193
  return $cache[$color] = self::getArray(mb_substr($color, 1, 6));
194
  }
195
 
196
- // rgb( r,g,b ) / rgbaa( r,g,b,α ) format
197
  else if ( mb_strpos($color, "rgb") !== false ) {
198
  $i = mb_strpos($color, "(");
199
  $j = mb_strpos($color, ")");
@@ -204,18 +204,7 @@ class CSS_Color {
204
  }
205
 
206
  $triplet = explode(",", mb_substr($color, $i+1, $j-$i-1));
207
-
208
- // alpha transparency
209
- // FIXME: not currently using transparency
210
- $alpha = 1;
211
- if ( count( $triplet ) == 4 ) {
212
- $alpha = (float) ( trim( array_pop( $triplet ) ) );
213
- // bad value, set to fully opaque
214
- if ( $alpha > 1 || $alpha < 0 ) {
215
- $alpha = 1;
216
- }
217
- }
218
-
219
  if ( count($triplet) != 3 ) {
220
  return null;
221
  }
193
  return $cache[$color] = self::getArray(mb_substr($color, 1, 6));
194
  }
195
 
196
+ // rgb( r,g,b ) format
197
  else if ( mb_strpos($color, "rgb") !== false ) {
198
  $i = mb_strpos($color, "(");
199
  $j = mb_strpos($color, ")");
204
  }
205
 
206
  $triplet = explode(",", mb_substr($color, $i+1, $j-$i-1));
207
+
 
 
 
 
 
 
 
 
 
 
 
208
  if ( count($triplet) != 3 ) {
209
  return null;
210
  }
lib/dompdf/include/dompdf.cls.php CHANGED
@@ -621,14 +621,9 @@ class DOMPDF {
621
  $quirksmode = ($tokenizer->getTree()->getQuirksMode() > HTML5_TreeBuilder::NO_QUIRKS);
622
  }
623
  else {
624
- // loadHTML assumes ISO-8859-1 unless otherwise specified, but there are
625
- // bugs in how DOMDocument determines the actual encoding. Converting to
626
- // HTML-ENTITIES prior to import appears to resolve the issue.
627
- // http://devzone.zend.com/1538/php-dom-xml-extension-encoding-processing/ (see #4)
628
- // http://stackoverflow.com/a/11310258/264628
629
  $doc = new DOMDocument();
630
  $doc->preserveWhiteSpace = true;
631
- $doc->loadHTML( mb_convert_encoding( $str , 'HTML-ENTITIES' , 'UTF-8' ) );
632
 
633
  // If some text is before the doctype, we are in quirksmode
634
  if ( preg_match("/^(.+)<!doctype/i", ltrim($str), $matches) ) {
@@ -888,25 +883,8 @@ class DOMPDF {
888
  $this->_pdf->register_string_subset($style->font_family, $chars);
889
  continue;
890
  }
891
-
892
- // Handle other generated content (pseudo elements)
893
- // FIXME: This only captures the text of the stylesheet declaration,
894
- // not the actual generated content, and forces all possible counter
895
- // values. See notes in issue #750.
896
- if ( $frame->get_node()->nodeName == "dompdf_generated" ) {
897
- // all possible counter values
898
- $chars = List_Bullet_Renderer::get_counter_chars('decimal');
899
- $this->_pdf->register_string_subset($style->font_family, $chars);
900
- $chars = List_Bullet_Renderer::get_counter_chars('upper-alpha');
901
- $this->_pdf->register_string_subset($style->font_family, $chars);
902
- $chars = List_Bullet_Renderer::get_counter_chars('lower-alpha');
903
- $this->_pdf->register_string_subset($style->font_family, $chars);
904
- $chars = List_Bullet_Renderer::get_counter_chars('lower-greek');
905
- $this->_pdf->register_string_subset($style->font_family, $chars);
906
- // the text of the stylesheet declaration
907
- $this->_pdf->register_string_subset($style->font_family, $style->content);
908
- continue;
909
- }
910
  }
911
  }
912
 
621
  $quirksmode = ($tokenizer->getTree()->getQuirksMode() > HTML5_TreeBuilder::NO_QUIRKS);
622
  }
623
  else {
 
 
 
 
 
624
  $doc = new DOMDocument();
625
  $doc->preserveWhiteSpace = true;
626
+ $doc->loadHTML($str);
627
 
628
  // If some text is before the doctype, we are in quirksmode
629
  if ( preg_match("/^(.+)<!doctype/i", ltrim($str), $matches) ) {
883
  $this->_pdf->register_string_subset($style->font_family, $chars);
884
  continue;
885
  }
886
+
887
+ // TODO Handle other generated content (pseudo elements)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
888
  }
889
  }
890
 
lib/dompdf/include/frame.cls.php CHANGED
@@ -845,7 +845,7 @@ class Frame {
845
  $this->append_child($new_child, $update_node);
846
  return;
847
  }
848
-
849
  if ( is_null($ref) ) {
850
  $this->prepend_child($new_child, $update_node);
851
  return;
845
  $this->append_child($new_child, $update_node);
846
  return;
847
  }
848
+
849
  if ( is_null($ref) ) {
850
  $this->prepend_child($new_child, $update_node);
851
  return;
lib/dompdf/include/frame_decorator.cls.php CHANGED
@@ -129,11 +129,11 @@ abstract class Frame_Decorator extends Frame {
129
  $frame->set_style(clone $this->_frame->get_original_style());
130
 
131
  $deco = Frame_Factory::decorate_frame($frame, $this->_dompdf, $this->_root);
132
-
133
  foreach ($this->get_children() as $child) {
134
  $deco->append_child($child->deep_copy());
135
  }
136
-
137
  return $deco;
138
  }
139
 
@@ -144,7 +144,7 @@ abstract class Frame_Decorator extends Frame {
144
  $this->_frame->reset();
145
 
146
  $this->_counters = array();
147
-
148
  // Reset all children
149
  foreach ($this->get_children() as $child) {
150
  $child->reset();
@@ -540,34 +540,15 @@ abstract class Frame_Decorator extends Frame {
540
  * @return void
541
  */
542
  function split(Frame $child = null, $force_pagebreak = false) {
543
- // decrement any counters that were incremented on the current node, unless that node is the body
544
- $style = $this->_frame->get_style();
545
- if ( $this->_frame->get_node()->nodeName !== "body" && $style->counter_increment && ($decrement = $style->counter_increment) !== "none" ) {
546
- $this->decrement_counters($decrement);
547
- }
548
-
549
  if ( is_null( $child ) ) {
550
- // check for counter increment on :before content (always a child of the selected element @link Frame_Reflower::_set_content)
551
- // this can push the current node to the next page before counter rules have bubbled up (but only if
552
- // it's been rendered, thus the position check)
553
- if ( !$this->is_text_node() && $this->get_node()->hasAttribute("dompdf_before_frame_id") ) {
554
- foreach($this->_frame->get_children() as $child) {
555
- if ( $this->get_node()->getAttribute("dompdf_before_frame_id") == $child->get_id() && $child->get_position('x') !== NULL ) {
556
- $style = $child->get_style();
557
- if ( $style->counter_increment && ($decrement = $style->counter_increment) !== "none" ) {
558
- $this->decrement_counters($decrement);
559
- }
560
- }
561
- }
562
- }
563
  $this->get_parent()->split($this, $force_pagebreak);
564
  return;
565
  }
566
-
567
  if ( $child->get_parent() !== $this ) {
568
  throw new DOMPDF_Exception("Unable to split: frame is not a child of this one.");
569
  }
570
-
571
  $node = $this->_frame->get_node();
572
 
573
  $split = $this->copy( $node->cloneNode() );
@@ -592,35 +573,23 @@ abstract class Frame_Decorator extends Frame {
592
  }
593
 
594
  $this->get_parent()->insert_child_after($split, $this);
595
-
596
  // Add $frame and all following siblings to the new split node
597
  $iter = $child;
598
  while ($iter) {
599
- $frame = $iter;
600
  $iter = $iter->get_next_sibling();
601
  $frame->reset();
602
  $split->append_child($frame);
603
  }
604
-
605
  $this->get_parent()->split($split, $force_pagebreak);
606
-
607
- // If this node resets a counter save the current value to use when rendering on the next page
608
- if ( $style->counter_reset && ( $reset = $style->counter_reset ) !== "none" ) {
609
- $vars = preg_split( '/\s+/' , trim( $reset ) , 2 );
610
- $split->_counters[ '__' . $vars[0] ] = $this->lookup_counter_frame( $vars[0] )->_counters[$vars[0]];
611
- }
612
  }
613
 
614
  function reset_counter($id = self::DEFAULT_COUNTER, $value = 0) {
615
  $this->get_parent()->_counters[$id] = intval($value);
616
  }
617
 
618
- function decrement_counters($counters) {
619
- foreach($counters as $id => $increment) {
620
- $this->increment_counter($id, intval($increment) * -1);
621
- }
622
- }
623
-
624
  function increment_counters($counters) {
625
  foreach($counters as $id => $increment) {
626
  $this->increment_counter($id, intval($increment));
129
  $frame->set_style(clone $this->_frame->get_original_style());
130
 
131
  $deco = Frame_Factory::decorate_frame($frame, $this->_dompdf, $this->_root);
132
+
133
  foreach ($this->get_children() as $child) {
134
  $deco->append_child($child->deep_copy());
135
  }
136
+
137
  return $deco;
138
  }
139
 
144
  $this->_frame->reset();
145
 
146
  $this->_counters = array();
147
+
148
  // Reset all children
149
  foreach ($this->get_children() as $child) {
150
  $child->reset();
540
  * @return void
541
  */
542
  function split(Frame $child = null, $force_pagebreak = false) {
 
 
 
 
 
 
543
  if ( is_null( $child ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
544
  $this->get_parent()->split($this, $force_pagebreak);
545
  return;
546
  }
547
+
548
  if ( $child->get_parent() !== $this ) {
549
  throw new DOMPDF_Exception("Unable to split: frame is not a child of this one.");
550
  }
551
+
552
  $node = $this->_frame->get_node();
553
 
554
  $split = $this->copy( $node->cloneNode() );
573
  }
574
 
575
  $this->get_parent()->insert_child_after($split, $this);
576
+
577
  // Add $frame and all following siblings to the new split node
578
  $iter = $child;
579
  while ($iter) {
580
+ $frame = $iter;
581
  $iter = $iter->get_next_sibling();
582
  $frame->reset();
583
  $split->append_child($frame);
584
  }
585
+
586
  $this->get_parent()->split($split, $force_pagebreak);
 
 
 
 
 
 
587
  }
588
 
589
  function reset_counter($id = self::DEFAULT_COUNTER, $value = 0) {
590
  $this->get_parent()->_counters[$id] = intval($value);
591
  }
592
 
 
 
 
 
 
 
593
  function increment_counters($counters) {
594
  foreach($counters as $id => $increment) {
595
  $this->increment_counter($id, intval($increment));
lib/dompdf/include/frame_reflower.cls.php CHANGED
@@ -328,15 +328,16 @@ abstract class Frame_Reflower {
328
  if ( strtolower( $args[1] ) == 'counter' ) {
329
  // counter(name [,style])
330
  if ( isset( $args[5] ) ) {
331
- $type = trim( $args[5] );
332
  }
333
  else {
334
  $type = null;
335
  }
 
336
  $p = $this->_frame->lookup_counter_frame( $counter_id );
337
 
338
  $text .= $p->counter_value($counter_id, $type);
339
-
340
  }
341
  else if ( strtolower( $args[1] ) == 'counters' ) {
342
  // counters(name, string [,style])
@@ -346,32 +347,34 @@ abstract class Frame_Reflower {
346
  else {
347
  $string = "";
348
  }
349
-
350
  if ( isset( $args[7] ) ) {
351
  $type = trim( $args[7] );
352
  }
353
  else {
354
  $type = null;
355
  }
356
-
357
  $p = $this->_frame->lookup_counter_frame($counter_id);
358
  $tmp = array();
359
  while ($p) {
360
- // We only want to use the counter values when they actually increment the counter
361
- if ( array_key_exists( $counter_id , $p->_counters ) ) {
 
 
362
  array_unshift( $tmp , $p->counter_value($counter_id, $type) );
363
  }
364
  $p = $p->lookup_counter_frame($counter_id);
365
 
366
  }
367
  $text .= implode( $string , $tmp );
368
-
369
  }
370
  else {
371
  // countertops?
372
  continue;
373
  }
374
-
375
  }
376
  else if ( isset($match[4]) && $match[4] !== "" ) {
377
  // String match
@@ -413,7 +416,7 @@ abstract class Frame_Reflower {
413
  }
414
  }
415
  }
416
-
417
  return $text;
418
  }
419
 
@@ -424,10 +427,9 @@ abstract class Frame_Reflower {
424
  $frame = $this->_frame;
425
  $style = $frame->get_style();
426
 
427
- // if the element was pushed to a new page use the saved counter value, otherwise use the CSS reset value
428
  if ( $style->counter_reset && ($reset = $style->counter_reset) !== "none" ) {
429
  $vars = preg_split('/\s+/', trim($reset), 2);
430
- $frame->reset_counter( $vars[0] , ( isset($frame->_counters['__'.$vars[0]]) ? $frame->_counters['__'.$vars[0]] : ( isset($vars[1]) ? $vars[1] : 0 ) ) );
431
  }
432
 
433
  if ( $style->counter_increment && ($increment = $style->counter_increment) !== "none" ) {
@@ -436,13 +438,6 @@ abstract class Frame_Reflower {
436
 
437
  if ( $style->content && !$frame->get_first_child() && $frame->get_node()->nodeName === "dompdf_generated" ) {
438
  $content = $this->_parse_content();
439
- // add generated content to the font subset
440
- // FIXME: This is currently too late because the font subset has already been generated.
441
- // See notes in issue #750.
442
- if ( $frame->get_dompdf()->get_option("enable_font_subsetting") && $frame->get_dompdf()->get_canvas() instanceof CPDF_Adapter ) {
443
- $frame->get_dompdf()->get_canvas()->register_string_subset($style->font_family, $content);
444
- }
445
-
446
  $node = $frame->get_node()->ownerDocument->createTextNode($content);
447
 
448
  $new_style = $style->get_stylesheet()->create_style();
328
  if ( strtolower( $args[1] ) == 'counter' ) {
329
  // counter(name [,style])
330
  if ( isset( $args[5] ) ) {
331
+ $type = trim( $args[1] );
332
  }
333
  else {
334
  $type = null;
335
  }
336
+
337
  $p = $this->_frame->lookup_counter_frame( $counter_id );
338
 
339
  $text .= $p->counter_value($counter_id, $type);
340
+
341
  }
342
  else if ( strtolower( $args[1] ) == 'counters' ) {
343
  // counters(name, string [,style])
347
  else {
348
  $string = "";
349
  }
350
+
351
  if ( isset( $args[7] ) ) {
352
  $type = trim( $args[7] );
353
  }
354
  else {
355
  $type = null;
356
  }
357
+
358
  $p = $this->_frame->lookup_counter_frame($counter_id);
359
  $tmp = array();
360
  while ($p) {
361
+ // We only want to use the counter values when they actually increment the counter,
362
+ // elements that reset the counter, but do not increment it, are skipped.
363
+ // FIXME: Is this the best method of determining that an element's counter value should be displayed?
364
+ if ( array_key_exists( $counter_id , $p->_counters ) && $p->get_frame()->get_style()->counter_reset == 'none' ) {
365
  array_unshift( $tmp , $p->counter_value($counter_id, $type) );
366
  }
367
  $p = $p->lookup_counter_frame($counter_id);
368
 
369
  }
370
  $text .= implode( $string , $tmp );
371
+
372
  }
373
  else {
374
  // countertops?
375
  continue;
376
  }
377
+
378
  }
379
  else if ( isset($match[4]) && $match[4] !== "" ) {
380
  // String match
416
  }
417
  }
418
  }
419
+
420
  return $text;
421
  }
422
 
427
  $frame = $this->_frame;
428
  $style = $frame->get_style();
429
 
 
430
  if ( $style->counter_reset && ($reset = $style->counter_reset) !== "none" ) {
431
  $vars = preg_split('/\s+/', trim($reset), 2);
432
+ $frame->reset_counter($vars[0], isset($vars[1]) ? $vars[1] : 0);
433
  }
434
 
435
  if ( $style->counter_increment && ($increment = $style->counter_increment) !== "none" ) {
438
 
439
  if ( $style->content && !$frame->get_first_child() && $frame->get_node()->nodeName === "dompdf_generated" ) {
440
  $content = $this->_parse_content();
 
 
 
 
 
 
 
441
  $node = $frame->get_node()->ownerDocument->createTextNode($content);
442
 
443
  $new_style = $style->get_stylesheet()->create_style();
lib/dompdf/include/frame_tree.cls.php CHANGED
@@ -227,15 +227,13 @@ class Frame_Tree {
227
  $parent_id = $node->getAttribute("frame_id");
228
  $parent = $this->get_frame($parent_id);
229
 
230
- if ( $parent ) {
231
- if ( $pos === "before" ) {
232
- $parent->prepend_child($frame, false);
233
- }
234
- else {
235
- $parent->append_child($frame, false);
236
- }
237
  }
238
-
 
 
 
239
  return $frame_id;
240
  }
241
  }
227
  $parent_id = $node->getAttribute("frame_id");
228
  $parent = $this->get_frame($parent_id);
229
 
230
+ if ( $pos === "before" ) {
231
+ $parent->prepend_child($frame, false);
 
 
 
 
 
232
  }
233
+ else {
234
+ $parent->append_child($frame, false);
235
+ }
236
+
237
  return $frame_id;
238
  }
239
  }
lib/dompdf/include/functions.inc.php CHANGED
@@ -344,121 +344,93 @@ function parse_data_uri($data_uri) {
344
  /**
345
  * mb_string compatibility
346
  */
347
- if (!extension_loaded('mbstring')) {
348
- def('MB_OVERLOAD_MAIL', 1);
349
- def('MB_OVERLOAD_STRING', 2);
350
- def('MB_OVERLOAD_REGEX', 4);
351
- def('MB_CASE_UPPER', 0);
352
- def('MB_CASE_LOWER', 1);
353
- def('MB_CASE_TITLE', 2);
354
-
355
- if (!function_exists('mb_convert_encoding')) {
356
- function mb_convert_encoding($data, $to_encoding, $from_encoding = 'UTF-8') {
357
- if (str_replace('-', '', strtolower($to_encoding)) === 'utf8') {
358
- return utf8_encode($data);
359
- }
360
-
361
- return utf8_decode($data);
362
  }
 
 
363
  }
364
 
365
- if (!function_exists('mb_detect_encoding')) {
366
- function mb_detect_encoding($data, $encoding_list = array('iso-8859-1'), $strict = false) {
367
- return 'iso-8859-1';
368
- }
369
  }
370
 
371
- if (!function_exists('mb_detect_order')) {
372
- function mb_detect_order($encoding_list = array('iso-8859-1')) {
373
- return 'iso-8859-1';
374
- }
375
  }
376
 
377
- if (!function_exists('mb_internal_encoding')) {
378
- function mb_internal_encoding($encoding = null) {
379
- if (isset($encoding)) {
380
- return true;
381
- }
382
-
383
- return 'iso-8859-1';
384
  }
 
 
385
  }
386
 
387
- if (!function_exists('mb_strlen')) {
388
- function mb_strlen($str, $encoding = 'iso-8859-1') {
389
- switch (str_replace('-', '', strtolower($encoding))) {
390
- case "utf8": return strlen(utf8_encode($str));
391
- case "8bit": return strlen($str);
392
- default: return strlen(utf8_decode($str));
393
- }
394
  }
395
  }
396
 
397
- if (!function_exists('mb_strpos')) {
398
- function mb_strpos($haystack, $needle, $offset = 0) {
399
- return strpos($haystack, $needle, $offset);
400
- }
401
  }
402
 
403
- if (!function_exists('mb_strrpos')) {
404
- function mb_strrpos($haystack, $needle, $offset = 0) {
405
- return strrpos($haystack, $needle, $offset);
406
- }
407
  }
408
 
409
- if (!function_exists('mb_strtolower')) {
410
- function mb_strtolower( $str ) {
411
- return strtolower($str);
412
- }
413
  }
414
 
415
- if (!function_exists('mb_strtoupper')) {
416
- function mb_strtoupper( $str ) {
417
- return strtoupper($str);
418
- }
419
  }
420
 
421
- if (!function_exists('mb_substr')) {
422
- function mb_substr($string, $start, $length = null, $encoding = 'iso-8859-1') {
423
- if ( is_null($length) ) {
424
- return substr($string, $start);
425
- }
426
-
427
- return substr($string, $start, $length);
428
  }
 
 
429
  }
430
 
431
- if (!function_exists('mb_substr_count')) {
432
- function mb_substr_count($haystack, $needle, $encoding = 'iso-8859-1') {
433
- return substr_count($haystack, $needle);
434
- }
435
  }
436
 
437
- if (!function_exists('mb_encode_numericentity')) {
438
- function mb_encode_numericentity($str, $convmap, $encoding) {
439
- return htmlspecialchars($str);
440
- }
441
  }
442
 
443
- if (!function_exists('mb_convert_case')) {
444
- function mb_convert_case($str, $mode = MB_CASE_UPPER, $encoding = array()) {
445
- switch($mode) {
446
- case MB_CASE_UPPER: return mb_strtoupper($str);
447
- case MB_CASE_LOWER: return mb_strtolower($str);
448
- case MB_CASE_TITLE: return ucwords(mb_strtolower($str));
449
- default: return $str;
450
- }
451
  }
452
  }
453
 
454
- if (!function_exists('mb_list_encodings')) {
455
- function mb_list_encodings() {
456
- return array(
457
- "ISO-8859-1",
458
- "UTF-8",
459
- "8bit",
460
- );
461
- }
462
  }
463
  }
464
 
344
  /**
345
  * mb_string compatibility
346
  */
347
+ if ( !function_exists("mb_strlen") ) {
348
+ define('MB_OVERLOAD_MAIL', 1);
349
+ define('MB_OVERLOAD_STRING', 2);
350
+ define('MB_OVERLOAD_REGEX', 4);
351
+ define('MB_CASE_UPPER', 0);
352
+ define('MB_CASE_LOWER', 1);
353
+ define('MB_CASE_TITLE', 2);
354
+
355
+ function mb_convert_encoding($data, $to_encoding, $from_encoding = 'UTF-8') {
356
+ if (str_replace('-', '', strtolower($to_encoding)) === 'utf8') {
357
+ return utf8_encode($data);
 
 
 
 
358
  }
359
+
360
+ return utf8_decode($data);
361
  }
362
 
363
+ function mb_detect_encoding($data, $encoding_list = array('iso-8859-1'), $strict = false) {
364
+ return 'iso-8859-1';
 
 
365
  }
366
 
367
+ function mb_detect_order($encoding_list = array('iso-8859-1')) {
368
+ return 'iso-8859-1';
 
 
369
  }
370
 
371
+ function mb_internal_encoding($encoding = null) {
372
+ if (isset($encoding)) {
373
+ return true;
 
 
 
 
374
  }
375
+
376
+ return 'iso-8859-1';
377
  }
378
 
379
+ function mb_strlen($str, $encoding = 'iso-8859-1') {
380
+ switch (str_replace('-', '', strtolower($encoding))) {
381
+ case "utf8": return strlen(utf8_encode($str));
382
+ case "8bit": return strlen($str);
383
+ default: return strlen(utf8_decode($str));
 
 
384
  }
385
  }
386
 
387
+ function mb_strpos($haystack, $needle, $offset = 0) {
388
+ return strpos($haystack, $needle, $offset);
 
 
389
  }
390
 
391
+ function mb_strrpos($haystack, $needle, $offset = 0) {
392
+ return strrpos($haystack, $needle, $offset);
 
 
393
  }
394
 
395
+ function mb_strtolower( $str ) {
396
+ return strtolower($str);
 
 
397
  }
398
 
399
+ function mb_strtoupper( $str ) {
400
+ return strtoupper($str);
 
 
401
  }
402
 
403
+ function mb_substr($string, $start, $length = null, $encoding = 'iso-8859-1') {
404
+ if ( is_null($length) ) {
405
+ return substr($string, $start);
 
 
 
 
406
  }
407
+
408
+ return substr($string, $start, $length);
409
  }
410
 
411
+ function mb_substr_count($haystack, $needle, $encoding = 'iso-8859-1') {
412
+ return substr_count($haystack, $needle);
 
 
413
  }
414
 
415
+ function mb_encode_numericentity($str, $convmap, $encoding) {
416
+ return htmlspecialchars($str);
 
 
417
  }
418
 
419
+ function mb_convert_case($str, $mode = MB_CASE_UPPER, $encoding = array()) {
420
+ switch($mode) {
421
+ case MB_CASE_UPPER: return mb_strtoupper($str);
422
+ case MB_CASE_LOWER: return mb_strtolower($str);
423
+ case MB_CASE_TITLE: return ucwords(mb_strtolower($str));
424
+ default: return $str;
 
 
425
  }
426
  }
427
 
428
+ function mb_list_encodings() {
429
+ return array(
430
+ "ISO-8859-1",
431
+ "UTF-8",
432
+ "8bit",
433
+ );
 
 
434
  }
435
  }
436
 
lib/dompdf/include/style.cls.php CHANGED
@@ -868,7 +868,7 @@ class Style {
868
  $this->_parent_font_size = self::$default_font_size;
869
  }
870
 
871
- switch ((string)$fs) {
872
  case "xx-small":
873
  case "x-small":
874
  case "small":
868
  $this->_parent_font_size = self::$default_font_size;
869
  }
870
 
871
+ switch ($fs) {
872
  case "xx-small":
873
  case "x-small":
874
  case "small":
lib/dompdf/include/stylesheet.cls.php CHANGED
@@ -816,8 +816,8 @@ class Stylesheet {
816
 
817
  $query = $this->_css_selector_to_xpath($selector, true);
818
 
819
- // Retrieve the nodes, limit to body for generated content
820
- $nodes = @$xp->query( '.'.$query["query"] );
821
  if ( $nodes == null ) {
822
  record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
823
  continue;
@@ -839,6 +839,7 @@ class Stylesheet {
839
  }
840
 
841
  $new_node->setAttribute($pos, $pos);
 
842
  $new_frame_id = $tree->insert_node($node, $new_node, $pos);
843
  $node->setAttribute("dompdf_{$pos}_frame_id", $new_frame_id);
844
  }
816
 
817
  $query = $this->_css_selector_to_xpath($selector, true);
818
 
819
+ // Retrieve the nodes
820
+ $nodes = @$xp->query($query["query"]);
821
  if ( $nodes == null ) {
822
  record_warnings(E_USER_WARNING, "The CSS selector '$selector' is not valid", __FILE__, __LINE__);
823
  continue;
839
  }
840
 
841
  $new_node->setAttribute($pos, $pos);
842
+
843
  $new_frame_id = $tree->insert_node($node, $new_node, $pos);
844
  $node->setAttribute("dompdf_{$pos}_frame_id", $new_frame_id);
845
  }
lib/dompdf/include/text_frame_decorator.cls.php CHANGED
@@ -86,7 +86,7 @@ class Text_Frame_Decorator extends Frame_Decorator {
86
  pre_r(($style->line_height / $size) * Font_Metrics::get_font_height($font, $size));
87
  */
88
 
89
- return ($style->line_height / ( $size > 0 ? $size : 1 )) * Font_Metrics::get_font_height($font, $size);
90
 
91
  }
92
 
86
  pre_r(($style->line_height / $size) * Font_Metrics::get_font_height($font, $size));
87
  */
88
 
89
+ return ($style->line_height / $size) * Font_Metrics::get_font_height($font, $size);
90
 
91
  }
92
 
lib/dompdf/lib/class.pdf.php CHANGED
@@ -2335,7 +2335,6 @@ EOT;
2335
  // load the pfb file, and put that into an object too.
2336
  // note that pdf supports only binary format type 1 font files, though there is a
2337
  // simple utility to convert them from pfa to pfb.
2338
- // FIXME: should we move font subset creation to CPDF::output? See notes in issue #750.
2339
  if (!$this->isUnicode || $fbtype !== 'ttf' || empty($this->stringSubsets)) {
2340
  $data = file_get_contents($fbfile);
2341
  }
@@ -3492,7 +3491,7 @@ EOT;
3492
 
3493
  /**
3494
  * calculate how wide a given text string will be on a page, at a given size.
3495
- * this can be called externally, but is also used by the other class functions
3496
  */
3497
  function getTextWidth($size, $text, $word_spacing = 0, $char_spacing = 0) {
3498
  static $ord_cache = array();
@@ -3516,7 +3515,7 @@ EOT;
3516
  $w = 0;
3517
  $cf = $this->currentFont;
3518
  $current_font = $this->fonts[$cf];
3519
- $space_scale = 1000 / ( $size > 0 ? $size : 1 );
3520
  $n_spaces = 0;
3521
 
3522
  if ( $current_font['isUnicode']) {
2335
  // load the pfb file, and put that into an object too.
2336
  // note that pdf supports only binary format type 1 font files, though there is a
2337
  // simple utility to convert them from pfa to pfb.
 
2338
  if (!$this->isUnicode || $fbtype !== 'ttf' || empty($this->stringSubsets)) {
2339
  $data = file_get_contents($fbfile);
2340
  }
3491
 
3492
  /**
3493
  * calculate how wide a given text string will be on a page, at a given size.
3494
+ * this can be called externally, but is alse used by the other class functions
3495
  */
3496
  function getTextWidth($size, $text, $word_spacing = 0, $char_spacing = 0) {
3497
  static $ord_cache = array();
3515
  $w = 0;
3516
  $cf = $this->currentFont;
3517
  $current_font = $this->fonts[$cf];
3518
+ $space_scale = 1000 / $size;
3519
  $n_spaces = 0;
3520
 
3521
  if ( $current_font['isUnicode']) {
lib/dompdf/lib/php-font-lib/classes/Font_Glyph_Outline.php CHANGED
@@ -7,6 +7,9 @@
7
  * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $
8
  */
9
 
 
 
 
10
  /**
11
  * `glyf` font table.
12
  *
@@ -101,7 +104,4 @@ class Font_Glyph_Outline extends Font_Binary_Stream {
101
  function getGlyphIDs(){
102
  return array();
103
  }
104
- }
105
-
106
- require_once dirname(__FILE__) . "/Font_Glyph_Outline_Simple.php";
107
- require_once dirname(__FILE__) . "/Font_Glyph_Outline_Composite.php";
7
  * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $
8
  */
9
 
10
+ require_once dirname(__FILE__) . "/Font_Glyph_Outline_Simple.php";
11
+ require_once dirname(__FILE__) . "/Font_Glyph_Outline_Composite.php";
12
+
13
  /**
14
  * `glyf` font table.
15
  *
104
  function getGlyphIDs(){
105
  return array();
106
  }
107
+ }
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: pomegranate
3
  Tags: woocommerce, print, pdf, bulk, packing slips, invoices, delivery notes, invoice, packing slip, export, email
4
  Requires at least: 3.5 and WooCommerce 2.0
5
  Tested up to: 3.8 and WooCommerce 2.1
6
- Stable tag: 1.1.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -17,6 +17,7 @@ This WooCommerce extension automatically adds a PDF invoice to the order confirm
17
  * Export invoices or packing slips to PDF (individually or in bulk)
18
  * Automatically attach invoice PDF to order confirmation email
19
  * Users can download their invoices from the My Account page
 
20
 
21
  = Fully customizable =
22
  In addition to a number of default settings (including a custom header/logo) and several layout fields that you can use out of the box, the plugin contains HTML/CSS based templates that allow for customization & full control over the PDF output.
@@ -83,6 +84,10 @@ This usually only happens on batch actions. PDF creation is a memory intensive j
83
 
84
  == Changelog ==
85
 
 
 
 
 
86
  = 1.1.4 =
87
  * Fix: Template paths on windows servers were not properly saved (stripslashes), resulting in an empty output.
88
 
3
  Tags: woocommerce, print, pdf, bulk, packing slips, invoices, delivery notes, invoice, packing slip, export, email
4
  Requires at least: 3.5 and WooCommerce 2.0
5
  Tested up to: 3.8 and WooCommerce 2.1
6
+ Stable tag: 1.1.5
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
17
  * Export invoices or packing slips to PDF (individually or in bulk)
18
  * Automatically attach invoice PDF to order confirmation email
19
  * Users can download their invoices from the My Account page
20
+ * Available in: Dutch, English, French, German, Italian & Spanish
21
 
22
  = Fully customizable =
23
  In addition to a number of default settings (including a custom header/logo) and several layout fields that you can use out of the box, the plugin contains HTML/CSS based templates that allow for customization & full control over the PDF output.
84
 
85
  == Changelog ==
86
 
87
+ = 1.1.5 =
88
+ * Feature: German translations added - thanks Christian!
89
+ * Fix: dompdf 0.6.0 proved to be less stable, so switching back to beta3 for now.
90
+
91
  = 1.1.4 =
92
  * Fix: Template paths on windows servers were not properly saved (stripslashes), resulting in an empty output.
93
 
woocommerce-pdf-invoices-packingslips.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: http://www.wpovernight.com
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
- * Version: 1.1.4
7
  * Author: Ewout Fernhout
8
  * Author URI: http://www.wpovernight.com
9
  * License: GPLv2 or later
3
  * Plugin Name: WooCommerce PDF Invoices & Packing Slips
4
  * Plugin URI: http://www.wpovernight.com
5
  * Description: Create, print & email PDF invoices & packing slips for WooCommerce orders.
6
+ * Version: 1.1.5
7
  * Author: Ewout Fernhout
8
  * Author URI: http://www.wpovernight.com
9
  * License: GPLv2 or later