Problems with vsd and vsdx files

Hi, i’m trying to open two files, a vsdx and a vsd created with Visio 2013 (in attachment)

Trying to open the vsdx file i recveive an exeption "There is not expected element VisioDocument"
If i open this vsdx file with visio and save as VSD file, i can read it but the pages count seems to be 1, when the file has several pages, so i can’t access page number 2, 3 etc
Moreover when i convert the first page as a png file, the image does not respect the original file disposition (all shapes do not occupy entire page area in the png file but they seems to be placed in an angle of image - see attached file)

what’s wrong?
thank’s

Hi Demo,

Thank you for contacting support. I’ve tested your sample diagrams against the latest build of Aspose.Diagram for .NET 4.1.0. I’m afraid. I’m not able to reproduce the said issues. You are not applying a valid license. It also looks as you are using an old version. I can access each page of provided Visio diagrams. Also, I can convert them to PNG format.

Please get a temporary license for 30 days and try the latest version of Aspose.Diagram for .NET 4.1.0. You can learn all about how Aspose products are licensed by checking out the Licenses FAQ here:

Please feel free to reply in case of any confusion or questions.

tryied with 30 days license and last version 4.1.0 but i have the same problems (exeption with vsdx and bad conversion of png file with vsd)




So… we have same input files and same libraries: what’s goin on?



for VSF files: image goes OK when i comment this Row “(Aspose.Diagram.Saving.ImageSaveOptions)OptionsD.Resolution = 200;”

so the resolution setting have to do with some sort of stretching final image, please check it out



for VSDX files: ever return errors! can you provide me a sample VSDX file tha works?

Hi Demo,


Thanks for your inquiry. Please provide us the complete code snippet regarding each problem separately. Also, please share environment details where you are facing these issues. It will help us to be more specific. We’ll take a closer look and guide you accordingly.

the code is the same for VSD or VSDX file (visual studio 2010/2013 with framework 4.0 full on windows7 32 bit develop/debug pc):

Aspose.Diagram.Saving.ImageSaveOptions OptionsD = new Aspose.Diagram.Saving.ImageSaveOptions(Aspose.Diagram.SaveFileFormat.PNG);
OptionsD.PageIndex = _iPageIndex;OptionsD.PageCount = 1;
//OptionsD.Resolution = 200; 
((Aspose.Diagram.Diagram)m_oDocument).Save(_oOutputStream, OptionsD);

the commented row - if uncommented - create final image “stretched” for VSD file

same code used for a VSDX file goes in exception (for instance “Object reference not set to an instance of an object.”)

VSDX and VSD files are the same file created with VISIO 2013 and saved in this two format (i attach these files and the two image resulting for VSD with commented/uncommented row about resolution)

Hi Demo,

Thank you for your inquiry. We have tested your sample Visio drawings against the latest build of Aspose.Diagram 4.1.0. We managed to replicate the problem of extra white space around the actual drawings. We have logged these issues as follows:

DIAGRAMNET-50141 - VSD to PNG conversion, white space around the actual drawing

DIAGRAMNET-50142 - VSDX to PNG conversion, white space around the actual drawing

[C#]

Aspose.Diagram.Diagram
m_oDocument = new Aspose.Diagram.Diagram(@“C:\test\Drawing1.vsdx”);<o:p></o:p>
Aspose.Diagram.Saving.ImageSaveOptions OptionsD = new Aspose.Diagram.Saving.ImageSaveOptions(Aspose.Diagram.SaveFileFormat.PNG);
OptionsD.PageIndex = 0;
OptionsD.PageCount = 1;
OptionsD.Resolution = 200;
((Aspose.Diagram.Diagram)m_oDocument).Save(@“C:\test\Drawing1_vsdx.png”,
OptionsD);

Your request has also been linked to these issues. We’ll keep you informed regarding any updates. We’re sorry for the inconvenience you faced.

We’re afraid. We still could not reproduce the said error message with VSDX format. It is also generating an image file with extra white space. It will be so nice of you if you can attach a sample project which reproduces the issue on your side and attach it here. We’ll investigate the issue at our end and guide you accordingly.

Follow ME: for reproduce the exeption you must use a stream to instantiate aspose Object!




if you use this code:




MemoryStream oMstream;

using (System.IO.FileStream oFStream = System.IO.File.OpenRead(@“c:\test\Drawing1.vsdx”))

{

byte[] aData = new byte[oFStream.Length];

oFStream.Read(aData, 0, aData.Length);

oMstream = new MemoryStream(aData);

}




Aspose.Diagram.Diagram m_oDocument = new Aspose.Diagram.Diagram(oMstream);




you’ll retrieve the exeption: “There is not expected element VisioDocument.”




this code i provide you works with other Aspose object, even for VSD files, also instance Diagram Object passing phisical path VSDX works, problem is only for VSDX file and stream




Please try it.

Hi Demo,


Thank you for the details. We managed to replicate the error message said. We have logged this problem under ticket id DIAGRAMNET-50144 in our issue tracking system. Your request has also been linked to this issue. We’ll let you know once it is fixed. We’re sorry for your inconvenience.

The issues you have found earlier (filed as DIAGRAMNET-50141;DIAGRAMNET-50142;DIAGRAMNET-50144) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.