PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Jul 19, 2024 5:29 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Nov 02, 2011 5:22 pm 
Offline

Joined: Wed Nov 02, 2011 5:07 pm
Posts: 1
I noticed that the latest version was last updated in 2009. Will there be another update anytime soon? Specifically, all the solution files in PDFSharp-MigraDocFoundation-1_31.zip are for VS 2008 and 2005. I use VS 2010, but when I convert the projects (BuildAll-PdfSharp.sln and BuildAll-MigraDoc-WPF.sln and BuildAll-MigraDoc-VS2008.sln), they no longer compile. There's a long list of errors, and if needed, I can post them.

Replies are appreciated. :)


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 03, 2011 8:09 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
There will be an update (but I don't know when). It will include project files for VS 2010.

We use PDFsharp/MigraDoc with VS 2010 and I don't recall real problems during the conversion.

When I have to deal with compilation errors, I always look at the Output window of VS and address the first error that shows up. If you need help, feel free to post the contents of the Output window here (after Rebuild All).

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 17, 2011 2:52 pm 
Offline

Joined: Thu Nov 17, 2011 2:27 pm
Posts: 1
Hi Mia,

I am brand new to pdfsharp and I use VS2010. I have not built MigraDoc, but I have successfully built pdfsharp, so perhaps my comments will help.

Here is what I did to successfully get it running:

(Note: I am using PDFSharp version 1.31)

1. Opened the BuildAll-PdfSharp.sln file with VS2010.
2. Of course the VS2010 upgrade wizard started up. I let it do the conversion and got no errors.
3. But things did not build. I did what Thomas suggested, which was to examine the first errors in the VS2010 output window. I then googled that error message, and quickly found the fix. More on that below.

I also changed the .Net Framework to 4.0 with no problem.

Now as to the file I changed. I think that the only issue I had to fix was in the PDFsharp\code\PdfSharp\PdfSharp.Drawing\XFontFamily.cs file.

The compilation occurred on this line (line 266):

Code:
System.Drawing.FontFamily[] families = null;


I found the answer at this URL: viewtopic.php?f=2&t=903&p=2332&hilit=GetFamilies#p233

Specifically, in the post by user "MarcelW" which was posted at Thu Mar 31, 2011 4:53 pm (not sure of TZ; my TZ is EST)

So I changed that one line above to the following:

Code:
// VS2010 compilation warning.
// Fixed based on info on http://forum.pdfsharp.net/viewtopic.php?f=2&t=903&p=2332&hilit=GetFamilies#p2332
// BWW 11/14/2011
#pragma warning disable 618
            families = System.Drawing.FontFamily.GetFamilies(graphics.gfx);
#pragma warning restore 618


Hope this helps!

Now, I'm off to try to find info on how the whole coordinate system thing works in PDFSharp!


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 05, 2011 1:39 pm 
Offline

Joined: Mon Dec 05, 2011 1:22 pm
Posts: 4
Location: Durban, South Africa
That's a nice elegant "non" fix.
I didn't find that till I had done some hacking of my own.
This seems to work...
replace the line
Code:
families = System.Drawing.FontFamily.getFamilies(graphics.gfx);

with the line
Code:
families = System.Drawing.FontFamily.Families;

and the project compiles.

I cannot guarantee that it's the correct fix, but it is A fix..
All the best
John


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 43 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