Pando Automation Toolkit

Pando makes it easy for applications to send packages using Pando. For example, a chat application can use Pando to send video files, or a photo organizer to use Pando to send photo albums to friends and family.

If you are interested in distributing Pando with your application, please contact us.

There are two integration options, opening a pando:send URL or making an automation call.

pando:send URL

The easiest mechanism is have your application add a button to send packages using Pando, where Pando does the actual sending (sending the email, send to web, etc.). See One-click Pando packages with pando:send for details and code examples.

This is supported on both Mac and Windows.

Sending via Automation API

If you want your application take care of the sending, such as through a private chat network, posting to a web site, or incorporating into your own emails, we provide PDEmailInterface COM. This allows your application to call Pando to package files, returning the Package URL for you to use.

When your application receives Pando packages, such as through a private chat network or web page, you simply open the file or URL and we'll take care of the rest of the download. For more details, see Downloading Pando Packages.

If you want to control the entire user experience, contact us about the Pando Client Integration Toolkit.

Supported Versions

PDEmailInterface COM is supported in Pando version 1.4.5 and newer, Windows only.

Identical functionality will be provided for Mac OS X by an AppleEvents API in a future release of Pando.

PDEmailInterface COM Object

The PDEmailInterface COM Object provides an interface allowing Windows applications to detect the presence of Pando and integrate Pando file sending.

Functions

The PDEmailInterface COM object provides the following functions:

SendLink

SendLink is used to have Pando package and upload a set of files. It returns the Pando Package URL, which can be sent by the application to recipients. For example, it can be sent via an instant messaging network. The call returns when Pando packaging is complete, which typically takes several seconds. Uploading will continue asynchronously until complete.


        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SendLink( 
            /* [in] */ ULONG hWndParent,
            /* [in] */ VARIANT *filePaths,
            /* [out] */ BSTR *url) = 0;

The arguments are:

hWndParent
parent window (always passed in COM calls).
filePaths
an array of file paths of the files to package.
url
the Pando Package URL.

SetPluginVersion

SetPluginVersion is called in order to identify the calling application.


        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetPluginVersion( 
            /* [in] */ BSTR name,
            /* [in] */ BSTR version) = 0;

The arguments are:

name
The name of the application.
version
The version of the application.

Examples

Here are examples of using the PDEmailInterface COM object from C++ and Visual Basic. Note that the SendLink method is provided only by pando.PDEmailInterface version 2 or newer. Thus, if "pando.PDEmailInterface.2" cannot be created, either Pando is not installed or it must be upgraded.

C++

{
try {
    CComPtr pando;
    //the create object will fail if Pando is not installed
    if(SUCCEEDED(pando.CoCreateInstance(L"pando.PDEmailInterface.2")) && pando)
    {
        // use this to initialize the dialog with a set of files
        // Create a SAFEARRAY to hold the list of files //
        SAFEARRAY      *pArray;
        SAFEARRAYBOUND bounds;
        bounds.cElements = arrayFilenames.GetSize();
        bounds.lLbound   = 0;
        pArray = SafeArrayCreate(VT_BSTR, 1, &bounds);
        // Initialize the SAFEARRAY with the filenames //
        if(!pArray)
            break;

        for(long ii = 0; ii < arrayFilenames.GetSize(); ii++)
            //arrayFilenames is your array of filenames
            SafeArrayPutElement(pArray, &ii, CComBSTR(arrayFilenames[ii])); 
        VARIANT var;
        VariantInit(&var);
        var.vt = VT_ARRAY | VT_BYREF | VT_BSTR;
        var.pparray = &pArray;
        
        // You MUST set this to a unique value for Your Application
        pando->SetPluginVersion(CComBSTR("MyAppName"), CComBSTR(""));
        CComBSTR url;
        if (SUCCEEDED(pando->SendLink(m_hWnd, &var, &url)) SendLink(m_hWnd, NULL, &url)
        {
           //use the http:// url to the pando file 
           //prepend pando:download? to make it a Pando URL
        }
        VariantClear(&var);// for the file list
    }
}catch(...){}

}

Visual Basic

{
    Dim strPaths(1 To 3) As String
    Dim pandoPath As String
    strPaths(1) = "C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-006.jpg"
    strPaths(2) = "C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-011.jpg"
    strPaths(3) = "C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-018.jpg"
    Dim pds As Object
    Set pds = CreateObject("pando.PDEmailInterface.2")
    Dim strUrl As String
    'You MUST set this to a unique value for Your Application
    pds.SetPluginVersion "MyApplicationName", ""
    pds.SendLink MyForm.hWnd, strPaths, strUrl
    'strUrl is the http path to the .pando file
    'prepend pando:download? to create a Pando URL
    MsgBox strUrl
}

.Net


PDEmailInterface pandoAPI = new PDEmailInterfaceClass();
object strPaths = new string[] {
    @"C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-006.jpg",
    @"C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-011.jpg",
    @"C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-018.jpg" };
// You MUST set this to a unique value for Your Application
pandoAPI.SetPluginVersion("MyApplicationName", "");
string strUrl;
pandoAPI.SendLink((uint)this.Handle, ref strPaths, out strUrl);
// strUrl is the http path to the .pando file
// prepend pando:download? to create a Pando URL
MessageBox.Show(strUrl);