PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Jul 13, 2024 8:38 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
PostPosted: Thu Mar 11, 2010 2:23 pm 
Offline

Joined: Thu Mar 11, 2010 2:16 pm
Posts: 9
Hi there,

When i apply a RTF document renderer to the MigraDoc document on the sample "HelloMigraDoc", the resulting rtf document doesnt contains the chart.

I try to figure it out but i cannot understand. The MigraDoc.RtfRendering project has a ChartRenderer, that i already tested and it is called while rendering the document.

Is there a reasonable explanation for that? Like a bug? =P

Regards,
Joel


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 11, 2010 4:25 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi, Joel!
don4ld wrote:
Like a bug? =P

Could be a bug, could be an implementation limitation ...

MigraDoc includes the following code (in Chartrenderer.cs, Method "bool StoreTempImage(string fileName)"):
Code:
#if true
        XGraphics gfx = XGraphics.CreateMeasureContext(new XSize(horzPixels, vertPixels), XGraphicsUnit.Point, XPageDirection.Downwards);
#else
#if GDI
        XGraphics gfx = XGraphics.FromGraphics(Graphics.FromImage(bmp), new XSize(horzPixels, vertPixels));
#endif
#if WPF
        // TODOWPF
        XGraphics gfx = null; //XGraphics.FromGraphics(Graphics.FromImage(bmp), new XSize(horzPixels, vertPixels));
#endif
#endif


Maybe it'll work like this (GDI build only):
Code:
#if GDI
        XGraphics gfx = XGraphics.FromGraphics(Graphics.FromImage(bmp), new XSize(horzPixels, vertPixels));
#endif
#if WPF
        // TODOWPF
        XGraphics gfx = null; //XGraphics.FromGraphics(Graphics.FromImage(bmp), new XSize(horzPixels, vertPixels));
#endif


I won't be able to try it this week.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 11, 2010 5:30 pm 
Offline

Joined: Thu Mar 11, 2010 2:16 pm
Posts: 9
Thank you for the answer.

Well i have tried it by removing all the preprocessor directives and it works.
You said that it just works for GDI, so I need to ask: You are rendering a document object model to a specific file format, pdf or rtf, so why does wpf and gdi matter at this level of the code? Shouldnt it just matter for visual components, like document preview?

Another thing I would like to comment is if couldnt it be more elegant PdfSharp.Drawing (specifically Xgraphic and associated classes) being independent of PDF and and RTF, as you use it inside the RTF Renderer. I'm seeing it more like another renderer, but for images, that could be called by the RTF or PDF renderer to render and return a image.

Congratulations for this really cool stuff you've done ;)

Regards,
Joel


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 30, 2011 4:54 am 
Offline

Joined: Fri Sep 30, 2011 4:35 am
Posts: 1
Hi there,

We have recently attempted to render charts to both PDF and RTF using the version 1.31 compiled assemblies. Currently we are able to render the chart correctly in PDF, however when rendering to RTF, the chart is rendered to the screen and not to the document. I was wondering if a fix will be available for the complied assemblies in the near future? We're using the GDI impliementation.

I have attempted to recompile the source code using Visual Studio Express 2010 C3 without success.

Kind regards,

Cliff


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 04, 2011 8:16 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi!
cliff wrote:
I have attempted to recompile the source code using Visual Studio Express 2010 C3 without success.
How can we help you if you don't include error messages?

AFAIK you can recompile PDFsharp without VS, using the MSBUILD.EXE from the .NET directory.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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 66 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