• 24 Feb

    How to check the printer status before sending a pdf to the printer

    How to check the printer status before sending a pdf to the printer

    Q: We are rolling out a process at one of our customers which requires printing a PDF to a printer. With our tooling, we are not getting confirmation if this printout succeeded/ failed. Can we use Limagito to read a folder, send the PDF to the fixed printer and then return something to our bot? That may be something like a separate file, with the details of the job.

    A: We added some extra options in version v2024.2.24.0 to achieve this. The following blog article is just an example, other possibilities are available. Just let us know if you need any help.

    We added an update of this blog article here

    • We used a Windows Folder as Source:

    limagito file mover windows folder as source

    • Filename include filter is set to *.pdf because we only want to handle pdf files:

    limagito file mover filename include filter

    • We enabled ‘File Memory’ because we only want to print the same pdf file once:

    limagito file mover file memory option

    • The Function is set to ‘Copy’ because we want to leave the original pdf at the source (this is not a must, also ‘Move’ is possible):
      • Destination Options is set to ‘Exit Cyclus on Error’.
        • This ‘Exit Cyclus on Error’ will skip the next Destination in case of error.

    limagito file mover function setup check the printer status

    • We added two destinations:
      • First destination is our ‘Pascal Script’ option: This script will check the printer status and if the status is not OK then it will not print the pdf. The error status can be used to trigger an email event.
      • Second destination  is our ‘PDF’ option: This destination will print the pdf file.

    limagito filemover destination check the printer status

    • First Destination: Pascal Script
      • Please add the following script: link
      • We added the following Const values which you’ll need to adjust:
        • ctCheckPrinterConnection: This will add the possibility to check the printer using its IP (or Hostname) + Port.
          • Set this value to ‘TRUE’ if you want to use this option, otherwise set this Const to ‘FALSE’.
        • cpPrinterIP: If ‘ctCheckPrinterConnection := True;’ then add the IP (or Hostname) of the Printer we need to check.
        • ctPrinterPort: If ‘ctCheckPrinterConnection := True;’ then add the Port of the Printer we need to check. We used port 23 which is the default Telnet port. Most printers are able to received commands directly on that port.
        • ctPrinterError: In case the status of the printer (received from the Windows Spooler) contains 2 then we’ll handle this as Error.
        • ctOutputPathError: In case of Error we’ll write a txt file in this path (must end with a \ ). The text file has the name of the source file but with ‘.txt’ as extension.
          • The content of this text file contains the source filename + the error received.
          • This can be adjusted, please let us know if needed.
      • Don’t forget to adjust the Printer name needed to check that status from the Windows Spooler

    limagito file mover check the printer status

    • Second Destination: PDF
      • Click ‘Add’
      • Adjust Description
      • Check ‘Enabled’
      • Select ‘Print PDF File’
      • Switch to ‘Print’ Tab

    limagito file mover pdf as destination

      • Disable ‘Use Default Printer’
      • Select the printer you need from the combobox ‘Available Devices’
      • Click the + button

    limagito file mover pdf as destination

    • RunTime Log Result:

    We detected that the printer connection was available but the Windows spooler returned an error status. This is why we didn’t print the pdf and returned an error which can be used to send the ‘On Error’ email event. In this event you can use the parameter %VSE which contains the status information from the printer.

    limagito file mover check the printer status runtime log

    • Error Event Setup
      • Please open our ‘Rule Events’ option:

    limagito file rule events option

      • Select and enable the ‘On Error’ event
        1. Check ‘Enable Mail’
        2. > SMTP Setup
        3. > Message Setup
        4. When done, this setup can be tested using our ‘Test’ button

    limagito file mover on error event

      • Message Setup:
        • Always use a valid ‘From’ email address because some SMTP servers will reject the message without returning an error.
        • We used our parameter %VSE in the body because it contains the error information from the printer.

    limagito file mover on error event

    If you need any help with this ‘check the printer status’ request, please let us know.

    Best Regards,

    Limagito Team

    #pdf #managedfiletransfer #filetransfer #filemanagement

  • 19 Feb

    How to copy a csv file when a specific row exists

    How to copy a csv file when a specific row exists

    Q: My client is looking for advanced file copy functionality and have set of requirements for this process. Appreciate if you can clarify below requirements applicability with Limagito. The file copying should not copy the currently modified csv files. Basically, the only difference in the files that are completed and in “modify” mode is a last row in the file – If this specific row not exists, file still in “modify” mode.

    A: Yes this is possible. We added two examples (scripts) on how to achieve this.

    1. Example 1: will read the csv file and check all rows for a certain keyword

    2. Example 2: will read the csv file and will only check the last row for a certain keyword

    • We used a windows folder as source:

    limagito file mover windows as source

    • Open our ‘Pascal Script’ option:

    limagito file mover pascal script option

    • Example Script 1 will read the csv file and check all rows for a certain keyword ( RT_Count )
      • Please enable and add the following ‘On Destination’ Pascal Script: link
      • You can adjust the Keyword but always in Uppercase

    limagito file mover pascal script example

    • Example Script 2 will read the csv file and will only check the last row for a certain keyword ( RT_Count )
      • Please enable and add the following ‘On Destination’ Pascal Script: link
      • You can adjust the Keyword but always in Uppercase

    limagito file mover pascal script example

    • As Destination we also used a windows folder:

    limagito file mover windows folder as destination

    • RunTime Log Result:

    limagito file mover runtime log result

    If you need any help with this ‘copy files in a specific order’ request, please let us know.

    Best Regards,

    Limagito Team

    #csv #managedfiletransfer #filetransfer #filemanagement

  • 18 Feb

    How to copy files in a specific order to the correct location

    How to copy files in a specific order to the correct location

    Q:  Here is the challenge:

    1. Copy job files  (3 total)  in a specific order to the correct location.
    2. There are 3 file formats:
      • XML
      • USF
      • JPG
    3.    The XML must be copied first,  followed by the JPG and finally the USF.

    Is this something you can help with?

    A: Yes this would be possible with our tool. In version v2024.2.18.0 we added an option to achieve this.

    Our idea is to use 3 Rules (tasks):

    • Rule 1: Will copy the the files from the source into temporary subfolders with the name of the file without its extension.
    • Rule 2: Will check if all three files are available and copy them in a specific order to the destination.
    • Rule 3: Will do the cleanup of the temporary folders we used.

    limagito file mover rule listing

     

    Rule 1:

    • We used a Windows folder as source:

    limagito file mover windows folder as source

    • “Filename Include Filter” is to only include xml, usf and jpg files:

    limagito file mover filename filter setup

    • We enabled our file memory option so we’ll only handle the same source files once:

    limagito file mover file memory option

    • Function is set to “Copy” so the original files stay at their source:

    limagito file mover function setup

    • As destination we used a Windows folder:
      • This temporary Destination folder will be used in the ‘On Destination’ Pascal Script of Rule 2.

    limagito file mover windows folder as destination

    • We’ll copy the source files into subfolders with the name of the source file without its extension. This way a job consisting out of three files will reside with one subfolder.

    limagito file mover destination subfolder setup

    Rule 2:

    • The new option to achieve this request is available under our “Schedule Setup”. Switch to “Advanced” tab:
      • Select ‘Root filepath & extension descending (Z to A) – Reset Exit Output on filepath change’
      • Enable ‘Exit Output to Destination On Error’

    limagito file mover copy files in a specific order

    • As source we used a Windows folder but important, the folder itself is a parameter, %VSA
      • Don’t mind if it is marked red, this is because the parameter is empty during the setup.
      • This %VSA parameter will be used in our ‘On Rule Begin’ Pascal Script option.

    limagito file mover windows folder as source

    • Please open our ‘Pascal Script’ option:

    limagito file mover pascal script option

    • Enable and add the following ‘On Rule Begin’ Pascal Script:
      • Please add the following script: link
      • Don’t forget to adjust the ctScanPath Const. This path must be the same as the Destination folder of Rule 1.
      • The script will scan the temporary root folder for subfolders, these subfolders are added to our psVSA var (= %VSA parameter).

    limagito file mover on rule begin pascal script

    • Enable and add the following ‘On Destination’ Pascal Script:
      • Please add the following script: link
      • This script will check if all three files (xml, usf and jpg) of a job are available.

    limagito file mover on destination pascal script

    • We enabled our file memory option int the second Rule also because we want to handle copy errors:

    limagito file mover file memory setup

    • Function is set to ‘Copy’:

    limagito filemover function setup

    • As Destination we also used a Windows folder:

    limagito file mover destination setup

    • RunTime Log result:
      • There is a missing file for Job ‘TestFile2’, so we’ll retry this one during the next scan.
      • All three files are available for Job ‘TestFile’, so all three files are copied in the specific order as requested.

    limagito file mover runtime log result

    • Source folder of Rule 1:

    limagito filemover examples

    • Destination folder of Rule 1:

    limagito filemover examples

    • Destination subfolder of Rule 1:

    limagito filemover examples

    • Destination subfolder of Rule 1:

    limagito filemover examples

    • Destination folder of Rule 2:

    limagito filemover examples

     

    Rule 3:

    • Will handle the cleanup of the temporary folder we used: C:\Test\EDemo\Tmp

    If you need any help with this ‘copy files in a specific order’ request, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Filters
1 11 12 13 14 15 16 17 19
SEARCH