Hi,
I'm looking to create a PDF using Syncfusion PDF that takes a number of Syncfusion Charts and a Syncfusion Diagram as images. Is it possible to save charts and diagrams as images?
Thank you!
Hi - with regards to the diagram sample, how would I output the diagram for saving into a PDF (like was done for the charts?).
The chart sample worked perfect - thank you!
Hi - Apologies, I should have been clearer. As in a similar fashion to using a chart in a PDF (via saving as a stream) - is this possible to do the same with a diagram, or utilise the diagram.SaveAsImagge() method to save the diagram and place the resulting image i
|
Stream stream = new MemoryStream();
diagram.SaveAsImage(stream, ImageFormat.Png); |
Hi,
When I apply this to my project I get the error "Object not set to an instance of an object". I can see my diagram has 2 items and 1 connector as expected, so the diagram is not null - however the stream is returning a value of 0.
Is there any particular property of the diagram that needs set in order to allow the export to an image to take place?
Thank you!
|
public MainPage()
{
InitializeComponent();
Node node = new Node { Width = 200, Height = 200, OffsetX = 100, OffsetY = 100 };
Node node1 = new Node { Width = 200, Height = 200, OffsetX = 350, OffsetY =100 };
diagram.AddNode(node);
diagram.AddNode(node1);
diagram.Loaded += Diagram_Loaded;
}
private void Diagram_Loaded(object sender)
{
Stream stream = new MemoryStream();
diagram.SaveAsImage(stream, ImageFormat.Png);
} |
Hi,
My app is reaching the diagram.Loaded += Diagram_Loaded; call but the method itself is never called. Any ideas why?
Essentialy what I'm loooking to do is take the stream and create a PDF Image for use in a PDF
e.g
Stream stream = new MemoryStream();
diagram.SaveAsImage(stream, ImageFormat.Png);
PdfBitmap diagramimage = new PdfBitmap(stream);
Is this possible?
Hi,
With the following code on Android the loaded event isn't triggering
//Initializes the DataSourceSettings
diagram.DataSourceSettings = new DataSourceSettings() { DataSource = Data, Id = "ID", ParentId = parentid };
//Initializes the Layout
DirectedTreeLayout treeLayout = new DirectedTreeLayout() { HorizontalSpacing = 80, VerticalSpacing = 50, TreeOrientation = TreeOrientation.TopToBottom };
diagram.LayoutManager = new LayoutManager() { Layout = treeLayout };
diagram.EnableZoomAndPan = true;
diagram.MinimumZoomFactor = 100;
diagram.EnableTextEditing = false;
diagram.BeginNodeRender += Diagram_BeginNodeRender;
diagram.Loaded += Diagram_Loaded1;
I reach the "diagram.Loaded += Diagram_Loaded1" event via a breakpoint but the event itself doesn't trigger.
Hi, it's happening on any Android device.
SFDiagram Version is 18.3.0.35 & Xamarin Forms 4.8
I added a try catch and I'm getting the exception "
{System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.SfDiagram.XForms.Android.DiagramDependencyService.SaveAsImage (System.Object nativeObject, System.IO.Stream stream, Syncfusion.SfDiagram.XForms.ImageFormat imageformat, System.Int32 left, System.Int32 top, System.Int32 right, System.Int32 bottom) [0x00000] in <03ac3d78000e468ba66537df0ac0060b>:0"
Hi,
I've the diagram saving now to the PDF, however I have a custom template applied to the diagram (image & text below). This renders fine in the app, but when I save it to the PDF the image disappears.
Any advice would be appreciated! Thank you!
Hi,
When is the next release cycle due?
At the minute when I have a node template in place (with an image) and save, the diagram saves but with a large gap where the image should be (I understand this hasn't been implemented yet). However, is there a way to remove this gap / space on diagram save as a workaround?
Thank you!