Grooper.Activities.RenderDocument

Renders the native file version stored on a Batch Folder to PDF.

Rendering allows electronic documents of any type to be displayed in Grooper, and allows their textual content to be accessed by Grooper activities such as Classify and Extract. Conversion to PDF is achieved by automating the native application to print the document to a Grooper-installed printer called the 'Grooper Render Printer', which generates a PDF file from the print stream. This activity can render any electronic document format, as long as the following criteria are met:

Only a single instance of this activity may run on the same machine at the same time. If the folder does not have a native version, this activity does nothing.

For more information on installing and configuring Grooper Render Printer, click here to go to Grooper x Change.


Inherits from: Grooper.Core.UnattendedActivity

Constructors

Signature Description
New (gdb As GrooperDb)
Parameters
gdb
          Type: GrooperDb
          

Fields

Field Name Field Type Description
Database As Grooper.GrooperDb Grooper.GrooperDb
DiagnosticInfo As Grooper.IP.DiagnosticInfo Grooper.IP.DiagnosticInfo

Properties

Property Name Property Type Description
ActivityStats Grooper.StatDictionary Dictionary of statistics for the batch processing activity.
AllowRenderAsImages System.Boolean Allows damaged PDFs which cannot be combined using normal methods to be combined as images. In some cases, it may not be possible to open a damaged PDF and extract the pages, but it may be possible to render the document pages to an image. If this option is enabled, when normal PDF merging fails, and attempt will be made to merge the PDF files as images. If this option is disabled, an error will be raised when normal merging fails.
BodyRendering Grooper.Activities.RenderDocument.BodyRenderingMethod Indicates how the body of mail messages should be rendered.Can be one of the following values:
  • None: The message body will not be rendered.
  • PreferText: The message body will be rendered as plain text. If the message does not include plain text, it will be rendered as HTML.
  • PreferHTML: The message body will be rendered as HTML. If the message does not include HTML, it will be rendered as plain text.
BorderSize Grooper.BorderExF The size, in inches, of margins around the edge of each page.
ConcurrencyMode Grooper.ConcurrencyModeAttribute.ConcurrencyMode Specifies the parallel processing mode for this activity. This value determines the type of Thread Pool on which the activity can be executed.Can be one of the following values:
  • Multiple: Multiple instances can run concurrently.
  • PerMachine: Only a single instance can run per machine.
  • Single: Only a single instance can run per Grooper repository.
ConversionErrorDisposition Grooper.Activities.RenderDocument.ProblemDisposition When rendering multipart objects such as emails or ZIP files, indicates what should happen if a rendering error occurs. If no disposition options are enabled, the item will complete successfully with no indication that a problem occurred.A combination of the following flags:
  • None: Item will complete successfully with no indication that a problem occurred.
  • Flag: The item will be flagged.
  • Replace: A replacement page will be generated and inserted into the output.
DefaultPrintQueue System.String Displays the print queue for the default printer.
DialogResponseDataType Grooper.Core.DataType A Data Type used for generating responses to application-raised dialog boxes. When an application displays a dialog box during rendering, a text representation of the dialog box is generated, including the title of the dialog box, the text from each control, and the text from each button. To generate an automated response to a dialog box, the Data Type specified here must define a Data Format which matches text on the dialog box, and returns the name of the button to be clicked as a literal value in the Output Format.

For example, consider a scenario where the following dialog box is showing up in the Grooper log as unresolved:


Microsoft Office Excel
This workbook contains one or more links that cannot be updated.

• To change the source of links, or attempt to update values again, click Edit Links.
• To leave the links as is, click Continue.

{Continue} {Edit Links...}


To handle this dialog, a Data Format could be create with a Pattern of 'links that cannot be updated' and a literal value of 'Continue' in the Output Format. When this application dialog box is encountered, the Data Type will match the text on the dialog, and the button named 'Continue' will be automatically clicked.

DisplayRenderPath System.String The path to which the Grooper Printer Driver is configured to output PDF files.
DownloadExternalResources System.Boolean If enabled, external image resources used in HTML message bodies will be downloaded as necessary.
ErrorDisposition Grooper.Core.UnattendedActivity.IssueDisposition Determines what happens when an error occurs processing an activity.A combination of the following flags:
  • None: The issue will be ignored, and the item will complete successfully.
  • Flag: The associated Batch Folder or Batch Page will be flagged.
  • Log: The issue will be logged to the Grooper log. The log can be viewed from the Grooper Root node under the Batch Event Viewer tab.
  • Stop: The Batch will stop processing, be set to an error state, and all pending tasks will be deleted.
