Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Multiline text of link not exported (Read 3163 times)
AD2012
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Mar 16th, 2012
Multiline text of link not exported
Jan 16th, 2013 at 3:42pm
Print Post  
Dim loExporter As New PdfExporter
loExporter.Export(Diagram1, SaveFileDialog1.FileName)

A diagramlink is containing a text of multiple lines. Only first line is exported to the pdf file.

Version:
Mindfusion.Diagramming for Winforms (Pro Edition)
.NET 4.0
MindFusion.Diagramming.Export.Pdf.dll File version 5.5.0.25332
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Multiline text of link not exported
Reply #1 - Jan 17th, 2013 at 7:42am
Print Post  
Exporting multiple lines of text for links seems to work fine in latest version. If you don't want to upgrade, replace your link texts with ShapeNodes before exporting:

Code
Select All
Diagram copy = new Diagram();
copy.LoadFromString(diagram.SaveToString());
foreach (DiagramLink link in copy.Links)
{
	ShapeNode label = copy.Factory.CreateShapeNode(0, 0, 100, 100);
	label.Text = link.Text;
	label.Transparent = true;
	label.ResizeToFitText(FitSize.KeepRatio);
	label.Move(
		link.Bounds.X + link.Bounds.Width / 2 - label.Bounds.Width / 2,
		link.Bounds.Y + link.Bounds.Height / 2 - label.Bounds.Height / 2);
	link.Text = "";
}

pdfExporter.Export(copy, sfd.FileName); 



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


I Love MindFusion!

Posts: 6
Joined: Mar 16th, 2012
Re: Multiline text of link not exported
Reply #2 - Jan 17th, 2013 at 10:40am
Print Post  
Thanks for your reply, but it seems not working correctly. See attachments:
diagram : diagram view
pdf : export to pdf

one link is missing a part ("Default" => "Defa")
another link has bad wrapping
  

Pdf.png (Attachment deleted)
Diagram.png ( 44 KB | 124 Downloads )
Diagram.png
Back to top
 
IP Logged
 
AD2012
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Mar 16th, 2012
Re: Multiline text of link not exported
Reply #3 - Jan 17th, 2013 at 11:00am
Print Post  
I changed it a little bit, it seems to work:

            Dim copy As Diagram = New Diagram()
            copy.LoadFromString(Diagram1.SaveToString)
            For Each link As DiagramLink In copy.Links
                Dim label As ShapeNode = copy.Factory.CreateShapeNode(0, 0, 500, 500)
                label.Font = link.Font
                label.Text = link.Text
                label.Transparent = True
                label.Move(link.Bounds.X + link.Bounds.Width / 2 - label.Bounds.Width / 2, _
                           link.Bounds.Y + link.Bounds.Height / 2 - label.Bounds.Height / 2)
                link.Text = ""
            Next
            loExporter.Export(copy, SaveFileDialog1.FileName)

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