Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Export the Diagram (Read 10033 times)
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Export the Diagram
Sep 9th, 2009 at 7:18am
Print Post  
HI
i am using diagram light control , i need export my diagram like pdf or some  image format
how to do ? we are evaluvating u r control
pls send the code for this one

thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export the Diagram
Reply #1 - Sep 9th, 2009 at 8:26am
Print Post  
The SaveLoad sample project shows how to transfer the diagram to the server. On the server side add a reference to the common, diagramming, pdf and diagramming.export.pdf assemblies form this package:
https://www.mindfusion.eu/NetDiagramTrial.zip

Then following the SaveLoad approach, load the string submitted from the client side and export it -

Code
Select All
var str = Page.Request.Form["serializedDiagram"];
if (str.Length > 0)
{
	var d = new Diagram();
	d.LoadFromString(str);
	new PdfExporter().Export(d, "test.pdf");
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Export the Diagram
Reply #2 - Sep 9th, 2009 at 10:53am
Print Post  
HI stoyo
Really thanks fr that example , i want to save the diagram Image also
for ex , if i select BMp iamage then i want to save the diagram as image format .. how to do that one 

thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export the Diagram
Reply #3 - Sep 9th, 2009 at 11:16am
Print Post  
Hi,

You can do that by calling Diagram.CreateImage to get a System.Drawing.Image representing the diagram, and then call the Image.Save method. Image.Save supports BMP, PNG, JPG and GIF formats.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Export the Diagram
Reply #4 - Sep 9th, 2009 at 12:15pm
Print Post  
hi
My dll Version is 1.0.2.28644 . in this dll dont have create image  method ,
pls send thee updated dll and sensd thye sample code also  it is very helpful for me .
Thanks

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export the Diagram
Reply #5 - Sep 9th, 2009 at 12:38pm
Print Post  
This is available only in the diagramming.dll on the server side.
  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Export the Diagram
Reply #6 - Sep 9th, 2009 at 2:38pm
Print Post  
hi

I am really confusing about exporting the diagram ,
i need source code for export the diagram in to Image format, i am using Silverlight 3.0
pls send  becausse i ma very new for Diagrmlight and Sl

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export the Diagram
Reply #7 - Sep 10th, 2009 at 1:46pm
Print Post  
Here is an example that exports to PDF and PNG:
https://mindfusion.eu/_samples/diaglite_export.zip
« Last Edit: Sep 10th, 2009 at 3:00pm by Stoyo »  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Export the Diagram
Reply #8 - Sep 14th, 2009 at 8:17am
Print Post  
Hi

I want to export the diagram why i have to go Server side, i need to do xaml it self. also
i have to open save file diagloue box there which  format  i selected  (like BMP or Jpeg)   save that image in selected format. and  the diagram should not move from the control it shold show as usual full diagram like before .
pls send the examples

thanks in advance
Murugan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export the Diagram
Reply #9 - Sep 14th, 2009 at 9:32am
Print Post  
Hi,

There is no Jpeg or Bmp encoder available in the Silverlight API, so you can't export in these formats on the client side. There is only the diagram.SaveToPng method that lets you save to PNG files.

You might be able to export to Xaml using these tools, but we haven't tried them:
http://slextensions.codeplex.com/
http://weblogs.asp.net/mehrantoosi/archive/2008/03/03/silverlight-s-xamlwriter.a...

Stoyan
  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Export the Diagram
Reply #10 - Sep 14th, 2009 at 9:53am
Print Post  
HI

I  am doing in server side the problem is i  am pop up ing Save Dialoue Window then call the server side
i completed drawing  first time it self. that time drawing is not avalilable in saved image file also.
also it is clearing the drawing in Diagramlight also. while Exporting i dont want to cleear the diagram it should be in the same page
now it is going calling page
how to do this one




Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export the Diagram
Reply #11 - Sep 14th, 2009 at 10:46am
Print Post  
Hi,

This is shown in the SaveLoad example that comes with DiagramLite. There the diagram content is saved as a string in a HIDDEN html element and reloaded after postback, using the SaveToString and LoadFromString methods.

Of course you can do that without a postback, but by calling a service method that takes the SaveToString result as an argument, loads it inside a server-side Diagram and exports to image / PDF, and finally returns an URL to the exported file. Thus you could export the diagram and open the result without reloading the page.

Stoyan
  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Export the Diagram
Reply #12 - Sep 15th, 2009 at 5:18pm
Print Post  
HI
Thanks I did like that, image is saved in that particular location , But The Drawing image is not there  because WHile Saving Saveto tsring method i checked No Nodes and Nolinks
i am anot draw the diagram in programatiically i created the Diagram , ShapeNode and Diagramlinks are inherited  and i ma drawing

what is the Problem ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export the Diagram
Reply #13 - Sep 15th, 2009 at 5:54pm
Print Post  
Hi,

Could you email to support@mindfusion.eu your modified SaveLoad example? Have you defined the custom classes on the server side too?

Stoyan
  
Back to top
 
IP Logged
 
Sachin
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 85
Joined: Mar 14th, 2009
Re: Export the Diagram
Reply #14 - Sep 15th, 2009 at 5:57pm
Print Post  
HI

Already i posted to HelpDesk  i ddnt get any replay

i forget Ticket ID  My email id is murugan@lightpharma.com
today i posted
pls i am waiting for the replay
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint