Hide last authors
gru 10.5 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)
gru 5.10 2
gru 5.14 3 {{info}}
gru 10.5 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.
gru 9.1 5
gru 10.1 6
gru 10.5 7 Hints for installation and special features of the old version as well as its download link can be found in the section [[Notes for older versions of the Print Service Plugin>>||anchor="HNotesforolderversionsofthePrintServicePlugin"]].
gru 5.14 8 {{/info}}
9
gru 1.1 10 {{content/}}
11
gru 10.5 12 The plugin //Print Services// is available separately and lets you create a PDF document from a form that is optimized for printing. This plugin is subject to additional charge.
gru 5.10 13
gru 10.5 14 == Technical details ==
gru 5.10 15
gru 10.5 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.
gru 5.11 17
gru 5.18 18 == Installation ==
19
gru 10.5 20 The installation of the required //Print Server// requires different procedures depending on the operating system.
gru 5.18 21
gru 10.5 22 === Installation Print Server on Windows ===
gru 6.1 23
gru 10.5 24 ==== Installation of Node.js ====
gru 1.1 25
gru 10.5 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
gru 9.1 29
gru 10.5 30 ==== Installation steps for the Print Server ====
gru 9.1 31
gru 10.5 32 : 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]].
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}}.
gru 9.2 34
gru 10.5 35 To install, open the command line (cmd) with administrative privileges and execute the following commands:
36
gru 9.1 37 {{code language="none"}}
gru 10.5 38 cd C:\Programs\print_server_fc
gru 9.1 39 npm install
40 npm install -g node-windows
41 npm link node-windows
42 node install-windows-service.js
43 {{/code}}
44
gru 10.5 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>>||anchor="HTest"]]. The script {{code language="none"}}install-windows-service.js{{/code}} contains default variables for installing the print service.
gru 9.1 46
gru 10.5 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}}.
gru 9.1 49
gru 10.5 50 After the installation, a folder named {{code language="none"}}deamon{{/code}} is created for the log files.
gru 9.6 51
gru 10.5 52 ==== Uninstall ====
gru 9.1 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"}}
gru 10.5 57 cd C:\Programs\print_server_fc
gru 9.1 58 node uninstall-windows-service.js
59 {{/code}}
60
61
gru 10.5 62 === Installing Print Server under Linux ===
gru 9.1 63
gru 10.5 64 ==== Installation steps for installing Node.js and the Print Server ====
gru 9.1 65
gru 10.5 66 To install, open the console and run the following commands:
gru 9.1 67
68 {{code language="none"}}
gru 10.5 69 # Loading the script (varies depending on the operating system)
gru 9.1 70
gru 10.5 71 # Debian 10 - If you are logged in as root:
gru 9.1 72 wget "https://customer.formcycle.eu/index.php/s/0GBtp1HtQHJMzQx/download?path=/&files=install_printserver_debian10.sh" -O install_print_server.sh
73
gru 10.5 74 # Debian 10 - or if you are logged in as a normal user with sudo rights:
gru 9.1 75 wget "https://customer.formcycle.eu/index.php/s/0GBtp1HtQHJMzQx/download?path=/&files=install_printserver_debian10_sudo.sh" -O install_print_server.sh
76
gru 10.5 77 # Ubuntu 16 - If you are logged in as root:
gru 9.1 78 wget "https://customer.formcycle.eu/index.php/s/0GBtp1HtQHJMzQx/download?path=/&files=install_printserver_ubuntu16.sh" -O install_print_server.sh
79
gru 9.5 80
gru 10.5 81 # Make file executable
gru 9.1 82 chmod 750 install_print_server.sh
83
gru 9.5 84
gru 10.5 85 # Start installation
gru 9.1 86 ./install_print_server.sh
87
gru 9.5 88
gru 10.5 89 # Run Print Server
gru 9.1 90 systemctl start printserver
91 {{/code}}
92
gru 10.5 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.
gru 9.1 95
gru 10.5 96 Translated with www.DeepL.com/Translator (free version)
gru 9.1 97
gru 10.5 98 ==== Uninstall ====
gru 9.2 99
gru 10.5 100 To uninstall the Print Server, open a command line (cmd) with administrative privileges and execute the following commands:
101
gru 9.1 102 {{code language="none"}}
103 /home/formcycle/deinstall_printserver.sh
104 {{/code}}
105
gru 9.2 106 {{info}}
gru 10.5 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!
gru 9.2 109 {{/info}}
110
gru 9.1 111 === Test ===
112
gru 10.5 113 To check if the installation was successful, the service can be called on the server for a test:
gru 10.2 114 {{code language="none"}}http://localhost:8090/pdf?orientation=landscape&format=A4&wait=false&marginTop=0mm&formURL=http://www.formcycle.de{{/code}}
gru 9.1 115
gru 10.5 116 === Plugin setup ===
gru 10.2 117
gru 10.5 118 ==== Print-Service Plugin Installation ====
gru 9.1 119
gru 10.5 120 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]].
gru 9.1 121
gru 10.5 122 If the old version of the print service plugin (phantom plugin) was already installed, the following procedure is recommended for installation:
123 * Disable the phantom plugin
124 * Delete the phantom plugin
125 * Upload new print service plugin
126 * Proceed with the configuration
gru 9.1 127
gru 10.5 128 ==== Plugin Configuration ====
gru 9.1 129
gru 10.5 130 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}}.
gru 9.1 131
gru 10.5 132 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.
gru 9.1 133
gru 10.5 134 For example: {{code language="none"}}http://localhost:8089/pdf{{/code}}
gru 9.1 135
gru 10.5 136 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]].
137
gru 9.1 138 === Troubleshooting ===
139
gru 10.5 140 ==== Command npm install leads to timeout ====
gru 9.1 141
gru 10.5 142 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:
gru 9.1 143
144 {{code language="none"}}
145 npm config set proxy http://proxy.domain:port
146 npm config set https-proxy https://proxy.domain:port
147 {{/code}}
148
gru 10.5 149 If user data is required:
gru 9.1 150
151 {{code language="none"}}
152 npm config set proxy http://user:pass@proxy.domain:port
153 npm config set https-proxy https://user:pass@proxy.domain:port
154 {{/code}}
155
gru 10.5 156 More information can also be found here: http://www.fladi.de/2014/02/06/howto-npm-hinter-einem-proxy-verwenden/
gru 9.1 157
gru 10.5 158 ==== Printing does not work ====
gru 9.1 159
gru 10.5 160 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}}
gru 9.1 161
gru 10.5 162 ==== PDF is printed, but the message 404 appears ====
gru 9.1 163
gru 10.5 164 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.
gru 9.1 165
gru 10.5 166 ==== Downloading Chromium fails ====
gru 9.1 167
gru 10.5 168 The following error message appears on the console after running "npm install":
gru 9.1 169 {{code language="none"}}
170 Error: unable to verify the first certificate
171 {{/code}}
gru 10.3 172
gru 10.5 173 The described steps are only a workaround and the environment variables should be set back to the default values after the successful installation!
gru 9.1 174
175 {{code language="none"}}
176 PS C:\test> $env:NODE_TLS_REJECT_UNAUTHORIZED = 0
177 PS C:\test> npm set strict-ssl false
178 {{/code}}
179
gru 10.5 180 == Usage and options ==
gru 9.1 181
gru 10.5 182 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:
gru 5.10 183
gru 10.5 184 ; **File name**
185 : File name of the created PDF document.
186 ; **Print mode**
187 : Input elements as text: Input elements are converted into plain text fields and the form is adapted to the width of the page.
188 ; **Print mode**
189 : Web view: No changes are made to the form and it is converted so that it looks as closely as it does in a web browser as possible.
190 ; **Zoom factor**
191 : Factory by which the form is scaled. Use this to magnify or scale down very large or very small forms.
192 ; **User groups**
193 : 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.
194 ; **URL parameter**
195 : 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.
gru 1.1 196
gru 9.1 197 == CSS-Anpassungen für Druckbild ==
gru 10.5 198 === Input elements ===
gru 1.1 199
gru 10.5 200 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.
gru 1.1 201
gru 10.5 202 Additionally, the CSS classes //print// and //XSpan// are added to the converted input element that can be used for styling them. For example, in order to change the font size, you can use the following CSS:
203
gru 5.6 204 {{code language="css"}}
gru 1.1 205 .print.XSpan {
206 font-size: 18pt;
207 font-family: serif;
208 }
209 {{/code}}
210
gru 10.5 211 To overwrite some properties of the default CSS shipped with {{formcycle/}}, use more specific selectors such as:
gru 1.1 212
gru 5.6 213 {{code language="css"}}
sas 7.1 214 .xm-form .xm-content div.print.XSpan {
gru 1.1 215 font-size: 18pt;
216 font-family: serif;
217 }
218 {{/code}}
219
gru 10.5 220 Most properties do not require this, however.
gru 6.4 221
gru 10.5 222 === Enforce page break ===
sas 8.1 223
gru 10.5 224 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//.
sas 8.1 225
226 {{code language="css"}}
227 [xn=div2] {
gru 10.5 228 display: block !important;
229 page-break-before: always;
sas 8.1 230 }
231 {{/code}}
232
gru 10.5 233 === Usage of other fonts ===
gru 6.4 234
gru 10.5 235 ==== Technical requirements ====
gru 6.4 236
gru 10.5 237 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.
sas 7.1 238
gru 10.5 239 ==== Inclusion via CSS ====
gru 6.4 240
gru 10.5 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:
gru 6.4 242
243 {{code language="css"}}
gru 6.17 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 }
gru 6.4 252 }
253 {{/code}}
254
gru 10.5 255 Here it is especially important that the identifier entered at {{code language="none"}}local(){{/code}} corresponds to the name of the font.
gru 6.10 256
gru 10.5 257 ==== Legal notice ====
gru 6.4 258
gru 10.5 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.
gru 6.4 260
gru 10.5 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.
gru 9.1 262
gru 10.5 263 == Notes for older versions of the Print Service Plugin ==
gru 9.1 264
gru 10.5 265 The following notes refer to the old version of the Print Service Plugin, which is based on //phantomJS//.
gru 9.1 266
gru 10.5 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)
gru 9.1 268
269 {{info}}
gru 10.5 270 Please use **plugin version 2.0.0** or above for {{formcycle/}} Version 6.
gru 9.1 271 {{/info}}
272
273 === Installation ===
274
gru 10.5 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]].
gru 9.1 276
277 {{info}}
gru 10.5 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.
gru 9.1 279 {{/info}}
280
gru 10.5 281 === Technical details ===
gru 9.1 282
gru 10.5 283 In technical terms, the conversion is done using Selenium and the driver //phantomJS//. The page format of the created PDF document is A4.
gru 9.1 284
285 {{warning}}
gru 10.5 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.
gru 9.1 287 {{/warning}}
Copyright 2000-2024