Skip to main content

Merge PDFs

Comments

10 comments

  • Permanently deleted user

    Ralph,

     

    Thanks for the assist. I'm a little lost on how to get my  three reports (Geocortex.Workflow.Activities.Report) referenced in the sequence.

    0
  • Permanently deleted user

    Hi Bill

    first thing is that there is a spelling mistake in your last Sequence tag at the end of what you posted.

    Secondly do your reports generate correctly? How about adding a DisplayHyperlink activity in after each report  generation activity to test opening each page

    Before the merge activity try showing the the count of byte arrays in the list that you have been adding to just to check that your 3 reports are there.

    I also note that there is a duplicate variable called _mergedPDF. You need to get rid of one of them.

    Try those suggestions for starters

    Regards

    Ralph

    0
  • Michael Wallace
    Thank you for this conversation above. It is 5 years old and so I think the merge pdfs activity has changed. Can anyone comment on how to get the URI for the Merged PDF? Also in the example above the root server address is changed to localhost is this recommended still? If you would like I can place a ticket for this.
    0
  • Zinnia Zinnia

    Hi all, 

     

    Could anyone please share the sample workflow for this post. I am struggling with Merge Workflow Activity and how to use it?

    Appreciate any help!

     

    Thanks

    Zinnia

    0
  • Nico Burgerhart

    <Activity mc:Ignorable="sads sap sap2010" x:Class="ActivityBuilder" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1"
     xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
     xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
     xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client"
     xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client"
     xmlns:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core"
     xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi"
     xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi"
     xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting"
     xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow"
     xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities"
     xmlns:gwr="clr-namespace:Geocortex.Workflow.Runtime;assembly=Geocortex.Workflow"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
     xmlns:s="clr-namespace:System;assembly=System.Core"
     xmlns:s1="clr-namespace:System;assembly=System"
     xmlns:s2="clr-namespace:System;assembly=mscorlib"
     xmlns:s3="clr-namespace:System;assembly=System.ServiceModel"
     xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
     xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
     xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
     xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
     xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
     xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
     xmlns:si="clr-namespace:System.IO;assembly=mscorlib"
     xmlns:si1="clr-namespace:System.IO;assembly=WindowsBase"
     xmlns:si2="clr-namespace:System.IO;assembly=System"
     xmlns:si3="clr-namespace:System.IO;assembly=System.Core"
     xmlns:si4="clr-namespace:System.IO;assembly=System.ServiceModel"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
      <TextExpression.NamespacesForImplementation>
        <sco:Collection x:TypeArguments="x:String">
          <x:String>System.Activities</x:String>
          <x:String>System.Activities.Statements</x:String>
          <x:String>System.Activities.Expressions</x:String>
          <x:String>System.Activities.Validation</x:String>
          <x:String>System.Activities.XamlIntegration</x:String>
          <x:String>ESRI.ArcGIS.Client</x:String>
          <x:String>ESRI.ArcGIS.Client.Geometry</x:String>
          <x:String>ESRI.ArcGIS.Client.Tasks</x:String>
          <x:String>Geocortex.Core.Extensions</x:String>
          <x:String>Geocortex.Forms.Client</x:String>
          <x:String>Geocortex.Forms.Client.Items</x:String>
          <x:String>Geocortex.Reporting</x:String>
          <x:String>Geocortex.Workflow.Activities</x:String>
          <x:String>Microsoft.VisualBasic.Activities</x:String>
          <x:String>System</x:String>
          <x:String>System.Activities.Debugger.Symbol</x:String>
          <x:String>System.Collections.Generic</x:String>
          <x:String>System.IO</x:String>
          <x:String>System.Windows.Markup</x:String>
        </sco:Collection>
      </TextExpression.NamespacesForImplementation>
      <TextExpression.ReferencesForImplementation>
        <sco:Collection x:TypeArguments="AssemblyReference">
          <AssemblyReference>System.Activities</AssemblyReference>
          <AssemblyReference>ESRI.ArcGIS.Client</AssemblyReference>
          <AssemblyReference>Geocortex.Core</AssemblyReference>
          <AssemblyReference>Geocortex.EssentialsWpfApi</AssemblyReference>
          <AssemblyReference>Geocortex.Reporting</AssemblyReference>
          <AssemblyReference>Geocortex.Workflow</AssemblyReference>
          <AssemblyReference>Geocortex.Workflow.Activities</AssemblyReference>
          <AssemblyReference>System.Core</AssemblyReference>
          <AssemblyReference>System</AssemblyReference>
          <AssemblyReference>mscorlib</AssemblyReference>
          <AssemblyReference>System.ServiceModel</AssemblyReference>
          <AssemblyReference>WindowsBase</AssemblyReference>
          <AssemblyReference>PresentationCore</AssemblyReference>
          <AssemblyReference>PresentationFramework</AssemblyReference>
          <AssemblyReference>System.Xaml</AssemblyReference>
        </sco:Collection>
      </TextExpression.ReferencesForImplementation>
      <Sequence sap2010:WorkflowViewState.IdRef="Sequence_1" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
        <Sequence.Variables>
          <Variable x:TypeArguments="scg:IList(s2:Byte[])" Name="sources" />
          <Variable x:TypeArguments="s2:Byte[]" Name="result" />
          <Variable x:TypeArguments="x:String" Default="Output.pdf" Name="fileName" />
          <Variable x:TypeArguments="x:String" Name="partialUrl" />
          <Variable x:TypeArguments="gwr:RequestInfo" Name="requestInfo" />
          <Variable x:TypeArguments="s2:Byte[]" Name="pdf1Bytes" />
          <Variable x:TypeArguments="s2:Byte[]" Name="pdf2Bytes" />
          <Variable x:TypeArguments="s2:Byte[]" Name="pdf3Bytes" />
          <Variable x:TypeArguments="x:String" Default="gcxfile:///Workflow_Samples/Resources/Workflows/Workflow Test Files/" Name="filePath" />
        </Sequence.Variables>
        <gwa1:Alert sap2010:WorkflowViewState.IdRef="Alert_1" Text="[&quot;This activity combines PDF documents.&quot; + Environment.NewLine + Environment.NewLine + &quot;Supported from: Geocortex Essentials 3.11.&quot;]" Title="Merge PDFs" />
        <gwa1:CreateList x:TypeArguments="s2:Byte[]" sap2010:WorkflowViewState.IdRef="CreateList`1_1" Result="[sources]" />
        <gwa1:ReadFileBytes Bytes="[pdf1Bytes]" FileUri="[filePath + &quot;pdf1.pdf&quot;]" sap2010:WorkflowViewState.IdRef="ReadFileBytes_1" />
        <AddToCollection x:TypeArguments="s2:Byte[]" Collection="[sources]" DisplayName="AddToCollection&lt;Byte[]&gt;" sap2010:WorkflowViewState.IdRef="AddToCollection`1_1" Item="[pdf1Bytes]" />
        <gwa1:ReadFileBytes Bytes="[pdf2Bytes]" FileUri="[filePath + &quot;pdf2.pdf&quot;]" sap2010:WorkflowViewState.IdRef="ReadFileBytes_2" />
        <AddToCollection x:TypeArguments="s2:Byte[]" Collection="[sources]" DisplayName="AddToCollection&lt;Byte[]&gt;" sap2010:WorkflowViewState.IdRef="AddToCollection`1_2" Item="[pdf2Bytes]" />
        <gwa1:ReadFileBytes Bytes="[pdf3Bytes]" FileUri="[filePath + &quot;pdf3.pdf&quot;]" sap2010:WorkflowViewState.IdRef="ReadFileBytes_3" />
        <AddToCollection x:TypeArguments="s2:Byte[]" Collection="[sources]" DisplayName="AddToCollection&lt;Byte[]&gt;" sap2010:WorkflowViewState.IdRef="AddToCollection`1_3" Item="[pdf3Bytes]" />
        <gwa1:MergePdfs sap2010:WorkflowViewState.IdRef="MergePdfs_1" PdfSources="[sources]" Result="[result]" />
        <gwa1:CreateTempFile FileId="{x:Null}" Content="[result]" ContentType="application/pdf" FileName="[fileName]" sap2010:WorkflowViewState.IdRef="CreateTempFile_1" PartialUrl="[partialUrl]" TimeToLive="5" />
        <gwa1:GetRequestInfo sap2010:WorkflowViewState.IdRef="GetRequestInfo_1" RequestInfo="[requestInfo]" />
        <gwa1:DisplayHyperlink HyperlinkText="[fileName]" sap2010:WorkflowViewState.IdRef="DisplayHyperlink_1" Message="This sample workflow merged multiple PDF files from the Test Files directory. The merged PDF has been generated in a temporary file, accessible from this link." Target="_blank" Title="Merge PDFs" Uri="[requestInfo.ApplicationUri + &quot;/&quot; + partialUrl]" WorkflowContainerName="Default" />
        <sads:DebugSymbol.Symbol>d5QBQzpcUHJvZ3JhbSBGaWxlcyAoeDg2KVxMYXRpdHVkZSBHZW9ncmFwaGljc1xHZW9jb3J0ZXggRXNzZW50aWFsc1xEZWZhdWx0XFJFU1QgRWxlbWVudHNcU2l0ZXNcV29ya2Zsb3dfU2FtcGxlc1xSZXNvdXJjZXNcV29ya2Zsb3dzXFBERlxNZXJnZVBERnMueGFtbCxJA2IOAgEBTTRNQAIBA1M0U3oCAQJVBVXwAQIBPlYFVngCATtXBVeNAQIBNlgFWMABAgExWQVZjQECASxaBVrAAQIBJ1sFW40BAgEiXAVcwAECAR1dBV1uAgEYXgVe0QECAQ9fBV9rAgEMYAVgmwMCAQRVQFXaAQIBQFXhAVXtAQIBP1ZqVnUCATxXH1csAgE5VzVXWAIBN1g9WEgCATRYsAFYvQECATJZH1ksAgEvWTVZWAIBLVo9WkgCASpasAFavQECAShbH1ssAgElWzVbWAIBI1w9XEgCASBcsAFcvQECAR5dTl1ZAgEbXWFdawIBGV5LXlwCARdeZl5yAgEVXjRePgIBE17LAV7OAQIBEl6xAV6/AQIBEF9ZX2gCAQ1gdGCVAgIBC2CdAmClAgIBCmCPA2CYAwIBCWAqYDYCAQdgrAJguAICAQZgvQJg+AICAQU=</sads:DebugSymbol.Symbol>
      </Sequence>
      <sap2010:WorkflowViewState.ViewStateManager>
        <sap2010:ViewStateManager>
          <sap2010:ViewStateData Id="Alert_1" sap:VirtualizedContainerService.HintSize="330,86" />
          <sap2010:ViewStateData Id="CreateList`1_1" sap:VirtualizedContainerService.HintSize="330,61" />
          <sap2010:ViewStateData Id="ReadFileBytes_1" sap:VirtualizedContainerService.HintSize="330,86" />
          <sap2010:ViewStateData Id="AddToCollection`1_1" sap:VirtualizedContainerService.HintSize="330,22" />
          <sap2010:ViewStateData Id="ReadFileBytes_2" sap:VirtualizedContainerService.HintSize="330,86" />
          <sap2010:ViewStateData Id="AddToCollection`1_2" sap:VirtualizedContainerService.HintSize="330,22" />
          <sap2010:ViewStateData Id="ReadFileBytes_3" sap:VirtualizedContainerService.HintSize="330,86" />
          <sap2010:ViewStateData Id="AddToCollection`1_3" sap:VirtualizedContainerService.HintSize="330,22" />
          <sap2010:ViewStateData Id="MergePdfs_1" sap:VirtualizedContainerService.HintSize="330,86" />
          <sap2010:ViewStateData Id="CreateTempFile_1" sap:VirtualizedContainerService.HintSize="330,136" />
          <sap2010:ViewStateData Id="GetRequestInfo_1" sap:VirtualizedContainerService.HintSize="330,61" />
          <sap2010:ViewStateData Id="DisplayHyperlink_1" sap:VirtualizedContainerService.HintSize="330,243" />
          <sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="352,1561">
            <sap:WorkflowViewStateService.ViewState>
              <scg:Dictionary x:TypeArguments="x:String, x:Object">
                <x:Boolean x:Key="IsExpanded">True</x:Boolean>
              </scg:Dictionary>
            </sap:WorkflowViewStateService.ViewState>
          </sap2010:ViewStateData>
          <sap2010:ViewStateData Id="ActivityBuilder_1" sap:VirtualizedContainerService.HintSize="392,1641" />
        </sap2010:ViewStateManager>
      </sap2010:WorkflowViewState.ViewStateManager>
    </Activity>

    0
  • Nico Burgerhart

    Above the XML for a MergePDFs ample workflow. This is for Geocortex Esentials Workflow, or do you need a VertiGIS Studio Workflow sample?

    0
  • Chris Slavin

    Nico - Be great to see one for VertiGIS Studio Workflow. I have a Essentials workflow that creates a mapbook based on a user input graphic, need to update. 

    0
  • MBZ

    Nico Burgerhart: I know this is an old post, but a sample or samples of the PDF activities for VertiGIS Studio Workflow (JSON) would be fantastic if that is still possible? [thank you in advanced]

    0
  • MBZ

    Thank you Nico! 

    0

Please sign in to leave a comment.