Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Exception: Incorrect geomentry drawing type in PdfExporter (Read 4769 times)
David Adams
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Aug 6th, 2014
Exception: Incorrect geomentry drawing type in PdfExporter
Aug 6th, 2014 at 2:04pm
Print Post  
I get the following exception using PdfExport. The file is created, but only includes the first node of the diagram.

System.Exception occurred
HResult=-2146233088
Message=Incorrect geomentry drawing type: System.Windows.Media.CombinedGeometry
Source=MindFusion.Diagramming.Wpf.PdfExport
StackTrace:
at A.GQ.U(Geometry A, Transform B)
InnerException:
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exception: Incorrect geomentry drawing type in PdfExporter
Reply #1 - Aug 6th, 2014 at 2:13pm
Print Post  
What kind of nodes are you exporting?
  
Back to top
 
IP Logged
 
David Adams
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Aug 6th, 2014
Re: Exception: Incorrect geomentry drawing type in PdfExporter
Reply #2 - Aug 7th, 2014 at 8:45am
Print Post  
I'm exporting ShapeNodes. It's based on the Tree Layout sample.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exception: Incorrect geomentry drawing type in PdfExporter
Reply #3 - Aug 7th, 2014 at 10:06am
Print Post  
What should we add or change in TreeLayout project settings to reproduce the exception?
  
Back to top
 
IP Logged
 
David Adams
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Aug 6th, 2014
Re: Exception: Incorrect geomentry drawing type in PdfExporter
Reply #4 - Sep 19th, 2014 at 1:51pm
Print Post  
Hi,

Sorry it's been a while on this, was working on another project.

The following code has the Xaml and code-behind that produces the error. I've loaded the diagram using a diagram string that was saved from the diagram that has the error. Image Export works fine, just PDF that has an error.

XAML
Code (HTML)
Select All
                <diag:Diagram Name="diagram" AlignToGrid="True" ShowGrid="True"
						  AllowDrop="True" Behavior="DrawLinks" GridSizeX="20" GridSizeY="20"
						  NodesExpandable="True"
                          NodeSelected="diagram_NodeSelected"
						  NodeClicked="diagram_NodeClicked"
						  NodeDeleting="diagram_NodeDeleting"
                          LinkCreated="diagram_LinkCreated"
                          LinkModified="diagram_LinkModified"
						  LinkModifying="diagram_LinkModifying"
						  LinkCreating="diagram_LinkCreating"
						  LinkSelecting="diagram_LinkSelecting"
						  NodeCreated="diagram_NodeCreated"
                          NodeModifying="diagram_NodeModifying"
                          NodeModified="diagram_NodeModified"
						  Drop="diagram_Drop"
						  Loaded="diagram_Loaded"
                          Clicked="diagram_Clicked"
						LinkHeadShapeSize="16">
                    <diag:Diagram.ShapeNodeStyle>
                        <Style TargetType="{x:Type diag:ShapeNode}">
                            <Setter Property="FontSize" Value="11" />
                            <Setter Property="Brush">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.8,1">
                                        <GradientStop Color="#FFAFBFDF" Offset="0" />
                                        <GradientStop Color="#FFEFEFFF" Offset="0.3" />
                                        <GradientStop Color="#FF8F9FBF" Offset="0.9" />
                                        <GradientStop Color="#FF6F7FAF" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </diag:Diagram.ShapeNodeStyle>
                    <diag:Diagram.BackBrush>
                        <LinearGradientBrush StartPoint="0.5, 0" EndPoint="0.8, 1">
                            <GradientStop Color="#FFDFDFDF" Offset="0" />
                            <GradientStop Color="#FFEFEFFF" Offset="0.3" />
                            <GradientStop Color="#FF8F9FBF" Offset="0.9" />
                            <GradientStop Color="#FF6F7FAF" Offset="1" />
                        </LinearGradientBrush>
                    </diag:Diagram.BackBrush>
                </diag:Diagram>
 



C#
Code (Java)
Select All
public MyDiagramView()
{
            InitializeComponent();

            diagram.AllowDrop = true;
            diagram.DocumentPlane.AllowDrop = true;

            diagram.BackBrush = this.Background;
            diagram.NodeEffects.Add(new AeroEffect());

            diagram.LinkHeadShape = ArrowHeads.RevTriangle;
            diagram.LinkHeadShapeSize = 16;
            diagram.LoadFromString("+HBvg72n0mG7RITj4R0oR/AoAUGmwMvE7PVNtvJtLnPzR2NgaiJ2uhSOmEvyxIvej3JCzCbDfAo5+T/PRK3215wAAA==");
}

private void ExportPdfButton_Click(object sender, RoutedEventArgs e)
{
            SaveFileDialog dlg = new SaveFileDialog();
            dlg.FileName = "Diagram";
            dlg.DefaultExt = ".pdf";
            dlg.Filter = "PDF documents (.pdf)|*.pdf";

            Nullable<bool> result = dlg.ShowDialog();

            if (result == true)
            {
                // Save document
                string filename = dlg.FileName;
                PdfExporter exporter = new PdfExporter();
                exporter.Export(diagram, filename);
            }
}
 



Hopefully this is enough for you to reproduce the error.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exception: Incorrect geomentry drawing type in PdfExporter
Reply #5 - Sep 22nd, 2014 at 8:52am
Print Post  
Hi,

Apparently we first started using the CombinedGeometry class for rendering AeroEffect, but never added support for it in our WPF visual tree to PDF conversion code. For time being you can export to PDF by temporarily removing the effect:

Code
Select All
if (result == true)
{
	diagram.NodeEffects.Clear();

	// Save document
	string filename = dlg.FileName;
	PdfExporter exporter = new PdfExporter();
	exporter.Export(diagram, filename);

	diagram.NodeEffects.Add(new AeroEffect());
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
David Adams
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Aug 6th, 2014
Re: Exception: Incorrect geomentry drawing type in PdfExporter
Reply #6 - Sep 22nd, 2014 at 1:46pm
Print Post  
That worked, thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint