// Set constraint Must Finish On for task with Id 15 System::SharedPtr interiorFixtures = project1->get_RootTask()->get_Children()->GetById(15); interiorFixtures->Set(Tsk::ConstraintType(), Aspose::Tasks::ConstraintType::MustFinishOn); interiorFixtures->Set(Tsk::ConstraintDate(), System::DateTime(2017, 3, 1, 18, 0, 0)); // Save project as pdf System::SharedPtr options = System::MakeObject(); options->set_StartDate(project1->Get(Prj::StartDate())); options->set_Timescale(Aspose::Tasks::Visualization::Timescale::ThirdsOfMonths); project1->Save(dataDir + u"project_MustFinishOn_out.pdf", options);