Show last authors
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
3 {{info}}
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 [[Notes for older versions of the Print Service Plugin>>||anchor="HNotesforolderversionsofthePrintServicePlugin"]].
8 {{/info}}
9
10 {{content/}}
11
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.
13
14 == Technical details ==
15
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.
17
18 == Installation ==
19
20 The installation of the required //Print Server// requires different procedures depending on the operating system.
21
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>>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}}.
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>>||anchor="HTest"]]. 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
106 {{info}}
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!
109 {{/info}}
110
111 === Test ===
112
113 To check if the installation was successful, the service can be called on the server for a test:
114 {{code language="none"}}http://localhost:8090/pdf?orientation=landscape&format=A4&wait=false&marginTop=0mm&formURL=http://www.formcycle.de{{/code}}
115
116 === Plugin setup ===
117
118 ==== Print-Service Plugin Installation ====
119
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]].
121
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
127
128 ==== Plugin Configuration ====
129
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}}.
131
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.
133
134 For example: {{code language="none"}}http://localhost:8089/pdf{{/code}}
135
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
138 === Troubleshooting ===
139
140 ==== Command npm install leads to timeout ====
141
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:
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
149 If user data is required:
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
156 More information can also be found here: http://www.fladi.de/2014/02/06/howto-npm-hinter-einem-proxy-verwenden/
157
158 ==== Printing does not work ====
159
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}}
161
162 ==== PDF is printed, but the message 404 appears ====
163
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.
165
166 ==== Downloading Chromium fails ====
167
168 The following error message appears on the console after running "npm install":
169 {{code language="none"}}
170 Error: unable to verify the first certificate
171 {{/code}}
172
173 The described steps are only a workaround and the environment variables should be set back to the default values after the successful installation!
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
180 == Usage and options ==
181
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:
183
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.
196
197 == CSS-Anpassungen für Druckbild ==
198 === Input elements ===
199
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.
201
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
204 {{code language="css"}}
205 .print.XSpan {
206 font-size: 18pt;
207 font-family: serif;
208 }
209 {{/code}}
210
211 To overwrite some properties of the default CSS shipped with {{formcycle/}}, use more specific selectors such as:
212
213 {{code language="css"}}
214 .xm-form .xm-content div.print.XSpan {
215 font-size: 18pt;
216 font-family: serif;
217 }
218 {{/code}}
219
220 Most properties do not require this, however.
221
222 === Enforce page break ===
223
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//.
225
226 {{code language="css"}}
227 [xn=div2] {
228 display: block !important;
229 page-break-before: always;
230 }
231 {{/code}}
232
233 === Usage of other fonts ===
234
235 ==== Technical requirements ====
236
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.
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-2024