We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to convert mpp file to pdf using Aspose.Task?

Hi

I am try to convert mpp file to pdf,after convert if i open pdf file that file is error,here i attach mpp file ,converted pdf file and my coding,pls check and reply,
This is link i follow the code
http://www.aspose.com/docs/display/tasksnet/Saving+a+Project+as+PDF

'Read the input Project file
Dim reader As ProjectReader = New ProjectReader()
Dim project As Project = reader.Read(“D:\doc\b4ubuild_sample_07.mpp”)

'Save the Project as PDF
project.Save(“D:\doc\b4ubuild_sample_07.pdf”, SaveFileFormat.PDF)

Note : mpp file download from internet.

Regards
Aravind

Hi Aravind,


Thank you for contacting Aspose support.

I have used your code to convert MPP to PDF using Aspose.Tasks for .NET 6.9.0 and observed that the resultant PDF file (size 402 KB) can be opened successfully and no exception is raised. Could you please try it again using latest version and let us know your feedback?

Hi

Still i can’t open the pdf file after convert into pdf if i try to open,it show like pdf file is not correct format, i am download new Aspose.Task version 6.9.0 what u mention above link.
Here i attach mpp and after convert pdf file using new API and Aspose.Task API

This is my code

Dim reader As ProjectReader = New ProjectReader()
Dim project As Project = reader.Read(inputfile)
project.Save(outputfile, SaveFileFormat.PDF)


Note : inputfile is , i point to path mpp file
outputfile is where to be save pdf file after convert.

pls reply asap,pls upload ur API,i will try in my website

Regards
Aravind

Hi Aravind,

I have tested this issue with the latest version of Aspose.Tasks for .NET 6.9.0 and could not face the problem as you have mentioned. The generated PDF file, attached herewith, can be opened fine in Adobe PDF. I have Adobe Reader X installed at my end. Could you please update your Adobe Reader (in case it is an old version) and let us know your feedback?

Hi

After update viewer i can’t open pdf file still,it show error like unformatted file,here i attach pdf file and error also.I am use pdf xchange viewer,not adobe reader.But how i can open pdf file that u send in last reply.
I am use windows 8 64 bit,in windows inbuilt reader also i try ,but can’t open pdf file.

Pls see code,is it correct or not ?

Dim reader As ProjectReader = New ProjectReader()
Dim project As Project = reader.Read(inputfile)
project.Save(outputfile, SaveFileFormat.PDF)



Regards
Aravind

Hi Aravind,


I have tested your code and it is working fine without any error. The output PDF file generated here, is viewed in PDF XChange Viewer and am afraid to share that no exception or issue is observed as mentioned by you. However if I open your PDF file, it causes the exception in PDF XChange Viewer.

It seems some environment specific issue as your code is working fine here and output PDF file can be opened successfully in latest PDFXChange Viewer and Adobe PDF reader.

Could you please test the same scenario using some other machine with latest version Aspose.Tasks for .NET 6.9.0 and above mentioned PDF XChange Viewer?

P.S. I have used Microsoft Visual Studio Ultimate 2013, Windows 7, VB .NET, latest version of Aspose.Tasks, latest version of PDF XChange Viewer and Adobe Reader XI for testing. The sample output can be viewed here.

Hi

Can u cleary me ?
However if I open your PDF file, it causes the exception in PDF XChange Viewer.” for ur last reply ,what error u got when open file ? can u pls open my pdf 13Aug2014102728.pdf from previous reply, and open or not ?

I am download and use latest version as u mention above( Aspose.Tasks for .NET 6.9.0).still i cant open pdf after convert.

Pls solve asap,bcz this file format only pending issues.

Regards
Aravind.

Hi Aravind,


I tried both your files “b4ubuild_sample_07.pdf” and “13Aug2014102728.pdf” and got the error as shown in the linked images, however if I use “b4ubuild_sample_07.mpp” file and convert it to PDF, everything works fine and opens successfully.

Here I am attaching a simple project which converts the MPP file to PDF which can be opened in PDF XChange Viewer successfully. Please give it a try and let us know your feedback and also try it using valid licence if any.

If problem is still not resolved, please send us a complete project which can be used here to re-produce the issue. I am afraid that without re-producing the issue here, I may not be able to assist you in this regard therefore please assist us to re-produce the faulty PDF here.

We are sorry for the inconvenience caused to you.

Hi

Thank you for ur reply,finally i found the problem, i miss the “Imports Aspose.Tasks.Saving” namespace.
After add this now can open converted pdf.Thanx a lot
After import Aspose.Tasks.Saving namespace below is my code.And i use all api in same use,so need to specify the which api saving method

Dim reader As ProjectReader = New ProjectReader()
Dim project As Project = reader.Read(inputfile)
project.Save(outputfile, Aspose.Tasks.Saving.SaveFileFormat.PDF)


Regards
Aravind

Hi Aravind,


We are glad to know that your issue is resolved. Please feel free to write us back if you have any other query related to Aspose.Tasks.