PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed May 01, 2024 2:53 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: COM Visibility
PostPosted: Tue Jun 08, 2010 6:19 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
I'm trying to compile PDFSharp as a COM Visible assembly so I can use the assembly in C++. I get the following error about Ambiguous Names when the compiler is trying to create the type lib:

c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3019,9): error MSB3212: The assembly "C:\Documents and Settings\jccapps\Desktop\PDF\PDFSharp-MigraDocFoundation-1_31\PDFsharp\code\PdfSharp\bin\Debug\PdfSharp.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'PdfSharp.Pdf.Content.Objects.OpCodeName.B, PdfSharp'. Error: Ambiguous name

Does anybody know a way around this problem?

Thanks
Craig


Top
 Profile  
Reply with quote  
 Post subject: Re: COM Visibility
PostPosted: Tue Jun 08, 2010 7:06 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
I might have an anwser to my own question. There is a file called OpCodeName.cs. Inside of this file is an enum that has several different values in it that conflict case wise (i.e. B and b). I changed the enum to where the names of each value is unique based on name instead of on case. So now instead of having "B" and "b", I have "upB" and "b". There where several others like this in the enum. Once I got this changed there were several more errors where I had to go fix the names in the Operators.cs file, but the compiler caught all of these and they were really simple to find and fix.

It all compiles. Now it is time to see if it will work.

Craig


Top
 Profile  
Reply with quote  
 Post subject: Re: COM Visibility
PostPosted: Tue Jun 08, 2010 10:06 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
Has anybody out there used PdfSharp in the context of native c++?

I was able to cocreate an instance of _PdfDocument in my c++ class, but intellisence and the com\ole viewer do show any methods associted with _PdfDocument. Hmm... I tired to create an instance of PdfDocument but returned an error saying that "myvariable uses undefined struct 'PdfSharp::PdfDocument'.

Can PdfSharp even be used from native c++?


Top
 Profile  
Reply with quote  
 Post subject: Re: COM Visibility
PostPosted: Wed Jun 09, 2010 7:51 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3097
Location: Cologne, Germany
jccapps wrote:
Can PdfSharp even be used from native c++?

That's not my area of expertise.
I wouldn't try that and use a different approach.

I'd create an assembly using managed code (C# or C++) to create the documents.
I'd call this assembly from COM, giving it an interface as small as possible.

In the best case you'll need one COM call only to create a complete document.
You can pass all required data in a single CSV or XML string, or use a user-defined structure.
Or create the document using MDDDL in C++ and pass that to the managed code.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: COM Visibility
PostPosted: Wed Jun 09, 2010 1:30 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
Thanks!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 62 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group