mpp da jpg

Maida MS Project (MPP) zuwa JPG ta amfani da .NET REST API.

Shiga ingantaccen sadarwar aikin sau da yawa yana buƙatar ƙetare iyakokin dijital na kayan aikin gudanarwa na al’ada. Wakilin gani shine maɓalli, kuma ikon canza MS Project (MPP) fayiloli zuwa [JPG](https://docs.fileformat. com/image/jpeg/) hotuna sun zama kadara mai mahimmanci. Ka yi tunanin wani labari inda aka fassara ɓarnawar tsare-tsaren aikin ku ba tare da wahala ba zuwa sigar gani, yana ba da damar fayyace fahimta da haɓaka haɗin gwiwa. Wannan labarin yana bincika abubuwan ban mamaki na MS Project zuwa juyawa JPG ta amfani da .NET REST API.

API ɗin REST don Canjin Fayilolin Ayyukan MS

Aspose.Tasks Cloud SDK for .NET yana fitowa a matsayin mai canza wasa, ba wai kawai ya yi fice wajen canza fayilolin MS Project (MPP) zuwa hotuna JPG ba, har ma. yana ba da ɗimbin fasali masu ƙarfi don haɓaka ƙwarewar sarrafa aikin ku. Daga tsarar taswirar Gantt mai ƙarfi zuwa sarrafa albarkatun, Aspose.Tasks Cloud yana ƙarfafa ku da kayan aikin da suka wuce juzu’i masu sauƙi. Don haka, buɗe cikakkiyar damar bayanan aikin ku ta hanyar ingantaccen SDK wanda ke haɗawa cikin ayyukanku ba tare da matsala ba.

Domin amfani da SDK a cikin aikinku, da fatan za a bincika ‘Aspose.Tasks-Cloud’ a cikin manajan fakitin NuGet kuma danna maɓallin ‘Ƙara Kunshin’. Wannan zai ƙara bayanin SDK a cikin aikin ku. Na biyu, sami takaddun shaidar abokin ciniki daga dashboard ɗin girgije.

Idan ba ku da asusun da ke akwai, kawai ƙirƙirar asusun kyauta ta bin umarnin da aka kayyade a cikin labarin saurin farawa.

Maida MPP zuwa JPG tare da C# .NET

Shiga ingantaccen sadarwar aikin da ke buƙatar ketare iyakokin dijital na kayan aikin gudanarwa na al’ada kuma amfani da guntun lambar C# .NET don cika wannan buƙatu.

TasksApi tasksApi = new TasksApi(clientSecret, clientID);

Ƙirƙiri wani abu na ajin TasksApi yayin wucewa da bayanan abokin ciniki azaman mahawara ta shigarwa.

GetTaskDocumentWithFormatRequest formatRequest = new GetTaskDocumentWithFormatRequest()
{
    Format = ProjectFileFormat.Jpeg,
    Name = inputFile
};

Ƙirƙiri misalin Buƙatun inda muka ƙididdige sunan shigar da MPP, tsarin sakamako kamar JPEG.

var output = tasksApi.GetTaskDocumentWithFormat(formatRequest);

A ƙarshe, kira API don canza MPP zuwa JPG akan layi kuma dawo da fitarwa a cikin misalin rafi.

saveToDisk(finalResponse, resultant);

Hanyar mu ta al’ada tana ba da damar adana sakamakon JPEG akan tuƙi na gida.

// Don ƙarin misalai, da fatan za a ziyarci https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-dotnet

// Samu bayanan abokin ciniki daga https://dashboard.aspose.cloud/
string clientSecret = "4d84d5f6584160cbd91dba1fe145db14";
string clientID = "bb959721-5780-4be6-be35-ff5c3a6aa4a2";

// ƙirƙirar misalin TasksApi
TasksApi tasksApi = new TasksApi(clientSecret, clientID);

// Sunan shigar da fayil MPP
String inputFile = "Home move plan.mpp";
// sunan sakamakon sakamakon hoton JPeg
String resultant = "resultant.jpg";

// ƙirƙiri buƙatun sauya fayil MPP
GetTaskDocumentWithFormatRequest formatRequest = new GetTaskDocumentWithFormatRequest()
{
    Format = ProjectFileFormat.Jpeg,
    Name = inputFile
};

// Yi canjin MPP zuwa JPEG kuma mayar da fitarwa azaman misali rafi
var output = tasksApi.GetTaskDocumentWithFormat(formatRequest);

// Hanyar al'ada don adana sakamako na hoto akan drive ɗin gida
saveToDisk(response, resultant);

// Hanya don adana abun ciki na rafi zuwa fayil akan faifan gida
public static void saveToDisk(Stream responseStream, String resultantFile)
{
    var fileStream = File.Create(resultantFile);
    responseStream.Seek(0, SeekOrigin.Begin);
    responseStream.CopyTo(fileStream);
    fileStream.Close();
}
mpp da jpg

Samfoti na sauya MPP zuwa JPEG tare da NET REST API.

Za a iya sauke samfurin fayil ɗin MPP da aka yi amfani da shi a cikin misalin da ke sama daga Tsarin motsa gida.mpp.

MS Project (MPP) zuwa JPG ta amfani da Umarnin CURL

Yi amfani da sassauci da sarrafawa wanda Aspose.Tasks Cloud ke bayarwa ta hanyar umarnin cURL. Waɗannan umarni ba kawai sauƙaƙe tsarin jujjuyawar da ba su dace ba amma kuma suna bayyana ainihin yuwuwar Aspose.Tasks Cloud. Tare da umarnin cURL, kuna samun damar yin amfani da layin umarni zuwa ƙarfin ƙarfi na tushen SDK, yana ba da damar ingantaccen aiki mai inganci. Bugu da ƙari, wannan hanyar tana haifar da sabon matakin gyare-gyare da sarrafa kansa zuwa ayyukan sarrafa ayyukan ku.

Yanzu, mataki na farko a cikin wannan hanyar ita ce samar da alamar samun damar JWT ta amfani da umarni mai zuwa:

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=163c02a1-fcaa-4f79-be54-33012487e783&client_secret=c71cfe618cc6c0944f8f96bdef9813ac" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Da fatan za a aiwatar da umarni mai zuwa don fitarwa fayil ɗin MS Project (MPP) zuwa hoton raster na JPEG.

curl -X GET "https://api.aspose.cloud/v3.0/tasks/{sourceMPP}/format?format=jpeg" \
-H  "accept: multipart/form-data" \
-H  "authorization: Bearer <accessToken>" \
-o Resultant.jpeg

Sauya sourceMPP tare da sunan shigar da fayil MPP da ke samuwa a cikin ma’ajiyar girgije kuma, maye gurbin ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.

Kammalawa

A ƙarshe, ko kun zaɓi madaidaiciyar dacewa na MPP zuwa juyawa JPG ta amfani da Aspose.Tasks Cloud don NET ko kuma ku fara tafiya ta layin umarni tare da umarnin cURL, sakamakon ya kasance iri ɗaya - inganci, aminci, da wadata mai yiwuwa. . Aspose.Tasks Cloud yana tsaye a matsayin shaida ga gudanar da ayyukan zamani, yana ba da sauye-sauye maras kyau tsakanin tsari tare da SDK mai amfani da mai amfani da damar-layi.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: