.
Eloquence WEBDLG2 contact contact

Documentation / WEBDLG2 / Eloquence webprint

Eloquence webprint

 
.
  Document revision: 2023-12-01
Refers to eloqcore version: PE83-2205130


The webprint feature, introduced with eloqcore patch PE83-2205100, supports application printer output in a web environment.

When enabled, the Eloquence PRINTER 10 output is passed through eqpcl to create PDF documents that are opened in the browser.

Eloquence configuration options

The following configuration options in the eloq.config or .eloqrc configuration file may be used to define the webprint behavior
option webprint 0
A nonzero value enables the webprint functionality. A mode 1 enables webprint for use with WEBDLG2. A mode 2 overrides the JDLG printer support to use webprint instead. A mode 0 disables webprint (the default).

option webprint_tmp "/var/spool/webprint"
This specifies the directory that is used to (temporarily) hold the printer output. If webprint_age is configured then older files will automatically be removed from this directory. Please keep in mind that this directory and its files must be accessible by a web server.

The location /var/spool/webprint is recommended on HP-UX and Linux.

Please note: When using an external web server on Linux systems with systemd, referring to the /tmp or /var/tmp directory (or a subdirectory) may not work as expected. The web server's systemd unit may have the PrivateTmp option enabled, redirecting the /tmp or /var/tmp directories to a private location.

option webprint_cmd "eqpcl -p -C EOLTERM=2"
This option may be used to specify the eqpcl command line options. Unless an absolute path is specified the Eloquence bin directory is assumed. The default should often be sufficient unless specific printer settings are required.

option webprint_url "/webprint"
This option specifies the URL prefix that is used by the web browser to access a PDF output. The web browser must be configured to refer to the directory specified in the webprint_tmp option. With WEBDLG2 a relative URL should typically be sufficient. With JDLG a protocol and host name must be specified.

option webprint_age 0
This defines the max. age of a print document in seconds in the spool directory (as specified by webprint_tmp). If present then eloqcore will automatically remove any files that are older than the specified age value. A recommended value is 300 seconds (5 minutes).

Please note: This option assumes that a dedicated directory is used that only holds eloquence print files. Any files in the directory will be deleted.

Example configuration

This shows an example configuration in the eloq.config or .eloqrc to enable webprint with a dedicated speool directory.
option webprint 1
option webprint_tmp "/var/spool/webprint"
#option webprint_url "http://localhost/webprint"
option webprint_age 30

Creating the spool directory

On Linux the commands below can be used (as root) to create the spool directory for use with webprint.
mkdir /var/spool/webprint
chown wwwrun:www /var/spool/webprint
chmod 2777 /var/spool/webprint
Spool files are created group readable so assigning them to the www group will ensure the files are readable by the web server but otherwise restricted.


Web server configuration

To integrate with the WEBDLG2 internal web server, add a [/webprint] URI configuration to the eloqwebd2.uri file, for example:
[/webprint]
Path = /var/spool/webprint
GroupList = @auth
CacheMax = 10m

This associates the /webprint URI with the /var/spool/webprint directory, as configured for option webprint_url. The browser is allowed to cache the files for 10 minutes before revalidating with the server. The invoking user needs to be logged in.

Equivalent example configuration for Apache httpd:

# Eloquence webprint
Alias /webprint "/var/spool/webprint"
<Directory "/var/spool/webprint">
  Options None
  # Apache 2.4
  <ifModule mod_authz_core.c>
    Require all granted
  </ifModule>
  # Apache 2.2
  <ifModule !mod_authz_core.c>
    Order allow,deny
    Allow from all
  </ifModule>
  # Caching
  <ifModule mod_headers.c>
    Header Set Cache-Control "private, max-age=600, must-revalidate"
  </ifModule>
</Directory>

Save this in a file named webprint.conf in the Apache httpd conf.d directory, typically in one of the locations listed below:

/etc/httpd/conf.d
/etc/apache/conf.d
/etc/apache2/conf.d

On Windows:

The directory is typically: C:\Apache24\conf\extra

To activate the webdlg2.conf file, a line like below needs to be added to the end of the httpd.conf file (typically located in the C:\Apache24\conf directory):

Include conf/extra/webdlg2.conf

Please note: The web server may need to be restarted when its configuration has been modified.


Can I do the same with other documents?

Sure.

Webprint uses the Application.browser[target] method to have the browser fetch the document from the server. This is a method available in WEBDLG2 that allows to specify a target tab for a document. For printer 10 "printer" is currently used as a target.

DLG SET "Application.browser[printer]","/webprint/"&Name$
With JDLG the Application.browser method is used which does not allow specifying a target.

eloqcore has the option to remove old documents. This is triggered whenever a document to PRINTER 10 is started. Alternatively a cron job or cgi script could be used as well.

It is not difficult to create functionality that works the same for other application documents and/or that integrates with webprint.


We appreciate your feedback. Please send your feedback to support@marxmeier.com.

Enjoy!
The Eloquence Team


 
 
 
  Privacy | Webmaster | Terms of use | Impressum Revision: 2023-12-01  
  Copyright © 1995-2023 Marxmeier Software AG