Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Shape decoration misplaced in PDF (Read 5000 times)
leendert.versluijs
YaBB Newbies
*
Offline



Posts: 20
Joined: Dec 3rd, 2008
Shape decoration misplaced in PDF
Jan 27th, 2009 at 9:50am
Print Post  
Hello,

When i export my diagram to PDF the decorations of a shape are not placed correctly.
The shapes are placed in a nested container (two levels of conainers) and the offset of the decoration seem to be related to the containers instead of the shape.

Is there a solution for this problem?

Kind regards,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape decoration misplaced in PDF
Reply #1 - Jan 27th, 2009 at 10:26am
Print Post  
Hi,

By decorations do you mean decoration lines in the Shape definition?

Stoyan
  
Back to top
 
IP Logged
 
leendert.versluijs
YaBB Newbies
*
Offline



Posts: 20
Joined: Dec 3rd, 2008
Re: Shape decoration misplaced in PDF
Reply #2 - Jan 27th, 2009 at 10:45am
Print Post  
Hi Stoyan,

Indeed the decoration elements of the shape.
For example my main decoration is a carshape with two weels (circles) as decoration.


Kind regards,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape decoration misplaced in PDF
Reply #3 - Jan 27th, 2009 at 11:33am
Print Post  
This worked fine in my test app. Are you using Wpfdiagram version 2.1?
  
Back to top
 
IP Logged
 
leendert.versluijs
YaBB Newbies
*
Offline



Posts: 20
Joined: Dec 3rd, 2008
Re: Shape decoration misplaced in PDF
Reply #4 - Jan 27th, 2009 at 12:00pm
Print Post  
Hi,

We're using version 2.1.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape decoration misplaced in PDF
Reply #5 - Jan 27th, 2009 at 12:09pm
Print Post  
Could you copy your shape definition and pdf export code here?
  
Back to top
 
IP Logged
 
leendert.versluijs
YaBB Newbies
*
Offline



Posts: 20
Joined: Dec 3rd, 2008
Re: Shape decoration misplaced in PDF
Reply #6 - Jan 27th, 2009 at 1:08pm
Print Post  
Hi Stoyan,

Here is the request code. Hope this helps.

SHAPE Definition:

       private static Shape shape = new Shape(
           new ElementTemplate[]
           {
               new LineTemplate(98, 0, 100, 0),
               new LineTemplate(100, 0, 100, 40),
               new LineTemplate(100, 40, 100, 45),
               new LineTemplate(100, 45, 70, 45),
               new LineTemplate(70, 45, 29, 45),
               new LineTemplate(29, 45, 30, 42),
               new LineTemplate(30, 42, 33, 42),
               new LineTemplate(33, 42, 33, 34),
               new LineTemplate(33, 34, 51, 30),
               new LineTemplate(51, 30, 55, 20),
               new LineTemplate(55, 20, 60, 20),
               new LineTemplate(60, 20, 60, 30),
               new LineTemplate(60, 30, 70, 30),
               new LineTemplate(70, 30, 70, 20),
               new LineTemplate(70, 20, 75, 20),
               new LineTemplate(75, 20, 75, 30),
               new LineTemplate(75, 30, 95, 30),
               new LineTemplate(95, 30, 95, 20),
               new LineTemplate(95, 20, 56, 20),
               new LineTemplate(56, 20, 59, 15),
               new LineTemplate(59, 15, 98, 15),
               new LineTemplate(98, 15, 98, 0)
           },
           new ElementTemplate[]
           {
               new ArcTemplate(80, 36, 12, 14, 0, 360, Colors.Black, DashStyles.Solid, 6),
               new ArcTemplate(40, 36, 12, 14, 0, 360, Colors.Black, DashStyles.Solid, 6)
           },
           new ElementTemplate[]
           {
               new LineTemplate(0, 60, 100, 60),
               new LineTemplate(100, 60, 100, 80),
               new LineTemplate(100, 80, 0, 80),
               new LineTemplate(0, 80, 0, 60)
           },
           FillRule.EvenOdd, typeof(CISSSANode).Name);
       private static Brush brush = Brushes.Olive;
       private static Pen pen = new Pen(Brushes.DarkOliveGreen, 2);
       private static Brush textBrush = Brushes.Black;


PDF Export code:


       private void Pdf_Executed(object sender, ExecutedRoutedEventArgs e)
       {
           try
           {
               SaveFileDialog dialog = new SaveFileDialog();
               dialog.FileName = Header.ToString();
               dialog.DefaultExt = ".pdf";
               dialog.Filter = "PDF documents (.pdf)|*.pdf";
               bool? result = dialog.ShowDialog();
               if (result == true)
               {
                   myDiagram.ResizeToFitItems(0);
                   PdfExporter exporter = new PdfExporter();
                   exporter.PageSize = MindFusion.Pdf.PageSize.A0;
                   exporter.PageOrientation = MindFusion.Pdf.PageOrientation.Landscape;
                   exporter.AutoScale = AutoScale.FitToPage;
                   exporter.AutoOrientation = true;
                   exporter.Export(myDiagram, dialog.FileName);
               }
           }
           catch (Exception ex)
           {
               MessageBox.Show("Error exporting diagram. Details: " + ex.Message, "Error");
           }
       }

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape decoration misplaced in PDF
Reply #7 - Jan 28th, 2009 at 3:42pm
Print Post  
That's a very nice shape 8) The tyres get misplaced indeed, even without containers. Our developer will debug this tomorrow.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape decoration misplaced in PDF
Reply #8 - Feb 10th, 2009 at 2:33pm
Print Post  
This version should fix the displacement:
https://mindfusion.eu/_beta/wpfdiag211.zip
  
Back to top
 
IP Logged
 
leendert.versluijs
YaBB Newbies
*
Offline



Posts: 20
Joined: Dec 3rd, 2008
Re: Shape decoration misplaced in PDF
Reply #9 - Feb 16th, 2009 at 11:08am
Print Post  
Hello Stoyo,

What happened to the download ???

How can we obtain the released 2.1.1 version? We have a license including source code. The license is however managed by our it department and it helps if i can tell them how the procedure for getting the update is.

Kind regards,

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape decoration misplaced in PDF
Reply #10 - Feb 16th, 2009 at 11:43am
Print Post  
We have removed the 2.1.1 beta files now that we have released the official version. We email upgrade links to the addresses entered on the purchase form. You might send me a private message with your company name and I will add you to our mailing list.

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