Hello,
I'm currently evaluating your Driver API SDK V5 for creating PDF output from our ECAD application.
I have some problems compiling and running your C# example "PDFdriverAPI" in following environment:
- Windows 7 Pro
- Microsoft Visual Studio 2015 Express 2015 for Windows Desktop
- .NET Framework 4.0
Problem 1: Compiler error with framework 4.0:
At line 52: PDFPrinter = (PXCComLib5.CPXCPrinter)prnFactory.get_Printer("", "Simple PDF-XChange 2012", "<REG CODE>", "<DEV CODE>");
error CS0656: Missing compiler required member "Microsoft.CSharp.RuntimeBinder.Binder.Convert"
This compiler error is not raised under .NET 3.5 or below. But our application requires .NET 4.0.
Is this a known problem and if so can an update be expected in the near future?
Problem 2: "System.BadImageFormatException" with "Interop.PXCComLib5" when starting the app
When using a COM reference to "PDF-XChange Printer 2012 Type Library" in the project (as your example does) the generated Interop assembly "Interop.PXCComLib5.dll" has a size of 18 KB in contrast to 28 KB of your version of the same file which is delivered with your installed example. If I replace the COM reference with a direct assembly reference to your delivered version of "Interop.PXCComLib5.dll" the demo application runs fine under .NET 3.5 or below. (I yust copied "Interop.PXCComLib5.dll" into my bin\Debug folder with no additional files).
Do you have any idea why the COM reference creates this strange behaviour?
Thank you in advance,
Siegfried Eineder
COMSA GmbH
Error compiling C# example under .NET Framework 4.0
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- User
- Posts: 2
- Joined: Thu Dec 10, 2015 8:32 am
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Error compiling C# example under .NET Framework 4.0
Hello comsa_se,
As for the problem 1, try this code:
As for the second problem - we are investigating it and will give you an answer shortly.
HTH
As for the problem 1, try this code:
Code: Select all
PXCComLib5.CPXCPrinter PDFPrinter = prnFactory.get_Printer("", "Simple PDF-XChange 2012", "<REG CODE>", "<DEV CODE>") as PXCComLib5.CPXCPrinter;
HTH
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- Site Admin
- Posts: 306
- Joined: Sun Nov 21, 2004 3:19 pm
Re: Error compiling C# example under .NET Framework 4.0
Hello comsa_se,
As to the problem 2, please make sure it is not a deployment error.
Check if both the target assemblies (PDFdriverAPI.exe and Interop.PXCComLib5.dll) are compatible by "bitness".
You can verify this with CorFlags utility from your .Net framework SDK.
Both
CorFlags.exe PDFdriverAPI.exe
and
CorFlags.exe Interop.PXCComLib5.dll
should show the same CorFlags value.
As to the problem 2, please make sure it is not a deployment error.
Check if both the target assemblies (PDFdriverAPI.exe and Interop.PXCComLib5.dll) are compatible by "bitness".
You can verify this with CorFlags utility from your .Net framework SDK.
Both
CorFlags.exe PDFdriverAPI.exe
and
CorFlags.exe Interop.PXCComLib5.dll
should show the same CorFlags value.
-
- User
- Posts: 2
- Joined: Thu Dec 10, 2015 8:32 am
Re: Error compiling C# example under .NET Framework 4.0
Hello Sasha and Roman,
your hints perfectly solved my problems - thank you!
The demo program now works as expected and I'm starting to include PDF printing code into my applicationn.
Best regards,
Siegfried
your hints perfectly solved my problems - thank you!
The demo program now works as expected and I'm starting to include PDF printing code into my applicationn.
Best regards,
Siegfried
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
Re: Error compiling C# example under .NET Framework 4.0
Glad to hear that
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