ExcludedFileExtensions Grooper.Core.EmbeddedLexicon Specifies file extensions which should be excluded from the rendering process. Each file extension in the lexicon should be in lower case and preceded by a "." character.
FileExtensionMappings Grooper.Core.EmbeddedLexicon Specifies file extension mappings. For example, there are many different file extensions for a text file (.txt, .log, .readme, etc.). While the .log extension may not have a print verb registered, the .txt file extension does. The entries in this lexicon provide such a mapping for the rendering process. Each lexicon entry should contain the original file extension as the value, and the replacement file extension as the replacement value. All file extensions must be in lower case and preceded by a "." character.
FileTypes System.Collections.Generic.List(Of T) Displays a list of file types on the local machine for which a shell print verb is registered. This property is for informational purposes only. At runtime, rendering will rely on Windows file type registrations, therefore it is not necessary to configure any file type registrations here.
FlagConversionIssues System.Boolean If set to true, documents will be flagged in cases where recoverable PDF conversion issues are encountered. During the rendering of certain file types, existing PDF documents with minor corruptions may be encountered. By enabling this property, the document will be flagged when a recoverable corruption is encountered and the repair is successful. If Grooper's attempt to repair is unsuccessful, an exception will occur and the current Error Disposition will be followed.
FontName System.String Specifies the font that will be used.
FontSize System.Single Specifies the font size that will be used.
HasReferenceProperties System.Boolean Returns true if the object has properties which reference Grooper Node objects.
IsEmpty System.Boolean Returns true if all properties with a ViewableAttribute are set to their default value.
IsWriteable System.Boolean Returns true if the object is writable, or false if it is not.
MaximumConsecutiveErrors System.Int32 The maximum number of consecutive errors, after which a critical stop will be raised. A critical stop will cause services to stop running.
OutputFilePollingTimeout System.Int32 The timeout period, in seconds, for the output file to be generated after the print job has completed printing.
OverwriteExisting System.Boolean If true, any existing PDF versions will be overwritten. If false, folders with existing PDF versions will be skipped.
PageCountLimit System.Int32 The maximum number of pages in a rendered document. If a print job is detected which includes more than the specified number of pages, the print job will be canceled and the document will be considered a render error.
PageSize Grooper.IP.LogicalSize The size, in inches, of each PDF page.
PgDefaultButtonNames System.String[] A list of button names which will be automatically clicked in cases where none of the formats defined in the Dialog Response Data Type produce a match. Supports regular expression syntax. Matching is not case-sensitive.
PrintJobStartTimeout System.Int32 The timeout period, in seconds, for a print job to start after the printing application is launched.
PrintSpoolerRecycleDelay System.Int32 The amount of time, in seconds, for the thread to sleep after recycling the print spooler service.
ProcessCloseTimeout System.Int32 The amount of time, in seconds, for the thread to sleep after recycling the print spooler service.
RenderAttachments System.Boolean If true, then attachments of mail messages will be rendered.
RenderHeaders System.Boolean If enabled, appends a page to the end of the document containing the RFC822 headers.
RenderPdfs System.Boolean If enabled, Native PDF files will be rendered (printed) and saved to the Batch Folder. Otherwise, the Native PDF file will be left as is.
ResourceDownloadTimeout System.Int32 The timeout, in seconds, for downloading external resources.
Root Grooper.GrooperRoot Returns the root node
StatNames System.Collections.Generic.IEnumerable(Of T) Returns all possible statistic names which could be logged for the Activity. Derived classed should override this method to return all stat names which will be used in calls to AddCustomStatValue().
UnknownFileTypeDisposition Grooper.Activities.RenderDocument.ProblemDisposition When rendering multipart objects such as emails or ZIP files, indicates what should happen if an unknown file type is encountered. If no disposition options are enabled, the item will complete successfully with no indication that a problem occurred.A combination of the following flags:
  • None: Item will complete successfully with no indication that a problem occurred.
  • Flag: The item will be flagged.
  • Replace: A replacement page will be generated and inserted into the output.

Methods

Method Name Description
AddDiagImage(Name As String, Image As GrooperImage, Annotations As IEnumerable(Of Annotation))
Parameters
Name
          Type: String
          
 
Image
          Type: GrooperImage
          
 
Annotations
          Type: IEnumerable`1
          
EnableDiagMode()
GetProperties() As PropertyDescriptorCollection
GetReferences() As List(Of GrooperNode) Returns a list of GrooperNode objects referenced in the properties of this object.
InsertDiagImage(Index As Int32, Name As String, Image As GrooperImage, Annotations As IEnumerable(Of Annotation))
Parameters
Index
          Type: Int32
          
 
Name
          Type: String
          
 
Image
          Type: GrooperImage
          
 
Annotations
          Type: IEnumerable`1
          
IsPropertyEnabled(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently enabled.
Parameters
PropertyName
          Type: String
          The name of the property to determine the enabled state for.
IsPropertyVisible(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently visible.
Parameters
PropertyName
          Type: String
          The name of the property to determine the visible state for.
IsType(Type As Type) As Boolean Returns true if the object is of the type specified, or if it derives from the type specfied.
Parameters
Type
          Type: Type
          The type to check.
LogStatValue(Name As String, Value As Double) Adds a custom stat value to the Batch Processing Activity statistics.
Parameters
Name
          Type: String
          
 
Value
          Type: Double
          
ProcessTask(CurNode As BatchObject) Mandatory override to implement processing logic.
Parameters
CurNode
          Type: BatchObject
          The current batch object being processed.
Serialize() As String Serializes the object.
SetDatabase(Database As GrooperDb) Sets the database connection of the object.
Parameters
Database
          Type: GrooperDb
          
ToString() As String Returns the display name for this activity type.
ValidateProperties() As ValidationErrorList Validates the properties of the object, returning a list of validation errors.
Verify()
WriteLogEntry(Message As String, pa() As Object()) Adds an entry to the Diagnostic Info Log.
Parameters
Message
          Type: String
          
 
pa
          Type: Object
          
WriteLogEntry(TabLevel As Int32, Message As String, pa() As Object()) Adds an entry to the Diagnostic Info Log.
Parameters
TabLevel
          Type: Int32
          Level to indent the message within the log.
 
Message
          Type: String
          
 
pa
          Type: Object