Page Index Toggle Pages: [1] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Export Issues (Read 12621 times)
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Export Issues
Oct 25th, 2006 at 11:28am
Print Post  
Hello

i have a diagram which has some 50 shapes and 80 arrows. Shapes have text labels which are not more that 30 characters.

When i export this diagram, to a PDF, it gives me problems. The exported diagram has the shapes with half labels or no labels at all.

Is there some property to set so that i get the complete text of the box in the PDF. Same as i am seeing it on the FlowChart Control??

Same problem is with SVG and Visio.

What am i missing in my Export code?
[code]
PdfExporter pdfEx = new PdfExporter();
pdfEx.Export(MyFC, ShowSaveDialog("Adobe PDF Document(*.pdf)|*.*"));
[/code]

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Issues
Reply #1 - Oct 25th, 2006 at 12:21pm
Print Post  
Hello,

Could you email me your diagram?

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Export Issues
Reply #2 - Oct 25th, 2006 at 1:52pm
Print Post  
Stoyan,

Sent you the files. Please let me know.
Thanks in advance

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Issues
Reply #3 - Oct 26th, 2006 at 9:49am
Print Post  
Hi Phil,

It seems the PdfExporter uses our own text layout algorithm, which is used in the flowchart only if the Box.PolyTextLayout property is enabled. So if you want to get exactly the same text appearance both in the flowchart and in the exported PDF, enable PolyTextLayout for your boxes.

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Export Issues
Reply #4 - Oct 26th, 2006 at 10:06am
Print Post  
Hello Stoyan,

I get both flowchart as well as exported layouts same, but now both have missing text in the shapes. This was not what i wanted. ???

I want to have the complete text label displayed in the shape on the flowchart, as well as in the exported PDF.  Cry

I have sent you the files with Box.PolyTextLayout property enabled. But as u can see from the tooltip of the shapes, the box is not displaying the complete label. Nor is it in the PDF. Sad

What else could i do?
Thanks in advance.

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Issues
Reply #5 - Oct 26th, 2006 at 10:26am
Print Post  
Set slightly larger box sizes, or call the  Box.FitSizeToText method. Our text layout algorithm can break the text only at whole words, so it needs some more space than the Windows text renderer, which breaks the text at the character level.

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Export Issues
Reply #6 - Oct 26th, 2006 at 10:39am
Print Post  
Hello Stoyan,

Well that makes some boxes bigger and some smaller.

The diagram does not look nice in that case. Can i have something that the box size is same and text renders into it.

Else i will have to do the round method of find the largest label, draw box, get box size, apply size to all remaining boxes which could be tedious.

Something simpler please Sad

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Issues
Reply #7 - Oct 26th, 2006 at 10:49am
Print Post  
Hello Phil ,

Even when not using PolyTextLayout, you cannot be sure that the text will always fit into your boxes if they are all the same size. If you want them the same anyway, try setting the size of all boxes say 1.3 * the current size, or decrease the font size a bit before exporting to PDF.

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Export Issues
Reply #8 - Oct 26th, 2006 at 12:15pm
Print Post  
Hello Stoyan,

I thought about this a bit.

Like you have a function which says FitToText for Shape, can we have something which will be other way round?

Like i say the font should be min 2 mm or 8.5 px and Fit the text into shape.

Or something like some property on FC which sets the size of all boxes to the size of the largest box. i am just thinking aloud. We need a solution which shows text correctly in the exported format.

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Issues
Reply #9 - Oct 27th, 2006 at 5:27am
Print Post  
Hello Phil,

The best solution would be to repeat the Windows text formatting logic in the PDF exporter, so that you can get the same results without enabling polygonal text layout in boxes. We'll see what we can do about that.

The following code will resize all boxes to the max box width and height:

Code
Select All
float maxWidth = 0, maxHeight = 0;
foreach (Box box in fc.Boxes)
{
  maxWidth = Math.Max(maxWidth, box.BoundingRect.Width);
  maxHeight = Math.Max(maxHeight, box.BoundingRect.Height);
}

SizeF maxSize = new SizeF(maxWidth, maxHeight);
foreach (Box box in fc.Boxes)
  box.BoundingRect = new RectangleF(box.BoundingRect.Location, maxSize);
 



Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Export Issues
Reply #10 - Oct 27th, 2006 at 6:25am
Print Post  
Hello Stoyan,

Update me on any eureka (updates/breakthroughs) on the PDF export windows text formatting thing on your end.

I will check on the code. Thanks a ton for it anyways.

I am impressed by the support offered.

Cheers

Phil
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Export Issues
Reply #11 - Nov 7th, 2006 at 10:10am
Print Post  
Hello Stoyan,

Making all boxes of the same size for maximum text length is not looking good.

Have you got the PDF export windows formatting fixed?

I wonder, if the image is exported correctly, what ails PDF export?

Thanks in advance

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Issues
Reply #12 - Nov 7th, 2006 at 11:02am
Print Post  
Hello Phil,

Images are exported by running the same code that draws the chart on the screen, however on a Bitmap Graphics object instead of the screen's Graphics.

On the other hand, PDF documents are created not through the System.Drawing API, but by adding graphic primitives and formatting instructions to a file, following the Adobe PDF specifications. So, in PDF we cannot use the text formatting functionality supported by the Graphics class, and we just reused the text-layout functions that we had for the polygonal text layout feature. Now that does not look bad with large enough boxes, but it's not that good with yours. Our developers are working on the fix now and it will be included in the 4.2.2 release.

Stoyan
  
Back to top
 
IP Logged
 
Phil Jacques
Junior Member
**
Offline


.NET 2.0 Rocks!!!

Posts: 70
Joined: Oct 20th, 2006
Re: Export Issues
Reply #13 - Nov 7th, 2006 at 11:24am
Print Post  
Hello Stoyan,

Ahh now i get it. I will wait eagerly for V 4.2.2 for the fixes.  8) Undecided

Cheers

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Export Issues
Reply #14 - Nov 27th, 2006 at 9:10am
Print Post  
Hello Phil,

Try this version of the exporter:
https://mindfusion.org/_beta/pdfexport.zip

Now if you don't use styled text or polygonal text layout, the PdfExporter will try to be as close as possible to the Windows plain-text layout.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint