Add Document Plugin Documentation

Posted by: Uomo Del Ghiaccio

Add Document Plugin Documentation - 10/19/12 04:54 PM

The "Add Document" plugin does not appear to be outputting Optimized Postscript like is says in the documention.

The output is an Optimized PostScript Stream job that is the combination of the data file and selected document.

I would really like Optimized Postscript.
Posted by: Yannick Fortin

Re: Add Document Plugin Documentation - 10/19/12 05:45 PM

The documentation is wrong, this plugin creates a printer-centric job, although that would certainly be a good feature to add.

There is no direct way to get an Optimized PostScript job. The simplest way would be to use the printer output through a Send to Folder printer queue and capture the resulting file.
Posted by: Philippe F.

Re: Add Document Plugin Documentation - 10/22/12 08:03 AM

I have requested that the documentation be modified. It should be online shortly.
Posted by: Uomo Del Ghiaccio

Re: Add Document Plugin Documentation - 10/24/12 08:26 AM

I'm trying to keep this all within the same process.

If I use a branch with a Send to Folder printer to create the Optimized Postscript file and then use a folder capture to pick up the file and continue on.

Is the Optimized Postscript file fully created before the process moves on to the next step of the workflow or will I need to use a script (example below) that checks for the existance of the file before proceeding to the next step?

Dim objExists
Dim sFileName, sFilePath, i

' Set initial variable values
sFilePath = "C:\Print2Folder\"
sFileName = sFilePath & Watch.GetVariable("sUnique")

' Use all UPPERCASE for constants

'' Main

Call xWriteToLog("F", SCRIPTID, "Loop count = :" & i, 3)

'' Sub-Routines
Sub ProcessFile()
    For i = 1 To 100
        If objExists.FileExists(sFileName) Then
           Exit for
           Watch.Sleep 100
       End If
End Sub

Sub OpenFiles()
    ' Startup FSO
    Set objExists = CreateObject("Scripting.FileSystemObject")
End Sub

Sub CloseFiles()
    ' Clean House
    Set objExists = nothing
End Sub

'' Functions
Function xWriteToLog(debug, scriptid, msg,level)

        ' Valid level values
        ' 1 = Error
        ' 2 = Warning
        ' 3 = Information
        ' 4 = Debug

        ' Gather current date from PlanetPress Watch
        Dim processDate
        processDate = Watch.ExpandString("SCRIPTLOG: %y-%m-%d - %h:%n:%s")
        ' Write entry to the PlanetPress Watch Log
        If debug = "T" then
                Watch.ShowMessage(processDate & " - " & scriptid & " - " & msg & " - " & level)
                Watch.Log processDate & " - " & scriptid & " - " & msg, level
        End If
End Function

I would also need to use a JobInfo along with a local variable to identify which file to pick back up.
Posted by: Philippe F.

Re: Add Document Plugin Documentation - 10/24/12 08:46 AM

Control won't come back to the next task until the Optimized PS file has been completely generated, so no worries there.

In your branch, just set the value of some local process variable to the name of the PS file you created and you can then use it back in the main branch to specify which file to pick up in the Input folder task.