프로젝트 페이지를 별도의 이미지 파일로 변환하십시오

출력 파일을 분리하기 위해 프로젝트 페이지를 인쇄하려면 ImagesAveOptions.SavetOseParateFiles 속성을 사용하십시오. 파일을 별도의 파일에 저장할지 여부를 지정합니다. 또한 API는 Project SaveOptions.Pages 속성을 제공하여 프로젝트 레이아웃을 분리 할 때 저장할 페이지 번호 목록이 포함 된 속성을 제공합니다. 이 목록이 비어 있고 imagesAveOptions.saVetoseParateFiles가 true로 설정된 경우 모든 페이지가 저장됩니다.

파일 별도의 프로젝트 페이지 인쇄

다음 코드 예제는 프로젝트에서 개별 페이지를 인쇄하여 파일을 분리하는 방법을 보여줍니다.

 1System::SharedPtr<Project> project = System::MakeObject<Project>(dataDir + u"CreateProject2.mpp");
 2System::SharedPtr<ImageSaveOptions> saveOptions = System::MakeObject<ImageSaveOptions>(Aspose::Tasks::Saving::SaveFileFormat::PNG);
 3saveOptions->set_StartDate(project->Get<System::DateTime>(Prj::StartDate()).AddDays(-3));
 4saveOptions->set_EndDate(project->Get<System::DateTime>(Prj::FinishDate()));
 5    
 6saveOptions->set_MarkCriticalTasks(true);
 7saveOptions->set_LegendOnEachPage(false);
 8    
 9saveOptions->set_Gridlines(System::MakeObject<System::Collections::Generic::List<System::SharedPtr<Gridline>>>());
10    
11System::SharedPtr<Gridline> gridline = System::MakeObject<Gridline>();
12gridline->set_GridlineType(Aspose::Tasks::Visualization::GridlineType::GanttRow);
13gridline->set_Color(System::Drawing::Color::get_CornflowerBlue());
14gridline->set_Pattern(Aspose::Tasks::Visualization::LinePattern::Dashed);
15saveOptions->get_Gridlines()->Add(gridline);
16    
17// Save the whole project layout to one file
18project->Save(dataDir + u"PrintProjectPagesToSeparateFiles1_out.png", System::StaticCast<Aspose::Tasks::Saving::SaveOptions>(saveOptions));
19    
20// Save project layout to separate files
21saveOptions->set_SaveToSeparateFiles(true);
22project->Save(dataDir + u"PrintProjectPagesToSeparateFiles2_out.png", System::StaticCast<Aspose::Tasks::Saving::SaveOptions>(saveOptions));
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.