| Alasdair 的个人资料alasdair's brain dump日志列表网络 | 帮助 |
|
|
2009/2/24 Adventures with .NET and COMI was working with PDFCreator and downloaded the 0.9.7 release. It refused to install the pdfforge .NET dll because it said I hadn’t got .NET 1.1. Well, as most .NET 1.1 assemblies will run happily in .NET 2.0, I thought I’d have a go with it. I got the pdfforge dll and test scripts from SourceForge and tried the scripts. No dice. So next I looked at the assembly in Reflector and found an unresolved reference to iTextSharp, which also thinks its a .NET 1.1 assembly. The plot thickens though, as when I got the iTextSharp DLL, it still wouldn’t load it. It turns out that in the comments in SVN, the pdfCreator guys did say they built iTextSharp from source, and they’re reference is to v 4.1.2.1 without a strong name, whereas the latest release binary of iTextSharp is 4.1.2.0 with a strong name. In order to get them to “talk” I needed to either change the reference baked in to pdfforge.dll or change the assembly version baked in to iTextSharp (and remove it’s strong name), or build iTextSharp from source… Well, enter the Reflexil add-in for Reflector. Wow! With this I had a choice – it’ll let me fiddle with assembly versions, strip strong names, fiddle with assembly references, even hack the code & save it back. Get it from SourceForge.
So, with my demo code running nicely in c#: using System; using pdfforge.PDF; namespace AcsComms { class Program { static void Main( string[] args ) { PDF pdf = new PDF(); pdf.CreatePDFTestDocument( @"C:\Temp\PDF\Testy.PDF", 1, "Have at it, matey!" ); } } } I tried to RegAsm the pdfforge.dll. Two gotchas here.
So now I can just double-click on the demo .vbs scripts and they work just fine! |
|
|