Good morning,
Hi Charles,
[quote user=“imran.rafique”]Hi Charles,
Hi Charles,
This has since been solved.
Hi Charles,
imran.rafique:Hi Charles,It's nice to hear from you that you managed it. We have a good news for you that the issue DIAGRAMNET-50236 has now been resolved. If there is no issue in the QA phase, then its fix will be included in the next version of Aspose.Diagram for .NET 4.5.0. Its release date is not final yet. We'll inform you via this forum thread as soon as the new release is published.
imran.rafique:It's nice to hear from you that you managed it. We have a good news for you that the issue DIAGRAMNET-50236 has now been resolved. If there is no issue in the QA phase, then its fix will be included in the next version of Aspose.Diagram for .NET 4.5.0. Its release date is not final yet. We'll inform you via this forum thread as soon as the new release is published.ctenc001:What exactly was the bug you fixed and are testing? My error was within my code. I forgot the # symbol when beginning the color value when setting the color.We'll now detect color string without '#'. We hope, this helps.ctenc001:I am unable to save as PDF if a shape has more than one Chars setEx.shape.Text.Value.Add(new Cp(0));shape.Text.Value.Add(new Txt("Test0");shape.Text.Value.Add(new Cp(1));shape.Text.Value.Add(new Txt("Test1");shape.Chars.Add(new Aspose.Diagram.Char());shape.Chars.Add(new Aspose.Diagram.Char());shape.Chars[0].Color.Value = "#FF0000";shape.Chars[1].Color.Value = "#00FF00";However if I try to save as PDF, I get an error stating "Object reference not set to an instance of an object"EDIT: Basically, this exact example does not work when saving as pdfhttp://www.aspose.com/docs/display/diagramnet/Apply+Different+Style+on+the+Each+Text+Value+of+a+ShapeThe documented sample code works perfectly on our side. We can save it in PDF format too. Please share problematic Visio drawing and source code in this forum thread. We'll check and guide you appropriately.
The problematic Visio drawing is the same one that is in the OP.
Hi Charles,
Hi Charles,
Attached is the exact template that I am using today as well as a simplified, and tested to still have this problem, source code for your review.
Hi Charles,
Thank you for posting sample code and Visio drawing. We have tested your scenario against the latest build of Aspose.Diagram for .NET 4.4.0. We’re afraid because we could not reproduce the error message said. We have cleaned your sample code as follows:
C#
string TempFilepath = @“C:\Ad\test269\Fishbone_Major TYCOM AVAIL w C4I_template.vdx”;
Diagram vdxDiagram = new Diagram(TempFilepath);
foreach (Aspose.Diagram.Shape shape in vdxDiagram.Pages[0].Shapes) //remove dualbone colors that break pdf conversion
{
shape.Text.Value.Clear();
shape.Chars.Clear();
foreach (Shape dualBone in shape.Shapes)
{
if (dualBone.Text.Value.Text.ToString() != “”)
{
dualBone.Text.Value.Clear();
dualBone.Chars.Clear();
dualBone.Text.Value.Add(new Cp(0));
dualBone.Text.Value.Add(new Txt(“Test1\n”)); //add date + name to shape Text.
dualBone.Text.Value.Add(new Cp(1));
dualBone.Text.Value.Add(new Txt(“Test2”));
dualBone.Chars.Add(new Aspose.Diagram.Char());
dualBone.Chars.Add(new Aspose.Diagram.Char());
dualBone.Chars[0].IX = 0;
dualBone.Chars[0].Style.Value = StyleValue.Bold;
dualBone.Chars[1].IX = 1;
dualBone.Chars[1].Style.Value = StyleValue.Italic;
}
}
}
[//vdxDiagram.Save](https://vdxdiagram.save/)(@“c:\ad\test269\Output.vdx”, SaveFileFormat.VDX); //saves visio so that visio viewer can open it.
vdxDiagram.Save(@“c:\ad\test269\Output.pdf”, SaveFileFormat.PDF); //Saves as PDF
This source code works perfect on my side. We have attached output PDF file for your reference. It may an issue with the environment. Please post your complete environment details in this forum thread. It’ll help us to be more specific. Please reply to the following questions:
- What is the Operating System name, edition and 32 & 64 bit (e.g. Windows 7 Ultimate 64 bit)
- What is the IDE (Netbeans, eclipse), edition and other details?
- What is the Java version, build number and 64 or 32 bits?
- Any other information that you think is necessary.
We’re looking forward to help you.
Hi Charles,
ctenc001:1. Windows 7 Professional 64-bit2. Visual Studio 2012 V. 11.0.61030.00 Update 4with Microsoft .Net Framework V 4.5.507093. Our Project is an ASP.NET C# Web Application using Framework .Net 4.5CSharp V4.0.303194. Using Internet Explorer 9 in IE9 Compatibility mode.
The issues you have found earlier (filed as DIAGRAMNET-50236) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.