Free Support Forum - aspose.com

Aspose.Task save to PDF rendering issue

Hi,

We are currently evaluating Aspose.Tasks and are facing difficulites with the pdf rendering of a mpp file.

We use Aspose.Task for java and need to load and save an existing mpp file to pdf with the same rendering (for example : fit to one page).

How can we achieve this whit Apose.Task for java ? Can you please provide sample code ?

Please find in attachment the mpp file we want to save in pdf format, the print preview from MS-Project to show the expected result and the current PDF result.

Thanks.

mpp file : pce_exported_projet.zip (20.6 KB)
schreenshot of expected result (from MS-Project) : MS-Project print preview.png (59.9 KB)
current result (not as expected) : pce_exported_projet.pdf (161.7 KB)

@antoinegentet

Can you please share which API version you are using along with sample code so that I may observe that on my end to assist you further.

@mudassir.fayyaz,

thank you for your answer. We use Aspose.Task for java version 20.10. Here is sample code we use to load and save an mpp project file to pdf :

public class EvaluateAsposeTask {

    public static void main(String[] args) {
        try {
            loadAsposeLicense();
            Project prj = new Project("./pce_exported_projet.mpp");
            PdfSaveOptions savePdfOptions = new PdfSaveOptions();
            savePdfOptions.setPresentationFormat(PresentationFormat.GanttChart);
            savePdfOptions.setFitContent(true);
            savePdfOptions.setStartDate(prj.get(Prj.START_DATE));
            savePdfOptions.setEndDate(prj.get(Prj.FINISH_DATE));            
            prj.save("./pce_exported_projet_01.pdf", savePdfOptions);
        } catch (IOException ex) {
            Logger.getLogger(EvaluateAsposeTask.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

Thank you for your help.

@antoinegentet

We need to investigate this on our end and a ticket with ID TASKSJAVA-1291 has been added 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.

@mudassir.fayyaz
Thanks. Keep me posted.
Have a good day.

@antoinegentet

Sure, we will apprise you as soon as the issue will be addressed.