From version < 10.1 >
edited by sas
on 28.05.2021, 16:17
To version < 11.1 >
edited by gru
on 08.06.2021, 17:29
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.sas
1 +XWiki.gru
Content
... ... @@ -1,7 +1,10 @@
1 -[[**Plugin download**>>url:https://customer.formcycle.eu/index.php/apps/files/?dir=/FORMCYCLE%20-%20Plugins%20Customer/plugin-bundle-phantomjs&fileid=342||rel="noopener noreferrer" target="_blank"]] (requires login)
1 +[[**Plugin-Download**>>url:https://customer.formcycle.eu/index.php/apps/files/?dir=/FORMCYCLE%20-%20Plugins%20Customer/fc-plugin-print-service&fileid=8194||rel="noopener noreferrer" target="_blank"]] (requires login)
2 2  
3 3  {{info}}
4 -Please use **plugin version 2.0.0** or above for {{formcycle/}} Version 6.
4 +The print service plugin has been changed to a new concept for technical reasons. For this, a separate print server must be installed in addition to the plugin. The usage and configuration of the plugin action does not differ between the old and the new version.
5 +
6 +
7 +Hints for installation and special features of the old version as well as its download link can be found in the section [[Hinweise für ältere Versionen des Print-Service Plugins>>||anchor="HHinweisefFCrE4ltereVersionendesPrint-ServicePlugins"]].
5 5  {{/info}}
6 6  
7 7  {{content/}}
... ... @@ -10,20 +10,168 @@
10 10  
11 11  == Technical details ==
12 12  
13 -In technical terms, the conversion is done using Selenium and the driver //phantomJS//. The page format of the created PDF document is A4.
16 +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 -{{warning}}
16 -When you print a form with the print services, JavaScript defined for the form is executed. However, please note that no newer JavaScript features are supported. Specifically, no features from {{smallcaps}}Ecma{{/smallcaps}}Script6 and higher are available. This that, for example, you cannot use new keywords such as //let// and //const// or new syntax such as arrow functions or destructuring.
17 -{{/warning}}
18 -
19 19  == Installation ==
20 20  
21 -The plugin can be installed as client plugin or system plugin. Instructions for installing plugins can be found [[here>>doc:Formcycle.UserInterface.Client.Plugins.WebHome]].
20 +The installation of the required //Print Server// requires different procedures depending on the operating system.
22 22  
22 +=== Installation Print Server on Windows ===
23 +
24 +==== Installation of Node.js ====
25 +
26 +: 1. Download the LTS version from https://nodejs.org/
27 +: 2. Run the MSI file
28 +: 3. Run the wizard steps, leaving default settings as they are
29 +
30 +==== Installation steps for the Print Server ====
31 +
32 +: 4. Download the Print Server installation files from the Customer Cloud [[here>>doc:XXX]].
33 +: 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}}.
34 +
35 +To install, open the command line (cmd) with administrative privileges and execute the following commands:
36 +
37 +{{code language="none"}}
38 +cd C:\Programs\print_server_fc
39 +npm install
40 +npm install -g node-windows
41 +npm link node-windows
42 +node install-windows-service.js
43 +{{/code}}
44 +
45 +There now exists a new service {{code language="none"}}FORMCYCLE Print Server{{/code}}. Please check if this is also started before you run a test. The script {{code language="none"}}install-windows-service.js{{/code}} contains default variables for installing the print service.
46 +
47 +* The service is installed on port 8090 by default. To change this, you need to adjust the {{code language="none"}}--port=8090{/code}} parameter in the {{code language="none"}}install-windows-service.js{{/code}} file.
48 +* Logging is enabled by default. To change this set the parameter {{code language="none"}}--verbose=true{{/code}} to {{code language="none"}}--verbose=false{{/code}}.
49 +
50 +After the installation, a folder named {{code language="none"}}deamon{/code}} is created for the log files.
51 +
52 +==== Uninstall ====
53 +
54 +Für die Deinstallation des Print Servers, öffnen Sie eine Kommandozeile (cmd) mit administrativen Berechtigungen und führen Sie folgende Befehle aus.
55 +
56 +{{code language="none"}}
57 +cd C:\Programs\print_server_fc
58 +node uninstall-windows-service.js
59 +{{/code}}
60 +
61 +
62 +=== Installing Print Server under Linux ===
63 +
64 +==== Installation steps for installing Node.js and the Print Server ====
65 +
66 +To install, open the console and run the following commands:
67 +
68 +{{code language="none"}}
69 +# Loading the script (varies depending on the operating system)
70 +
71 +# Debian 10 - If you are logged in as root:
72 +wget "https://customer.formcycle.eu/index.php/s/0GBtp1HtQHJMzQx/download?path=/&files=install_printserver_debian10.sh" -O install_print_server.sh
73 +
74 +# Debian 10 - or if you are logged in as a normal user with sudo rights:
75 +wget "https://customer.formcycle.eu/index.php/s/0GBtp1HtQHJMzQx/download?path=/&files=install_printserver_debian10_sudo.sh" -O install_print_server.sh
76 +
77 +# Ubuntu 16 - If you are logged in as root:
78 +wget "https://customer.formcycle.eu/index.php/s/0GBtp1HtQHJMzQx/download?path=/&files=install_printserver_ubuntu16.sh" -O install_print_server.sh
79 +
80 +
81 +# Make file executable
82 +chmod 750 install_print_server.sh
83 +
84 +
85 +# Start installation
86 +./install_print_server.sh
87 +
88 +
89 +# Run Print Server
90 +systemctl start printserver
91 +{{/code}}
92 +
93 +In the first lines of the script - via the variables {{code language="none"}}PRINTSERVER_USER{{/code}} and {{code language="none"}}PRINTSERVER_USER_PWD{{/code}} - the user name/password to be created can be adjusted.
94 +The verbose parameter can be used to enable/disable the log output. The scripts for the service should be located at {{code language="none"}}/home/formcycle/print_server{{/code}}. In the start script the verbose parameter can be adjusted.
95 +
96 +Translated with www.DeepL.com/Translator (free version)
97 +
98 +==== Uninstall ====
99 +
100 +To uninstall the Print Server, open a command line (cmd) with administrative privileges and execute the following commands:
101 +
102 +{{code language="none"}}
103 +/home/formcycle/deinstall_printserver.sh
104 +{{/code}}
105 +
23 23  {{info}}
24 -There are several versions of the Print PDF plugin for different operating systems (//32-bit Linux//, //64-bit Linux//, //Windows//, //MacOSX//). It is only necessary to install the version of the plugin that corresponds to the operating system on which {{formcycle/}} is installed. The operating system used is displayed on the [[Server information>>Formcycle.SystemSettings.UserInterface.ServerInformation]] page.
107 +**Caution:**
108 +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!
25 25  {{/info}}
26 26  
111 +=== Test ===
112 +
113 +To check if the installation was successful, the service can be called on the server for a test:
114 +http://localhost:8090/pdf?orientation=landscape&format=A4&wait=false&marginTop=0mm&formURL=http://www.formcycle.de
115 +
116 +=== Plugin setup ===
117 +==== Print-Service Plugin Installation ====
118 +
119 +In order for the plugin to be available in {{formcycle/}} as an action in the workflow processing, 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]].
120 +
121 +If the old version of the print service plugin (phantom plugin) was already installed, the following procedure is recommended for installation:
122 +* Disable the phantom plugin
123 +* Delete the phantom plugin
124 +* Upload new print service plugin
125 +* Proceed with the configuration
126 +
127 +==== Plugin Configuration ====
128 +
129 +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}}.
130 +
131 +If the installation was done on the same server as {{formcycle/}}, then specify {{code language="none"}}localhost{/code}} as the domain. If no changes have been made to the port, the setting {{code language="none"}}8090{{/code}} is retained.
132 +
133 +For example: {{code language="none"}}http://localhost:8089/pdf{{/code}}
134 +
135 +This completes the setup of the print service plugin and it is available as an action in the [[workflow processing>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing]].
136 +
137 +=== Troubleshooting ===
138 +
139 +==== Command npm install leads to timeout ====
140 +
141 +If the npm install command does not work due to a proxy, then the general proxy setting is not sufficient. Therefore, the following must be executed via console:
142 +
143 +{{code language="none"}}
144 +npm config set proxy http://proxy.domain:port
145 +npm config set https-proxy https://proxy.domain:port
146 +{{/code}}
147 +
148 +If user data is required:
149 +
150 +{{code language="none"}}
151 +npm config set proxy http://user:pass@proxy.domain:port
152 +npm config set https-proxy https://user:pass@proxy.domain:port
153 +{{/code}}
154 +
155 +More information can also be found here: http://www.fladi.de/2014/02/06/howto-npm-hinter-einem-proxy-verwenden/
156 +
157 +==== Printing does not work ====
158 +
159 +If printing via {{formcycle/}} is not possible, the cause could be that the print service is not reachable. This can be solved by the loopback URL. Under System > General > Loopback URL, loopback base URL: {{code language="none"}}http://localhost:<port>/formcycle{/code}}
160 +
161 +==== PDF is printed, but the message 404 appears ====
162 +
163 +In this case the print service works correctly because a PDF is already created. It must be checked whether the loopback URL is entered correctly so that the URL to the print service is resolved correctly.
164 +
165 +==== Downloading Chromium fails ====
166 +
167 +The following error message appears on the console after running "npm install":
168 +{{code language="none"}}
169 +Error: unable to verify the first certificate
170 +{{/code}}
171 +The described steps are only a workaround and the environment variables should be set back to the default values after the successful installation!
172 +
173 +{{code language="none"}}
174 +PS C:\test> $env:NODE_TLS_REJECT_UNAUTHORIZED = 0
175 +PS C:\test> npm set strict-ssl false
176 +{{/code}}
177 +
27 27  == Usage and options ==
28 28  
29 29  To use this plugin, go to the workflow processing configuration, click on new action and select this plugin. The following options are used to configure the plugin action:
... ... @@ -41,7 +41,8 @@
41 41  ; **URL parameter**
42 42  : Additional URL parameters added to the URL used when opening the form with Selenium. You can use URL parameters to [[prefill form fields>>Formcycle.FormDesigner.URLParameter]] or access them from within JavaScript.
43 43  
44 -== Input elements ==
195 +== CSS-Anpassungen für Druckbild ==
196 +=== Input elements ===
45 45  
46 46  To optimize the form for printing, form elements of type [[input field>>Formcycle.FormDesigner.FormElements.Input]], [[text area>>Formcycle.FormDesigner.FormElements.Textarea]] und [[select>>Formcycle.FormDesigner.FormElements.Selection]] (Drop-Down) may be converted to plain text fields, if the print mode is set to Input elements as text.
47 47  
... ... @@ -65,7 +65,7 @@
65 65  
66 66  Most properties do not require this, however.
67 67  
68 -== Enforce page break ==
220 +=== Enforce page break ===
69 69  
70 70  To create a defined page break, the page-break attributes must be set via CSS. The corresponding container or element has to be selected via the xn attribute. Please note that the CSS property //display //must be set to //block//, otherwise no line break will be created. In this example, a line break should be created before the container //div1//.
71 71  
... ... @@ -75,3 +75,61 @@
75 75   page-break-before: always;
76 76  }
77 77  {{/code}}
230 +
231 +=== Usage of other fonts ===
232 +
233 +==== Technical requirements ====
234 +
235 +In order for fonts to be used and embedded in the created PDF documents, it is generally necessary for them to be installed on the server running the Print-Server.
236 +
237 +{{velocity}}##Hierbei ist zu beachten, dass die //Java-Laufzeitumgebung// nur beim Start nach den im System registrierten Schriftarten sucht. Da durch einen Neustart des Betriebssystems des Servers sowohl das Betriebssystem als auch die //Java-Laufzeitumgebung// nach neu installierten Schriftarten suchen, ist dies in den meisten Fällen der einfachste Weg, neu installierte Schriftarten für die Verwendung im //Print-Service-Plugin// bereitzustellen.
238 +
239 +==== Inclusion via CSS ====
240 +
241 +To include a font installed on the server for printing, it must be explicitly defined with a {{code language="none"}}@media print{{/code}} query and set for use by the appropriate form elements. In the simplest case, this can look like the following example:
242 +
243 +{{code language="css"}}
244 +@media print {
245 + @font-face {
246 + font-family: 'DejaVu Sans';
247 + src: local('DejaVu Sans');
248 + }
249 + .xm-form.modern *, .modern .XPage * {
250 + font-family: "DejaVu Sans";
251 + }
252 +}
253 +{{/code}}
254 +
255 +Here it is especially important that the identifier entered at {{code language="none"}}local(){{/code}} corresponds to the name of the font.
256 +
257 +==== Legal notice ====
258 +
259 +Fonts sometimes have very tightly defined license terms and are priced differently depending on their intended use. It should be noted that fonts for creating PDFs must be embedded in them, which for many commercial fonts requires a different license than for delivery via a web server for the purpose of displaying a web page in a web browser.
260 +
261 +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.
262 +
263 +== Notes for older versions of the Print Service Plugin ==
264 +
265 +The following notes refer to the old version of the Print Service Plugin, which is based on //phantomJS//.
266 +
267 +[[**Plugin-Download**>>url:https://customer.formcycle.eu/index.php/apps/files/?dir=/FORMCYCLE%20-%20Plugins%20Customer/plugin-bundle-phantomjs&fileid=342||rel="noopener noreferrer" target="_blank"]] (requires login)
268 +
269 +{{info}}
270 +Please use **plugin version 2.0.0** or above for {{formcycle/}} Version 6.
271 +{{/info}}
272 +
273 +== Installation ==
274 +
275 +The plugin can be installed as client plugin or system plugin. Instructions for installing plugins can be found [[here>>doc:Formcycle.UserInterface.Client.Plugins.WebHome]].
276 +
277 +{{info}}
278 +There are several versions of the Print PDF plugin for different operating systems (//32-bit Linux//, //64-bit Linux//, //Windows//, //MacOSX//). It is only necessary to install the version of the plugin that corresponds to the operating system on which {{formcycle/}} is installed. The operating system used is displayed on the [[Server information>>Formcycle.SystemSettings.UserInterface.ServerInformation]] page.
279 +{{/info}}
280 +
281 +== Technical details ==
282 +
283 +In technical terms, the conversion is done using Selenium and the driver //phantomJS//. The page format of the created PDF document is A4.
284 +
285 +{{warning}}
286 +When you print a form with the print services, JavaScript defined for the form is executed. However, please note that no newer JavaScript features are supported. Specifically, no features from {{smallcaps}}Ecma{{/smallcaps}}Script6 and higher are available. This that, for example, you cannot use new keywords such as //let// and //const// or new syntax such as arrow functions or destructuring.
287 +{{/warning}}
Copyright 2000-2025