Hi,
There is error message -Parameter not valid when convert MPP to PDF in Aspose.Tasks DLL for .Net.
And we understood that there is Bitmap image issue in MPP file, but cannot find the where is the error in file.
Provide me solution on this.
Code:
Aspose.Tasks.Project(x.InputStream)
System.ArgumentException was caught
HResult=-2147024809
Message=Parameter is not valid.
Source=System.Drawing
StackTrace:
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
at …ctor(Int32 , Int32 , Single , Single , PixelFormat )
at …ctor(Int32 , Int32 , Single , Single )
at …ctor(Int32 , Int32 )
at . ( , )
at . ( )
at . ( , Boolean )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ( )
at . ()
at . (Project , Stream )
at . (Stream , SaveOptions )
at Aspose.Tasks.Project.Save(Stream stream, SaveOptions options)
Thanks
I have worked with source file shared by you and unable to observe issue. I have also shared my generated result with you for your kind reference. Can you please share which Aspose.Tasks version you used on your end. MSP.pdf (68.0 KB)
we are using Aspose.Tasks version of DLL is- 17.12.0.0 and this is licence of Aspose.Total for .NET
I have attached .Net code below for reference.
.Net Code to Generate PDF :
Dim taskStream As MemoryStream = New MemoryStream()
Dim projectTask As _
New Aspose.Tasks.Project(x.InputStream)
If x.InputStream.Length > 0 Then
Dim saveOptions As New Aspose.Tasks.Saving.PdfSaveOptions()
saveOptions.FitContent = True
projectTask.Save(taskStream, saveOptions) //Exception is coming here
taskStream.Position = 0
Thank you it is working with New version 19.6.1 with out license file in my local system, when we have applied with license file it gives error message like “The subscription included in this license allows free upgrades until 11 Feb 2019, but this version of the product was released on 11 Jun 2019. Please renew the subscription or use a previous version of the product.”.
Old license is working for other conversion, Word, excel, ppt etc…
Continue on my previous post,PDF file is generated but some content is missing in the file after conversion from MPP.But we need file should be like this-Document.pdf (416.9 KB).
And We are able to generate correct PDF file from Old version 17.12.0 without license applied in the code.
I have tried with latest version 19.6.1 and it is generating the PDF file, but some content is missing in the file and content should be - Document.pdf.
We tried with Old version 17.12.0 and able to generate correct file as attached.
Why it is not working with license old version?
I have observed the information shared by you. An issue with ID TASKSNET-3330 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.
We have internally verified the issue on our end. The reason is that in evaluation version the dates are “moved” to year 2000, but view is rendered for actual dates (2018 year). The licensed version of Aspose.Tasks produces the correct PDF.
At the moment the you can choose one of following options:
Use the licensed version of Aspose.Tasks
or
Specify the dates explicitly using the following code:
var saveOptions = new PdfSaveOptions()
{
FitContent = true,
StartDate = new DateTime(2000, 1, 1),
EndDate = new DateTime(2001, 1, 1)
};
@mudassir.fayyaz,
Thank you
We already using license version of 17.12.0 , but not working without start date and end date explicit setup.
New License version 19.6.1 will maintain the start date and end date dynamically?
I have shared two possible options for you. The first one suggest to use product license using Aspose.Tasks for .NET 19.6.1. This will serve the purpose. The other work around approach was to specify the dates explicitly in save options. The better is to use valid license using Aspose.Tasks for .NET 19.6.1.