There are two methods to register connectors with Power PDF:
Method #1: Register the connector into the COM system
In order for Power PDF to recognize your COM add-in, the program must insert its COM ProgId as a new subkey in the Windows registry under "HKEY_LOCAL_MACHINE\Software\Scansoft\Connectors".
- Note
- Scansoft Corp. was the former producer of the Power PDF products.
We use 'Scansoft' as the registry key name for compatibility reasons.
- Modify the .rgs file of the project to include the line below. Replace
XXXX.XXXX with the ProgID of your class.
HKEY_LOCAL_MACHINE { NoRemove Software { NoRemove ScanSoft { NoRemove Connectors { ForceRemove XXXX.XXXX } } } }
This will register the project as a PDF Connector during COM registration.
- Compile the project.
- In an administrator permission level command prompt, launch the following command:
>regsvr32.exe connectorname.dll
This command inserts the appropiate registry entries into the Windows registry.
To unregister the connector, launch this command:
>regsvr32.exe /u connectorname.dll
Method #2: Use side-by-side, registration-free COM
- The default setting in Visual Studio is to register the output COM dll automatically, so first switch this option OFF on the Project property -> Linker -> General page.
- Create a manfiest file which describes the COM class inside the connector dll file. Here is an example manifest file:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="myConnector" version="1.0.0.0" type="win32" processorArchitecture="x86"/>
<file name="myconnector.dll">
<comClass clsid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"
description="MyConnector Connector class"
threadingModel="apartment"
progid="myConnector.Connector.1">
<progid>myConnector.Connector</progid>
</comClass>
</file>
</assembly>
a. Add this XML content to a new text file, but replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with the actual clid of your class.
c. Save the file and rename it to MyConnector.manifest.
d. Add this file to the project into the "Resource Files".
- Attention
- It is important that the connector ProgId must be the name of the DLL file (without the path and the extension) followed by the '.Connector' literal. For example: "FTPConnector.Connector" "SharePoint.Connector"
- Compile the project.
- Copy the connector dll file into the [Power PDF install folder]\bin\Connectors subfolder. (For example
"c:\Program Files (x86)\Kofax\Power PDF\bin\Connectors").
- Note
- The connectors which we provide with the Power PDF products also use this side-by-side method.
Display the connector on the Connectors ribbon tab
To make connector buttons visible in the Connectors ribbon tab, follow these steps:
- Open the
Publish Mode.xml file located in the "[Power PDF install folder]\Resource\PowerPDF\UILayout" subfolder.
- Add a '
PFFGroup' element to the 'Connectors' ribbon tab to represent your connector and to contain the actual buttons displayed on the user interface for that connector.
- Ensure that the name property of this element has the following structure: '
connector::' prefix and the actual name of your connector. There is one 'PFFGroup' element associated with every single connector.
- Within '
PFFGroup', create as many elements as the number of Menu Items your defined by your connector. Every menu item inside your connector's 'PFFGroup' is represented by a single 'PFFButton'.
- Ensure that the '
name' property of a 'PFFButton' is composed following this pattern:
- The '
connector::tool::' prefix
- The name of your connector
- The '
:menuItem' string and an incrementing number starting with 0 for the first 'PFFButton'.
An example:
<toolbar name="connectors" shortKey ="N">
...
<PFFGroup name="connector::myConnector" GroupType="PFFTitleBlock" autoZip="0">
<PFFButton name="connector::tool::myConnector:menuItem0"/> <!--Button for "Open" menu item. -->
<!--the index number at the end of the name of the button does not match the ID of the menu item in your code. It is an incrementing number starting with 0. -->
<PFFButton name="connector::tool::myConnector:menuItem1"/> <!--Button for "SaveAs" menu item -->
<PFFButton name="connector::tool::myConnector:menuItem2"/> <!--Button for 3rd manu item of your connector if there is such, for example 'Document Properties' -->
</PFFGroup>
...
</toolbar>
- Check if
"%appdata%\Kofax\PDF\PowerPDF\UILayout\Publish.xml" exists and delete it.
Test if Power PDF could succesfully load the connector
For a basic functionality, the connector have to implement the following functions:
The simplest method to test if the connector is succesfully loaded: check if connector exists under the "Open from DMS" drop-down list in File/Open dialog.
- Note
- During the installation of the connector, you have to make sure that the correct Microsoft Visual C++ Redistributable package is also installed on the system.