PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Jun 27, 2017 8:45 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: Fri Aug 14, 2015 7:42 am 
Offline

Joined: Fri Aug 14, 2015 7:27 am
Posts: 2
Hello,
we would like to generate a pdf-file out of a unity3D game, but there is the well known problem that unity doesn't like the System.Windows.Forms.dll - as far as we can see now.
Is there any way to get pdfSharp running without this dll, i.e. compile it with Mono and the unity specific restrictions?

Actually, it doesn't really matter if such a solution would rely on GDI+ or WPF. We are just wondering, if there's any way at all to do this.

Any hint is appreciated!

Regards
nvf33


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 01, 2015 7:51 am 
Offline

Joined: Fri Aug 14, 2015 7:27 am
Posts: 2
We managed to solve the issue, essentially in three steps:
1. Recompile the pdfSharp assemblies from source AFTER deleting all sources containing System.Forms references (very simple: they're all in the source folder PdfSharp.Forms)
Now you can try it in the Unity editor, which automatically loads all necessary & compatible dlls. Outside the editor you need to manually add them to the project:

2. Find a compatible System.Drawing.dll, see http://answers.unity3d.com/questions/53170/using-drawing-package-like-systemdrawing.html for details, it should be somewhere here in the editor: %Unity Folder%\Editor\Data\Mono\lib\mono\2.0 . For Mac support you'll need some extra efforts.

3. Add the internationalization dlls from the editor libs (see 2.) as described here (I18N.dll e.g.) : http://answers.unity3d.com/questions/42955/codepage-1252-not-supported-works-in-editor-but-no.html

The only thing which doesn't work is web player support, but there may be an pdfsharp update in near future for that.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 07, 2017 10:03 am 
Offline

Joined: Sun May 07, 2017 9:55 am
Posts: 1
Hi NVF33,
I read your instruction but I then got an error when running the Hello World script using the function Xgraphics.DrawString.
I'm getting an error
error CS0012: The type `System.Drawing.PointF' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Drawing, Version=2.0.0.0, Culture=neutral, '

Any idea what I can do?

Thanks in advance!


Top
 Profile  
Reply with quote  
PostPosted: Mon May 08, 2017 11:35 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2664
Location: Cologne, Germany
Hi!
MrShneebli wrote:
I'm getting an error
error CS0012: The type `System.Drawing.PointF' is defined in an assembly that is not referenced. Consider adding a reference to assembly `System.Drawing, Version=2.0.0.0, Culture=neutral, '
Any idea what I can do?
How about adding that reference? Have you tried that?

That is a normal compiler error message. When you add a reference to library A and lib A uses types from library B in public methods then you also have to reference library B. This is not specific to Unity3D.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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: Bing [Bot], Google [Bot] and 2 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:  
Powered by phpBB® Forum Software © phpBB Group