Move PDF-XChange assemblies in to a different directory  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
User avatar
Shaun Luttin
User
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

Move PDF-XChange assemblies in to a different directory

Post 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?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post 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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
Shaun Luttin
User
Posts: 20
Joined: Tue Apr 17, 2018 12:13 am

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

Post 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>
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

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

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply