Page 1 of 1

Move PDF-XChange assemblies in to a different directory

Posted: Tue Apr 17, 2018 12:21 am
by Shaun Luttin
We would like to put the PDF-XChange assemblies in to a different directory.

Here is some context for what we have tried. We installed the PDF-XChange Editor SDK (https://www.pdf-xchange.com/produc ... editor-sdk). We then added the AxPDFXEdit and PDFXEdit COMReferences to our project.

Code: Select all

<COMReference Include="AxPDFXEdit">
      <Guid>{0AAFF38C-CB91-4424-A8B9-F8B504ACBE0C}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>aximp</WrapperTool>
      <Isolated>False</Isolated>
    </COMReference>
    <COMReference Include="PDFXEdit">
      <Guid>{0AAFF38C-CB91-4424-A8B9-F8B504ACBE0C}</Guid>
      <VersionMajor>1</VersionMajor>
      <VersionMinor>0</VersionMinor>
      <Lcid>0</Lcid>
      <WrapperTool>tlbimp</WrapperTool>
      <Isolated>False</Isolated>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </COMReference>
We then built and ran a project that has the following test code:

Code: Select all

var someAxPdfxObject = new AxPDFXEdit.AxPXV_Control();
var somePdfxObject = new PDFXEdit.PXC_Point();
That's all good; both namespaces are available; we've reference the assemblies; things are working.

Now we want to change the directory that contains the COM references. As far as we can tell, those COMReferences resolve to C:\Program Files (x86)\Tracker Software\Editor SDK\Bin. We would like to move those COMReferences to a different directory e.g. C:\FooBar. The usual process of copying the everything in C:\......\SDK\Bin to C:\FooBar and then running regsvr32 is not working.

Suggestions?

Re: Move PDF-XChange assemblies in to a different directory

Posted: Tue Apr 17, 2018 6:40 am
by Sasha - Tracker Dev Team
Hello Shaun,

1) When you are using the AxPDFXEdit (IPXV_Control on form) then you don't need to reference the PDFXEdit, though it's not crucial.
2) If you are using regsvr32, make sure, that you are launching the command prompt with the Administrator privileges.
3) Make sure that you are registering the dll of the correct version and do not use the Any CPU option in your project.

Cheers,
Alex

Re: Move PDF-XChange assemblies in to a different directory  SOLVED

Posted: Mon Apr 23, 2018 11:31 pm
by Shaun Luttin
The problem was that we had not set up the COM references properly. The solution was to take the following steps (which are more thorough than necessary in order really to be sure that they work.)

1. Install the PDF-XChange Editor SDK from https://www.pdf-xchange.com/produc ... fileid=636

Choose Custom Install
Install to C:/temp/PDFXChangeEditorSDK (or some other place)
Only the SDK Files are necessary (not the samples)

2. Open regedit. Ensure a data entry is present for PDFXEditCore.x86.dll at C:/temp/PDFXChangeEditorSDK/bin/...

3. Copy the following installed files to C:/MyApplication/ExternalLibs/PDFXChangeEditorSDK

PDFXEditCore.x86.dll
PDFXEditCore.x86.tlb
Resources.dat
Languages/

4. Uninstall PDF-XChange Editor SDK from the windows control panel.

5. Open regedit. Ensure a data entry is NO LONGER present for PDFXEditCore.x86.dll

6. Register the MyApplication external libs.

regsvr32 "C:/MyApplication/ExternalLibs/PDFXChangeEditorSDK/PDFXEditCore.x86.dll"

7. Open regedit. Ensure a data entry is AGAIN present for PDFXEditCore.x86.dll but now at C:/MyApplication/ExternalLibs/...

8. Open MyApplication.sln in Visual Studio.

9 Right click on MyApplication.csproj | Add Reference | COM | PDF Exchange Editor Type Library | Check | OK

Unload and edit MyApplication.csproj

Copy the COMReference for PDFXEdit, paste it directly above itself, and modify it so we have the following two entries.

<COMReference Include="AxPDFXEdit">
<Guid>{0AAFF38C-CB91-4424-A8B9-F8B504ACBE0C}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>aximp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>False</EmbedInteropTypes>
</COMReference>
<COMReference Include="PDFXEdit">
<Guid>{0AAFF38C-CB91-4424-A8B9-F8B504ACBE0C}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>

Re: Move PDF-XChange assemblies in to a different directory

Posted: Tue Apr 24, 2018 5:46 am
by Sasha - Tracker Dev Team
:)