// Set constraint Finish No Earlier Than on task with Id 2 System::SharedPtr first = project1->get_RootTask()->get_Children()->GetById(2); first->Set(Tsk::ConstraintType(), Aspose::Tasks::ConstraintType::FinishNoEarlierThan); first->Set(Tsk::ConstraintDate(), System::DateTime(2016, 12, 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_FinishNoEarlierThan_out.pdf", options);