Free Support Forum - aspose.com

Xml to Pdf conversion is returning Exception

Aspose.Tasks.TasksReadingException
HResult=0x80131600
Message=The project format is undefined.
Source=Aspose.Tasks
StackTrace:
at #=zyOYjiviIztm6J_ahArEuF_s=.#=z4d5QeC4=(ProjectFileInfo #=z_acSU44=)
at #=zdb4yHhKHkJHKnhAJou9HhdY=.#=z4d5QeC4=(ProjectFileInfo #=zpL0zKfA=)
at #=zdb4yHhKHkJHKnhAJou9HhdY=.#=zjTEcfIs=(Stream #=zgNAZ4F0=, Project #=zdXHGCF8=)
at Aspose.Tasks.Project.#=z31X13baoFa5w(Stream #=zgNAZ4F0=, ParseErrorCallback #=zuHWhFy07Z9yp, Encoding #=zVGOO$mM=, PrimaveraXmlReadingOptions #=zmxgbius=)
at Aspose.Tasks.Project…ctor(String projectTemplate, ParseErrorCallback parseErrorHandler)
at Aspose.Tasks.Project…ctor(String projectTemplate)
at WindowsFormsApp4.Form1.button20_Click(Object sender, EventArgs e) in C:\TFS\Aspose\WindowsFormsApp4\WindowsFormsApp4\Form1.cs:line 410
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApp4.Program.Main() in C:\TFS\Aspose\WindowsFormsApp4\WindowsFormsApp4\Program.cs:line 19

Code Used:

        // load the XML in an object of Project class
        var project = new Aspose.Tasks.Project(@"c:\tfs\aspose\" + "17Xml.xml");
        // save XML as PDF 
        project.Save(@"c:\tfs\aspose\" + "XmltoPdf.pdf", Aspose.Tasks.Saving.SaveFileFormat.XML);

@subramanyam.gvsrb

Can you please share the source file reproducing the issue on your end that we can use and test on our end to reproduce the issue.

Form1.zip (3.3 KB)

PFA zip with cs file.
Conversion of pptx and xml is not working. Plz check the below methods:

- private void button19_Click(object sender, EventArgs e)
- private void button20_Click(object sender, EventArgs e)

@subramanyam.gvsrb

Thank you for sharing the information. However, I am still unable to find 17.xml that you are trying load and getting exception with.

In place of that file, you can have any test xml file… this code block is giving an issue for each test file.

@subramanyam.gvsrb

I request you to please share the source XML that is reproducing the issue so that we may understand the root cause of the issue. This issue seems to be related to a particular XML.

PFA xml file & ppt files referred in sample code…TestFiles.zip (21.1 KB)

@subramanyam.gvsrb

You can please try using our free group docs viewer. The XML file format that you have shared is not supported.
image.png (199.7 KB)

Hi,

Can you plz create your own sample xml & validate if it is working. If yes, plz provide that sample file & C# code to check from our end.

Also plz find the xml file content below which I am using in my sample program, to review from your end. Plz suggest, if any modifications are required.

image001.png (14.4 KB)

image002.png (18.4 KB)

@subramanyam.gvsrb

Can you please try our sample XML files available over Github example project for Aspose.Tasks.

Do not have access to GitHub from Citi environment. Can you plz attach Project.xml file to this topic?

Also may I know the update on ppt conversion?

@subramanyam.gvsrb

Attached please find the requested file that you may try on your end.

Project.xml.zip (31.9 KB)

I am getting the same issue with sample code which I have. Can you plz provide sample code which you are using for xml conversion?

Aspose.Tasks.TasksReadingException
HResult=0x80131600
Message=File reading error.
Source=Aspose.Tasks
StackTrace:
at #=zid1cLuAZ3Q5BAZ$aJ97G0XY=.#=zBgKxvJ0=(Stream #=zgNAZ4F0=, Encoding #=zVGOO$mM=)
at #=zid1cLuAZ3Q5BAZ$aJ97G0XY=.#=zBgKxvJ0=(Stream #=zgNAZ4F0=)
at #=zid1cLuAZ3Q5BAZ$aJ97G0XY=.#=zWBB6a8Dkbzmyju1hOg==(Stream #=zgNAZ4F0=)
at Aspose.Tasks.Project.#=z31X13baoFa5w(Stream #=zgNAZ4F0=, ParseErrorCallback #=zuHWhFy07Z9yp, Encoding #=zVGOO$mM=, PrimaveraXmlReadingOptions #=zmxgbius=)
at Aspose.Tasks.Project…ctor(String projectTemplate, ParseErrorCallback parseErrorHandler)
at Aspose.Tasks.Project…ctor(String projectTemplate)
at WindowsFormsApp4.Form1.button20_Click(Object sender, EventArgs e) in C:\TFS\Aspose\WindowsFormsApp4\WindowsFormsApp4\Form1.cs:line 415
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApp4.Program.Main() in C:\TFS\Aspose\WindowsFormsApp4\WindowsFormsApp4\Program.cs:line 19

Inner Exception 1:
XmlException: DTD is prohibited in this XML document.

@subramanyam.gvsrb

It seems to be a breaking change in API. A ticket with ID TASKSNET-4791 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Thanks for the update.

Can you plz update on ppt conversion issue?

Hello @subramanyam.gvsrb.
The attached XML file is valid, please use it.

Project1.zip (1.9 KB)

Plz update on PPTX…

@subramanyam.gvsrb
PPTX is not a format that supported by Aspose.Tasks, because PPTX is a presentation, not a project management file. If you want to work with PPTX you may use Aspose.Slides instead.

I have used the slides, not able to open output file.

(Attachment 16pptx.pptx is missing)

PptToPdf.pdf (29.8 KB)

We have no ability to help you with the possible issues with Aspose.Slides. Please, write your question on Aspose.Slides forum. Thank you.