sake shirya shafukan pdf

Sake tsara Shafukan PDF ta amfani da NET REST API.

PDFs babban tsari ne na fayil da ake amfani da shi don raba bayanai, kuma sau da yawa, tsari na shafuka na iya tasiri sosai yadda ake isar da abun cikin yadda ya kamata. Ko kuna shirya rahoto, gabatarwa, ko ɗaba’a, tabbatar da cewa shafukan suna cikin mafi ma’ana da tasiri yana da mahimmanci. Wannan labarin ya shiga cikin buƙatu mai mahimmanci da fa’idodi masu yawa waɗanda ke zuwa tare da sake tsara shafukan PDF ta amfani da .NET REST API, yana ƙarfafa ku don yin amfani da wannan mahimmancin fasaha don ingantaccen tsarin daftarin aiki.

Mu ƙware fasahar sake tsara shafi don haɓaka iyawar sarrafa takaddun mu.

API ɗin REST don Sake Shirya Shafukan PDF

Sake odar shafukan PDF iskar iska ce tare da Aspose.PDF Cloud SDK don NET. Wannan API ɗin REST mai ƙarfi yana ba da dabara mai inganci kuma mai inganci don gyara odar shafi a cikin takaddun PDF. Ta amfani da iyawar SDK, zaku iya matsawa, sake tsarawa, da tsara tsarin shafuka don biyan takamaiman buƙatunku. Duk da haka, gabatar da bayanai a cikin mafi ma’ana kuma mai sauƙin karantawa.

Domin farawa da wannan tsarin jujjuyawa, da farko muna buƙatar ƙara bayanin SDK a cikin aikinmu kuma don wannan dalili, da fatan za a bincika ‘Aspose.PDF-Cloud’ a cikin manajan fakitin NuGet a cikin Visual Studio IDE kuma danna maɓallin ‘Ƙara Kunshin’ . Hakanan kuna buƙatar samun takaddun shaidar abokin ciniki daga cloud dashboard. Idan ba ku da asusun da ke akwai, kawai ƙirƙiri asusun kyauta ta bin umarnin da aka kayyade a kan saurin farawa.

Sake oda shafukan PDF ta amfani da C# .NET

Ko yana ƙarfafa rahotanni ko haɗa surori na littafi, ikon sake tsara shafukan PDF muhimmin fasali ne na kowane tsarin sarrafa takardu. Bari mu bincika ƙarin cikakkun bayanai kan yadda ake sake tsara shafukan PDF tare da snippet code C#.

// Don ƙarin misalai, https://github.com/aspose-pdf-cloud/aspose-pdf-cloud-dotnet/tree/master/Examples

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

// ƙirƙirar misali na PdfApi
PdfApi pdfApi = new PdfApi(clientSecret, clientID);

// Shigar da sunan fayil na PDF
String inputFile = "Binder1-1.pdf";

// kira API don matsar da shafin daga fihirisar farko zuwa na uku
pdfApi.PostMovePage("Converted-PDF_A.pdf", 1, 3);
Sake tsara shafukan PDF

Sake tsara shafukan PDF.

An bayar a ƙasa akwai cikakkun bayanai game da snippet na sama da aka bayyana.

PdfApi pdfApi = new PdfApi(clientSecret, clientID);

Da fari dai, ƙirƙiri wani abu na ajin PdfApi yayin ƙaddamar da bayanan abokin ciniki azaman mahawara ta shigarwa.

pdfApi.PostMovePage("Converted-PDF_A.pdf", 1, 3);

Kira API don matsar da shafin daga fihirisar farko zuwa na 3 kuma ajiye fitarwa zuwa ma’ajiyar gajimare.

Canza Shafukan PDF ta amfani da Umarnin CURL

Sake odar shafukan PDF ta amfani da Aspose.PDF Cloud da umarnin cURL tsari ne mai sauƙi kuma mai dacewa wanda ke ba da fa’idodi da yawa. Ɗaya daga cikin manyan fa’idodin wannan tsarin shine ‘yancin kai na dandamali. Bugu da ƙari, Aspose.PDF Cloud haɗe tare da sauƙin umarnin cURL, yana ba da damar sarrafa tsari mai inganci. Don haka ko dai don sake tsara rahoto, gabatarwa, ko kowace takarda, zaku iya daidaita jerin shafin yadda ya kamata don haɓaka fahimtar takaddun da kwararar hankali.

Mataki na farko na wannan hanyar shine ƙirƙirar alamar samun damar JWT. Don haka, da fatan za a aiwatar da umarni mai zuwa:

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=bb959721-5780-4be6-be35-ff5c3a6aa4a2&client_secret=4d84d5f6584160cbd91dba1fe145db14" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Yanzu, aiwatar da umarni mai zuwa don matsar da shafi a fihirisa 1 zuwa sabon wuri (index 3). Da zarar an aiwatar da umarnin, ana adana daftarin aiki da aka sabunta a cikin ma’ajiyar girgije iri ɗaya.

curl -v "https://api.aspose.cloud/v3.0/pdf/{inputPDF}/pages/2/movePage?newIndex=3" \
-X POST \
-H  "accept: application/json" \
-H  "authorization: Bearer {accessToken}" \
-d{}

Sauya ‘inputPDF’ tare da sunan shigar da takaddun PDF da ake samu a cikin ma’ajiyar girgije, da ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.

Kammalawa

A ƙarshe, ƙware fasahar sake tsara shafukan PDF wata fasaha ce ta asali wacce ke haɓaka sarrafa takardu da gabatarwa sosai. Mun bincika hanyoyi biyu masu ƙarfi don cimma wannan: yin amfani da Aspose.PDF Cloud SDK don NET da kuma yin amfani da Aspose.PDF Cloud tare da umarnin cURL. Don haka, SDK ɗin da aka keɓe don NET yana ba da kayan aikin haɓaka-abokan haɓakawa, yana ba da ingantaccen sarrafawa da ɗimbin zaɓuɓɓukan gyare-gyare don sake odar shafin PDF. Kuma a gefe guda, yin amfani da Aspose.PDF Cloud tare da umarnin cURL yana ba da dama da ‘yancin kai na dandamali.

Don haka, ƙware da sake yin odar shafi na PDF yana ba ku kayan aiki mai ƙarfi don daidaita gabatarwar bayanai da haɓaka sarrafa takaddun zuwa sabon matsayi.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: