Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Export to pdf (Read 2771 times)
Mohammad
YaBB Newbies
*
Offline


Hello everybody :)

Posts: 32
Joined: Oct 2nd, 2009
Export to pdf
Nov 19th, 2009 at 4:21am
Print Post  
Hi

I'm using my own ShapeLibrary witch has images inside shapes. for example:

Code
Select All
<?xml version="1.0" encoding="utf-8"?>
<shapes xmlns="http://mindfusion.org/flowchart">
  <shape id="Start" fill-mode="Winding">
    <outline>
      <round-rectangle x="0" y="0" w="100" h="100" r="8" dash-style="Custom" width="-1" border="0"/>
    </outline>
    <decorations />
    <image x="0" y="0" width="100" height="100" src="..\..\images\Campaign\Element_Start.png" />
  </shape>
</shapes>
 



Everything is fine and I can drag an drop nodes from shapeListBox to diagramView and it works.
But when I export the diagram to pdf it doesn't export images and just shows empty nodes in pdf.

here is my export code:

Code
Select All
MindFusion.Diagramming.Export.PdfExporter pdf = new MindFusion.Diagramming.Export.PdfExporter();

string path = Server.MapPath(@"~\PDF\") + Session.SessionID + ".pdf";

pdf.Export(diagramView.Diagram, path);
 



I work in JavaApplet mode.
What's wrong in this senario? Thanks.
« Last Edit: Nov 19th, 2009 at 10:55pm by Mohammad »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export to pdf
Reply #1 - Nov 19th, 2009 at 8:25am
Print Post  
Does it work if you call ShapeLibrary.LoadFrom(shapelib_Path) before exporting?
  
Back to top
 
IP Logged
 
Mohammad
YaBB Newbies
*
Offline


Hello everybody :)

Posts: 32
Joined: Oct 2nd, 2009
Re: Export to pdf
Reply #2 - Nov 19th, 2009 at 8:32am
Print Post  
It's been loaded by shapeLibrary component based on shapeLibraryLocation property and I don't load it manualy in code. It's been loaded successfully and I can work with the nodes without any problem. But the exporter component can't export it to Pdf.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export to pdf
Reply #3 - Nov 19th, 2009 at 11:12am
Print Post  
Have you set ShapeLibraryLocation on the DiagramView, or only on the ShapeListBox? In the latter case the shapes might not be loaded automatically on the server side if you are using JavaApplet mode, and the control will replace the custom shapes with rectangles in the exported PDF. If there some shapes loaded indeed, could you check if their Shape.Image property is different from null?
  
Back to top
 
IP Logged
 
Mohammad
YaBB Newbies
*
Offline


Hello everybody :)

Posts: 32
Joined: Oct 2nd, 2009
Re: Export to pdf
Reply #4 - Nov 19th, 2009 at 10:54pm
Print Post  
Thank you for your reply.

I tested following code server-side:

MindFusion.Diagramming.Shape.FromId("Start")

It doesn't return null but the following code returns null:

MindFusion.Diagramming.Shape.FromId("Start").Image

It means the nodes are loaded successfully not images. What does it mean?!

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export to pdf
Reply #5 - Nov 20th, 2009 at 9:53am
Print Post  
It means the server could not find the images locally through the relative path, while the applet manages to build correct URL and download them successfully. It might have something to do with how the folders are mapped, or what's the current working folder when library is loaded.

Try copying the shapes file to the images folder and load it from there. Also leave just the file names in the xml, without any path.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint