4.16.13 Printing a file (in Windows)
Function
This plug-in copies the specified file on the execution-target server, and then registers a print job for that file in the print queue.
If the local execution function of JP1/AO is enabled, the execution-target server and the JP1/AO server must not be on the same computer.
When a print job is registered in the queue, the OS user's default printer for printing on the execution-target server (specified in the Windows.osPrintUserName property) is used. Before using this plug-in, make sure the default printer settings for the specified user are correct.
The path of the target file to be registered in the print queue is specified by the common.targetFilePath property. This plug-in first copies the specified file to the print-file copy destination folder (specified in the Windows.printCopyFolderPath property). The plug-in then registers a print job for the copied file in the print queue. The original file is not used for printing. If a file with the same name as the target file already exists in the copy destination folder, the plug-in terminates abnormally without overwriting the existing file.
You can specify any file whose file name extension is .txt, .xlsx, .xls, or .doc.
The value of the common.targetFilePath property cannot include wildcard characters. Each file name extension must be associated with an application for printing by the OS user specified in the Windows.osPrintUserName property.
This plug-in also monitors to confirm the end of the process that registers the file in the print queue. This check is performed at intervals (in seconds) specified by the Windows.checkProcessStateIntervalStartProcess property, for the number of times specified by the Windows.checkProcessStateCountStartProcess property. If the process does not end before the last time the check is performed, the plug-in terminates abnormally.
The "print" command is used for printing.
The specification of this command determines how files are printed.
Use situation
This plug-in can be used to print files.
Prerequisites
For the most recent information about the prerequisite products in the system, the prerequisite products on the execution-target server, and the supported OSs on the execution-target server, see the Release Notes.
[Prerequisite products in the system]
JP1/Automatic Operation 11-00 or later
[Prerequisite products on the execution-target server]
None.
[Supported OSs on the execution-target server]
(1) Windows Server 2008 R2 Standard/Enterprise/Datacenter
(2) Windows Server 2012 Standard/Datacenter or Windows Server 2012 R2 Standard/Datacenter
(3) Windows Server 2016 Standard/Datacenter
(4) Windows Server 2019 Standard/Datacenter
[Conditions for using the execution-target server]
- A printer must be registered.
- Associations between file name extensions and applications must be set by the user account to be used for printing (specified by the Windows.osPrintUserName property).
Cautions
(1) For the properties of this plug-in, do not specify any strings that include double quotation marks (") or single quotation marks (').
(2) If the print file copy destination folder specified in the Windows.printCopyFolderPath property does not exist, the folder is automatically created.
(3) If the extension of the file specified on the execution-target server is not associated with an application, registration to the print queue fails. In such cases, make sure the extension of the file specified on the execution-target server is associated with an application.
(4) When a file registered in the print queue is opened by using the associated application on the execution-target server, the application sometimes displays a user confirmation dialog box. If such a dialog box appears, the plug-in remains in the running status. To prevent this, make sure no dialog box appears when the application opens a file.
(5) If this plug-in remains in the running status, forcibly terminate the tasks that use this plug-in from the JP1/AO server. Then, on the execution-target server, start the Task Manager, and check whether a process whose process ID was output to the task log is running. If such a process is running, terminate it.
(6) After the print job is registered in the print queue, the copied file that was used for printing is deleted. Note that the plug-in terminates normally even if file deletion fails. For this reason, periodically check whether files remain in the print file copy destination folder.
(7) Do not specify the Guest user for the OS print user (Windows.osPrintUserName property).
(8) If this plug-in returns the value 28, possible causes are as follows:
(a) After this plug-in terminated abnormally, the process of the application associated with the file name extension continued to run.
(b) The Guest user account or another account that does not have a profile was specified for the OS print user.
(9) When registering multiple jobs for Excel files in the print queue, serialize the execution order of the jobs, because jobs for Excel files cannot be executed at the same time on the same execution-target server.
Version
02.00.00
Plug-in tags
Control OS,Windows
Plug-in name displayed in the task log
osPrintFile
Return code
0: Normal
12: Error (Mistake by user) Invalid property
27: Error (Check with the task log about the error detail) Unidentified error
28: Error (No information collected) Execution of start-process failed.
41: Error (An error has been detected in the plug-in) Property not entered (An error has been detected in the component script)
Property list
The following table lists the properties:
Property key |
Property name |
Description |
Default value |
I/O type |
Required |
---|---|---|---|---|---|
plugin.destinationHost |
Host name of the execution target server |
Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported. |
-- |
Input |
R |
common.targetFilePath |
Target file path |
Enter the full path of the target file. |
-- |
Input |
R |
Windows.printCopyFolderPath |
Copy destination folder for the file to be printed |
Specify the copy destination folder for the file to be set to the print queue. |
-- |
Input |
R |
Windows.osPrintUserName |
OS user name to be used for printing |
Specify the OS user name to be used for printing. |
-- |
Input |
R |
Windows.osPrintUserPassword |
Password of the OS user name to be used for printing |
Specify the password for the OS user name to be used for printing. |
-- |
Input |
R |
Windows.checkProcessStateCountStartProcess |
Number of times to check whether processing finished |
Specify the number of confirmations to check whether the print process requested in Windows finished. Using this with an interval for process monitoring will result in the maximum wait time. |
30 |
Input |
R |
Windows.checkProcessStateIntervalStartProcess |
Interval to check whether processing finished |
Specify the confirmation interval in seconds to check whether the print process requested in Windows finished. |
10 |
Input |
R |
common.returnValue |
Return value for the plugin |
The return value of this plugin stored. |
-- |
Output |
-- |