Changes for page Print-Service-Plugin


From version 10.1
edited by awa
on 14.06.2022, 13:52
Change comment: Add changelog
To version 11.12
edited by awa
on 23.06.2023, 17:04
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -12,19 +12,17 @@
12 12  
13 13  To use the //Print-Service// plugin, it is necessary to install //Node.js// and the //Print Server//. This can be installed on the same server as the {{formcycle/}} master server.
14 14  
15 -== Installation ==
15 +== Installation Print Server on Windows ==
16 16  
17 17  The installation of the required //Print Server// requires different procedures depending on the operating system.
18 18  
19 -=== Installation Print Server on Windows ===
19 +=== Installation of Node.js ===
20 20  
21 -==== Installation of Node.js ====
22 -
23 23  : 1. Download the LTS version from https://nodejs.org/
24 24  : 2. Run the MSI file
25 25  : 3. Run the wizard steps, leaving default settings as they are
26 26  
27 -==== Installation steps for the Print Server ====
25 +=== Installation steps for the Print Server ===
28 28  
29 29  : 4. Download the Print Server installation files from the Customer Cloud [[here>>https://customer.formcycle.eu/index.php/apps/files/?dir=/FORMCYCLE%20-%20Plugins%20Customer/fc-plugin-print-service/Print%20Server&fileid=18856]].
30 30  : 5. unzip the ZIP file "print_server_fc.zip" and move the content to the folder print_server_fc under {{code language="none"}}C:\Programs\{{/code}}.
... ... @@ -46,7 +46,7 @@
46 46  
47 47  After the installation, a folder named {{code language="none"}}deamon{{/code}} is created for the log files.
48 48  
49 -==== Uninstall ====
47 +=== Uninstall ===
50 50  
51 51  Für die Deinstallation des Print Servers, öffnen Sie eine Kommandozeile (cmd) mit administrativen Berechtigungen und führen Sie folgende Befehle aus.
52 52  
... ... @@ -55,10 +55,13 @@
55 55  node uninstall-windows-service.js
56 56  {{/code}}
57 57  
56 +== Installing Print Server under Linux ==
58 58  
59 -=== Installing Print Server under Linux ===
58 +{{info}}
59 + Contrary to earlier versions, you need to copy ALL files from the ZIP file with the print server.
60 +{{/info}}
60 60  
61 -==== Installation steps for installing Node.js and the Print Server ====
62 +=== Installation steps for installing Node.js and the Print Server ===
62 62  
63 63  To install, open the console and run the following commands:
64 64  
... ... @@ -105,15 +105,24 @@
105 105  During the installation, depending on the existing system, some Linux packages such as nodejs were also installed. However, it is not possible to uninstall the packages automatically. Delete the automatically installed packages only if you are 100% sure that they are no longer needed!
106 106  {{/info}}
107 107  
108 -=== Test ===
109 +== Using IPv6 ==
109 109  
110 -To check if the installation was successful, the service can be called on the server for a test:
111 -{{code language="none"}}http://localhost:8090/pdf?orientation=landscape&format=A4&wait=false&marginTop=0mm&formURL=http://www.formcycle.de{{/code}}
111 +Starting with version 2.0.1, the server binds to both IPv4 and IPv6 addresses by default, using the dual stack feature supported by most operating systems. Should that fail, the print server binds only to IPv4 addresses (0.0.0.0).
112 112  
113 -=== Plugin setup ===
113 +If required, you can also set a different bind address via the command line parameter "--bindAddress".
114 114  
115 -==== Print-Service Plugin Installation ====
115 +== Test ==
116 116  
117 +To check if the installation was successful, the service can be called on the local server for a test (in that case it should be printed the formcycle.de website):
118 +
119 +{{code language="none"}}
120 +http://localhost:8090/pdf?orientation=landscape&format=A4&wait=false&marginTop=0mm&formURL=http://www.formcycle.de
121 +{{/code}}
122 +
123 +== Plugin setup ==
124 +
125 +=== Print-Service Plugin Installation ===
126 +
117 117  In order for the plugin to be available in {{formcycle/}} as an action in the workflow, it must be deployed in the System Plugin section of the management interface. Instructions for installing plugins can be found [[here>>doc:Formcycle.UserInterface.Client.Plugins.WebHome]].
118 118  
119 119  If the old version of the print service plugin (phantom plugin) was already installed, the following procedure is recommended for installation:
... ... @@ -123,7 +123,7 @@
123 123  * Upload new print service plugin
124 124  * Proceed with the configuration
125 125  
126 -==== Plugin Configuration ====
136 +=== Plugin configuration ===
127 127  
128 128  After the plugin has been installed, the service URL must be adjusted. This is defined in the plugin via the mandatory parameter {{code language="none"}}pdf.print.services.url{{/code}}.
129 129  
... ... @@ -177,8 +177,8 @@
177 177  The described steps are only a workaround and the environment variables should be set back to the default values after the successful installation!
178 178  
179 179  {{code language="none"}}
180 -PS C:\test> $env:NODE_TLS_REJECT_UNAUTHORIZED = 0
181 -PS C:\test> npm set strict-ssl false
190 +PS C:\test> $env:NODE_TLS_REJECT_UNAUTHORIZED = 0
191 +PS C:\test> npm set strict-ssl false
182 182  {{/code}}
183 183  
184 184  == Usage and options ==
... ... @@ -194,14 +194,37 @@
194 194  ; Zoom factor
195 195  : Scale factor for the form. Use this to magnify or scale down very large or very small forms.
196 196  ; Blank form
197 -: Can be used to create PDF documents that can be printed out and filled out manually with a pen. When enabled, all form field values are cleared and all hidden fields are shown. In addition, the maximum number of element repetitions are created.
207 +: (requires at least print plugin version 4.2.0 and print service version 1.4.0) Can be used to create PDF documents that can be printed out and filled out manually with a pen. When enabled, all form field values are cleared and all hidden fields are shown. In addition, the maximum number of element repetitions are created.
198 198  ; User groups
199 199  : A virtual user is created when opening the form with Selenium. Select the user groups here to which this virtual user should belong to. Form elements can be configured to be displayed or editable only for certain user groups.
200 200  ; URL parameter
201 201  : Additional URL parameters added to the URL used when opening the form with Selenium. You can use URL parameters to [[prefill form fields>>Formcycle.Designer.Form.URLParameter]] or access them from within JavaScript.
202 202  
203 -== CSS-Anpassungen für Druckbild ==
213 +== CSS adjustments ==
204 204  
215 +General CSS adjustments can be done via a corresponding media query:
216 +
217 +{{code language="css"}}
218 +@media print {
219 + /* general CSS for printing */
220 +}
221 +{{/code}}
222 +
223 +Please note this CSS is applied in other printing contexts as well, e.g. when the user prints the form via the browser directly.
224 +
225 +There are a few special CSS classes available that are set only when the print service is used. These classes are always added to the //form.xm-form// element.(requires at least print plugin version 4.2.0 and print server plugin 1.4.0).
226 +
227 +; xm-print
228 +: This CSS class is always set.
229 +; xm-print~-~-mode-plain
230 +: Added when print mode is set to //Preserve form fields//.
231 +; xm-print~-~-mode-dynamic
232 +: Added when print mode is set to //Convert form fields to text//.
233 +; xm-print~-~-style-filled
234 +: Added when the option //blank form// is disabled.
235 +; xm-print~-~-style-blank
236 +: Added when the option //blank form// is enabled.
237 +
205 205  === Input elements ===
206 206  
207 207  To optimize the form for printing, form elements of type [[input field>>Formcycle.Designer.Form.FormElements.Input]], [[text area>>Formcycle.Designer.Form.FormElements.Textarea]] und [[select>>Formcycle.Designer.Form.FormElements.Selection]] (Drop-Down) may be converted to plain text fields, if the print mode is set to Input elements as text.
... ... @@ -290,39 +290,140 @@
290 290  
291 291  In fonts of type //TrueType// and //OpenType// information about the embeddability of the font can be stored directly. Depending on what is configured there, a font may not be embeddable and will instead be rendered by the //Print-Service-Plugin// only as a vector graphic in the created PDF documents.
292 292  
293 -== Changelog
326 +== JavaScript adjustments ==
294 294  
295 -=== 4.2.0
328 +Sometimes you may have to execute custom JavaScript code before the form is printed. For this, you can use the function //$.xutil.onPrint//. Its signature is as follows:
296 296  
330 +{{code language="text"}}
331 +function onPrint(callback: () => Promise<void> | void): void
332 +{{/code}}
333 +
334 +This function lets you register one or more callbacks that are run before the form is printed. When a callback returns a promise, the print server waits until the promise fulfills before proceeding with the printing. In case the promise gets rejected, the error is logged, but the print is not aborted. Please note that you must register the callback before the form is printed, e.g. within a JQuery document-ready-handler (//$(callback)//).
335 +
336 +For example, to run an AJAX request and wait for it to finish before the form is printed:
337 +
338 +{{js}}
339 + $.xutil.onPrint(async () => {
340 + const response = await fetch("http://some-url.de");
341 + // do something with response
342 + });
343 +{{/js}}
344 +
345 +{{jsIE}}
346 + $.xutil.onPrint(function() {
347 + return new Promise(function(resolve, reject) {
348 + $.ajax("http://some-url.de", {
349 + success: function(data, textStatus, jqXHR) {
350 + // Do something with the response data
351 + resolve(undefined);
352 + },
353 + error: function(jqXHR, textStatus, errorThrown) {
354 + reject("HTTP request error: " + textStatus + " - " + errorThrown);
355 + },
356 + });
357 + });
358 + });
359 +{{/jsIE}}
360 +
361 +== Changelog ==
362 +
363 +=== Plugin ===
364 +
365 +==== 4.3.1 ====
366 +
367 +* fix: Always show the selected appointment date, if any, regardless of the print mode
368 +
369 +==== 4.3.0 ====
370 +
371 +* feature: New option to retry printing in case of a failure
372 +
373 +==== 4.2.3 ====
374 +
375 +* Fix: Special characters in combobox select options are now displayed correctly in the printed PDF document
376 +
377 +==== 4.2.2 ====
378 +
379 +* Fix: When a textarea is set to adjust its height automatically to its content, the height is now recalculated once before the form is printed.
380 +
381 +==== 4.2.1 ====
382 +
383 +* Fix: Show correct version of the print server when performing a check
384 +
385 +==== 4.2.0 ====
386 +
297 297  * feature: New option //blank form//
388 +* feature: Add special CSS classes to the //form.xm-form// such as //xm-print//
298 298  * change: When an element is marked as hidden during print in the form designer (advanced -> Word and PDF export options), the element is now hidden when the print service is used as well. This feature requires at least {{formcycle/}} version 7.0.14.
299 299  * change: Applicable only when //print mode// is set to //dynamic//: When an input field did not have a value, its placeholders was shown instead. This was changed so that no value is shown when the input field does not have a value.
300 300  * change: Applicable only when //print mode// is set to //dynamic//: When a select field displayed as a dropdown menu did not have a value, the text //Please select// was shown instead. This was changed so that no text is shown anymore when the select field does not have a value.
301 301  
302 -=== 4.1.2
393 +==== 4.1.2 ====
303 303  
304 304  * Added note regarding //$.xutil.onPrint// to the plugin UI.
305 305  
306 -=== 4.1.1
397 +==== 4.1.1 ====
307 307  
308 308  * Requires at least {{formcycle/}} 7.0.4.
309 309  * change: Note regarding required field is not shown anymore.
310 310  * fix: Show the date format immediately
311 311  
312 -=== 4.1.0
403 +==== 4.1.0 ====
313 313  
314 314  * Added a new option for selecting the workflow state used during printing. When no state is selected, the current state of the form record is used as in previous version.
315 315  * Configured user groups are saved correctly.
316 316  
317 -=== 4.0.2
408 +==== 4.0.2 ====
318 318  
319 319  * feature: Added a new timeout option that defaults to 30 seconds. When the print service cannot be reached, the workflow may never complete otherwise.
320 320  
321 -=== 4.0.1
412 +==== 4.0.1 ====
322 322  
323 -* fix: The PDF document tha was created was not attached to the form record (only for the new workflow action).
414 +* fix: The PDF document that was created was not attached to the form record (only for the new workflow action).
324 324  
325 -=== 4.0.0
416 +==== 4.0.0 ====
326 326  
327 327  * Adjustments for {{formcycle/}} version 7.
328 328  
420 +=== Server ===
421 +
422 +==== 1.7.2 ====
423 +
424 +* Close alert messages when any are opened by JavaScript. Otherwise the print can never finish successfully.
425 +
426 +==== 1.7.1 ====
427 +
428 +* Update install scripts for Linux
429 +
430 +==== 1.7.0 ====
431 +
432 +* Switch to media type print before printing and wait until no network traffic is ongoing anymore before printing. This helps to show e.g. background graphics from @media print rules.
433 +
434 +==== 1.6.1 ====
435 +
436 +* Fix compatibility with Windows service installation script
437 +
438 +==== 1.6.0 ====
439 +
440 +* Update puppeteer to latest version, which uses Chromium 108.0.5351.0
441 +* Add CLI flag //~-~-disableCache=true// to disable the browser cache--
442 +* Add CLI flag //~-~-isolatedBrowser=true// to use a new browser instance for each request.--
443 +* Fix Debian install script, install libgbm1.
444 +
445 +==== 1.5.1 ====
446 +
447 +* Update node-windows dependency
448 +
449 +==== 1.5.0 ====
450 +
451 +* Update to Chromium 105.0.5173.0
452 +* Requires at least Node.JS version 14 or higher
453 +
454 +==== 1.4.1 ====
455 +
456 +* Fix windows service install / uninstall script (//install-windows-service.js// and //uninstall-windows-service.js//)
457 +
458 +==== 1.4.0 ====
459 +
460 +* When an error occurs while printing, that error is returned as part of the HTTP response
461 +* The print server can now be used for printing arbitrary pages / URLs. JavaScript and CSS that must be run in the context of the page to print can be passed as part of the HTTP request.
462 +* The ///pdf// endpoint without parameters returns a quick summary of the server status