Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Translate the entire conversation x

Mathcad Prime 10 The file type is not supported

Mads_Morratz_N
3-Newcomer

Mathcad Prime 10 The file type is not supported

Hi i hope there is someone here who can help me.

I have the problem that I'm making an El authorization exam and suddenly I can't open my file, it just comes with this message the file type is not supported 

MN_9015017_0-1741081858983.png

 

 

a little info: I'm using Mathcad 10, the document was about 53 pages long, the document only contains simple calculations, text fields and images that are copied in so no extra ordinary programming.

ACCEPTED SOLUTION

Accepted Solutions

Here is my best attempt.

All images and also all text regions are missing, but some (all ?) calculations are there. Its just 48 pages, probably because of the missing images.

Hope it helps at least a little bit - you sure will still have a lot of work to (re)do.

Good luck!

 

View solution in original post

7 REPLIES 7

Somehow your file got corrupted/truncated. According to people reporting here in the forum this happens quite often (too often IMHO), especially with longer files containing images or other regions (chart component, Excel component) which may take more time when saving the file.

Unfortunately PTC does not provide any means to repair such damaged files nor does Prime provide any means for automatic backup files to recover to. So you are on your own in making regular backups.

A mcdx file is just a renamed zip file containing a directory structure and a couple of files (mostly xml files) which together represent the worksheet.

Sometimes its can help to recover part of the file by renaming it to zip, and let it repair by some tools like WinRAR and rename it back to mcdx.

Often this alone does not help as other files are missing in the archive and so the contents of the repaired file can be combined with the contents of a not-damaged Prime file. Then a tedious work starts in trying if the file will be accepted by Prime and if not manually editing the file worksheet.xml contained in the archive and deleting the code for the regions which may throw the error. The log files in C:\ProgramData\PTC\Mathcad Prime\Logs\ are not of as much help as they should be.

I am not well versed doing so but I gave it a try and  unfortunately did  not succeed - maybe someone else here has more luck. Otherwise you have to resort to your latest backup.

All I could recover were the 11 image files contained in the here attached zip file, but I am pretty sure that this is not of much help.

 

Well, the log file says:

 

FileFormatException when processing file
System.IO.FileFormatException: File contains corrupted data.
at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.FindPosition(Stream archiveStream)
at MS.Internal.IO.Zip.ZipIOEndOfCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager)
at MS.Internal.IO.Zip.ZipArchive..ctor(Stream archiveStream, FileMode mode, FileAccess access, Boolean streaming, Boolean ownStream)
at MS.Internal.IO.Zip.ZipArchive.OpenOnStream(Stream stream, FileMode mode, FileAccess access, Boolean streaming)
at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming)
at Ptc.Controls.EngineeringDocument.OpenPackageStream(String fullFilePath)
at Ptc.Controls.EngineeringDocument.OpenPackage(FileLoadResult& result, String fileName, Boolean newFromDocument)
at Ptc.Controls.EngineeringDocument.OpenFileAndUpdateCWDState(String fileName)

 

 

I tried opening the file (and renamed it to "friendly" just for good luck) with 7zip, and every image opens fine except this last one:

 

DJNewman_0-1741099958586.png

 

So... there's probably something wrong with how this was constructed.

 

 

 

Edit: As Werner implied above, there's fundamentally some missing files in the .xml bundle here that normally working worksheets have that Mathcad won't want to open without.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
Werner_E
25-Diamond I
(To:DJNewman)

Yes, the last of the 12 files in the media directory is corrupted - possibly truncated. But given that its a 58 page document I assume that it contained more than just 12 images.

I came up with a version of the sheet which, when opened from within an already started Prime instance would show the beginning of the sheet for a moment but within a second or so closes and throws the error. Within this second the file can not be edited, scrolled or saved, so its of not much help seeing the first regions of that file

Werner_E_0-1741102543826.png

As can be seen its still a 58 page document, possibly missing quite a lot of regions (mainly images, I guess).

I think it would be necessary to locate and delete the regions in worksheet.xml which refer to missing images, but the log file is not of much help here.

The log file now says

 

Exception data:
File being opened: D:\TEMP\testrebuilt.El-autorisationsprøve-juni-2024 lavet.mcdx
System.NullReferenceException: Object reference not set to an instance of an object.
   at Ptc.Controls.Core.TextStylesCollectionManager.LoadWorkSheetStylesFromFile(SortedList`2 stylesCollection, IReadOnlyDictionary`2 textStyles)
   at Ptc.Controls.Core.TextStylesCollectionManager.LoadWorkSheetStyles(IReadOnlyDictionary`2 textStyles)
   at Ptc.Controls.EngineeringDocument.Read(Package package, FileLoadResult& result, String fullFilePath, Boolean newFromDocument)
   at Ptc.Controls.EngineeringDocument.OpenPackage(FileLoadResult& result, String fileName, Boolean newFromDocument)
   at Ptc.Controls.EngineeringDocument.OpenFileAndUpdateCWDState(String fileName)

 

I attach the file here but if someone wants to try to repair it, I would recommend working with the originally posted data.

 

PTC should really fix this as soon as possible by providing automatic backups (maybe incremental ones to save time) every few minutes and structuring the file save process in such a way that the file is only renamed once it is certain that it has been completely saved.

 

Providing a repair program for damaged files would also not be a bad idea.

 

@DJNewman 

Do you think that PTC support/R&D would be willing to help the OP in repairing his file? Guess he is using an academic licence.

 

DJNewman
17-Peridot
(To:Werner_E)

I'd love to say yes, but if I were to guess... probably not, on the basis that, if he's a student, student licences don't actually get access to PTC Support and they're instead told that the Community is where they go for help.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
Werner_E
25-Diamond I
(To:DJNewman)


@DJNewman wrote:

I'd love to say yes, but if I were to guess... probably not, on the basis that, if he's a student, student licences don't actually get access to PTC Support and they're instead told that the Community is where they go for help.


Guess that's bad news for @Mads_Morratz_N  as it seems that he has no recent backup. Hopefully he has a printout so its easier to redo the whole work.

According to worksheet.xml.rels the original file contained 111 images! Only 12 of them were saved - the last one only partial. Deleting the references to the non-existent files in worksheet.xml.rels did not help, so it must be still something else ...

 

The problem seems that Prime closes too soon (in midst of the saving process) when saving large worksheets. Either because of a program bug or because the user terminates the program forcefully. Can't say for sure as it never happened to me.

Here is my best attempt.

All images and also all text regions are missing, but some (all ?) calculations are there. Its just 48 pages, probably because of the missing images.

Hope it helps at least a little bit - you sure will still have a lot of work to (re)do.

Good luck!

 

Hi @mn_9015017,

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution or please feel free to detail in a reply what has helped you and mark it as the Accepted Solution. It will help other members who may have the same question.

Of course, if you have more to share on your issue, please pursue the conversation.

Thanks,

Catalina
PTC Community Moderator
Announcements

Top Tags