GoPdfWriter Generate throws OutOfMemory


I have a big org chart diagram with about 450 nodes (I modified the DataSetDemo45 and I added more rows). I used the code from the user guide to export it to pdf. The Generate method bombed with OutOfMemoryException. The second run was successful. Is there a way to tell the pdf writer to reduce the memory footprint?

I also got this error:
An exception of type ‘System.ArgumentException’ occurred in System.Drawing.dll and wasn’t handled before a managed/native boundary

Additional information: Property must be set to a valid ColorBlend object to use interpolation colors. ColorBlend objects must be constructed with the same number of positions and color values. Positions must be between 0.0 and 1.0, 1.0 indicating the last element in the array.

This is the code I used:

  GoPdfWriter writer = new GoPdfWriter();
  writer.View = goView1;
  GoPdfMetadata meta = new GoPdfMetadata()
    Title = "A Diagram",
    Author = new List<string>() { "Author1", "Author2" },
    Producer = "The Producer"
  writer.PageSize = GoPdfPageSizes.A4;
  writer.Scale = 0.80f;

I also noticed the org chart is printed on a single page. Is it possible to tell it to print on multiple pages at 100% similar to how a printer would work assuming that we print to A4 pages.

Thank you

Try getting rid of the use of gradient brushes.

In the node class:

  Shape.BrushMidColor = Color.White;
  Shape.BrushForeColor = Color.White;
  Shape.BrushStyle = GoBrushStyle.SimpleGradientVertical; // BrushColor set by layout

and setting MidColor in Layout.

I set the BrushStyle to GoBrushStyle.Solid but I still get the error intermittently. Sometimes it works, sometimes it doesn’t. If I post the source code here, is it something that you could look into to fix?


It’s easier if you email us a fully working project I can run it.