- Home
- Forum
- ASP.NET Web Forms
- How to load, modify and save a diagram in batch (no actual display of the diagram)
How to load, modify and save a diagram in batch (no actual display of the diagram)
Currently when we save a diagram, we save 2 things in our database:
- The JSON data
- A png image of the diagram
We have several export utilities that rely on these saved png images.
The issue: we need to change ALL of our diagrams (removing the page border), but the only way at the moment seems to be to load the diagram (at which time we'll remove the border) and then when the user saves the diagram we can save a new png file with this change.
This requires all of our users to open all of their diagrams, make some subtle change and save them.
Not an acceptable solution - we have close to 25,000 diagrams.
So, is there a way to accomplish this using some batch capability.
I have written and tested a utility to update the JSON data in the database - that's not the challenge.
It's getting an updated png image that's the real problem.
Any suggestions on an approach?
Thanks
Jim
Yes, that's exactly what we want to do - remove the border from the png images saved in our database.
The border was created through the following properties set in code behind:
- DiagramContent.PageSettings.PageBorderColor = "blue";
- DiagramContent.PageSettings.PageBorderWidth = 2;
We have since change the border width to 0, but need to update all existing png images.
Thanks for pursuing a solution for us.
Jim
This is perfect and simpler than where I was headed.
Thanks
Jim
I have a somewhat related requirement, and since it's so close to this thread's subject, I thought I'd just add it here.
Here's the situation.
There are some values that can be changed in our application outside of the diagram page.
For example, the user can change a role (function) name (e.g., from Process Mgr. to Process Manager).
When the diagram is displayed, I check to see if a role name has changed and if so, I update the appropriate lane header text.
So far so good.
Also, when the diagram is saved, I also save a png image of the diagram at the same time.
We have a Word document that is produced that includes these saved images.
But unless the user opens the diagram(s), there is no save done and hence the images are out of sync with any role name changes.
Can you see any approach to updating a diagram and saving it (and a png image) without actually opening/loading the diagram?
I know I can update the JSON data in the database directly, but the real requirement is to get an updated png image.
I hope our requirement is clear. As you can see, it's not quite as simple as removing the border.
Thanks for any advice.
Jim
- 7 Replies
- 2 Participants
-
JJ Jim Jacobs
- Oct 19, 2016 01:30 PM UTC
- Nov 4, 2016 02:52 PM UTC