pdf zuwa Excel

Maida PDF zuwa Excel (XLS, XLSX) tare da NET REST API.

A cikin zamanin yanke shawara na bayanan bayanai, fitar da hankali daga tushe mai yawa yana da mahimmanci. Koyaya, wannan sau da yawa yana ɗaukar ma’amala da bayanan da aka kulle a cikin PDF fayiloli, wanda zai iya zama babban ƙalubale. Wannan shine inda sihirin PDF zuwa [Excel] (https://docs.fileformat.com/spreadsheet/xlsx/) ya shigo cikin wasa. Mayar da ‘PDF zuwa Excel’ ya wuce aikin fasaha kawai; ƙofa ce don daidaita hakowar bayanai, bincike, da hangen nesa. Don haka, bari mu shiga cikin cikakkun bayanai na juyar da PDF zuwa Excel ta amfani da .NET REST API, ta yadda za mu iya tsarawa, sarrafa, da samun fahimi masu mahimmanci daga bayanan.

API ɗin NET REST don PDF zuwa Canjin Excel

Idan ya zo ga canza PDF zuwa Excel, inganci da daidaito sune mafi mahimmanci. Don haka muna ba da shawarar yin amfani da Aspose.PDF Cloud SDK don NET, mafita mai dacewa da haɓakawa wanda ke sauƙaƙe wannan gabaɗayan tsari. SDK yana ƙarfafa masu amfani tare da ɗimbin ayyuka fiye da juyawa, yana mai da shi cikakkiyar kayan aiki don hakar bayanai da magudi. Daga teburin bayanai zuwa rahotannin kuɗi, .NET REST API yana tabbatar da cewa fayilolin Excel da aka canza ba daidai ba ne kawai amma kuma an tsara su sosai.

Domin amfani da SDK, da fatan za a bincika ‘Aspose.PDF-Cloud’ a cikin manajan fakiti na NuGet a cikin Visual Studio IDE kuma danna maɓallin ‘Ƙara Kunshin’, don ƙara bayanin SDK a cikin aikin.

Sami takaddun shaidar abokin cinikin ku daga dashboard Cloud. Idan ba ku da asusun da ke akwai, kawai ƙirƙiri asusun kyauta ta bin umarnin da aka kayyade a kan saurin farawa.

Maida PDF zuwa XLS tare da C# .NET

Da fatan za a bi matakan da aka bayar a ƙasa don haɓaka PDF zuwa mai canza Excel ta amfani da C# .NET.

// 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 = "c71cfe618cc6c0944f8f96bdef9813ac";
string clientID = "163c02a1-fcaa-4f79-be54-33012487e783";

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

// kira API don canza shigar da fayil ɗin PDF zuwa Excel kuma mun ƙayyade don samar da takaddun aiki tare
var response = pdfApi.GetPdfInStorageToXlsx("input.pdf", minimizeTheNumberOfWorksheets: true, uniformWorksheets: true);

if (response != null)
{
    Console.WriteLine("PDF to Excel worksheet conversion completed successfully !");
}
saveToDisk(response,"ResultantFile.xls");


// Hanyar da aka saba don adana abun cikin 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();
}
pdf zuwa Excel

Yadda ake canza PDF zuwa Excel.

Ana ba da cikakkun bayanai masu sauri game da snippet na sama da aka bayyana.

PdfApi pdfApi = new PdfApi(clientSecret, clientID);

Ƙirƙiri wani abu na ajin PdfApi yayin ƙaddamar da shaidar abokin ciniki azaman mahawara ta shigarwa.

pdfApi.GetPdfInStorageToXlsx("input.pdf", minimizeTheNumberOfWorksheets: true, uniformWorksheets: true);

Yanzu, kira API don canza PDF zuwa littafin aiki na Excel inda muka ambata don samun takaddun aiki iri ɗaya a cikin fitarwa. A ƙarshe, ana amfani da hanyar al’ada don adana fitarwa a kan tuƙi na gida.

  • PutPdfInStorageToXlsx - Wannan API yana jujjuya daftarin aiki na PDF (wanda yake akan ajiya) zuwa tsarin XLSX kuma yana loda fayil ɗin sakamakon zuwa ajiya.
  • PutPdfInRequestToXlsx - Wannan API yana jujjuya daftarin aiki (a cikin buƙatar abun ciki) zuwa tsarin XLSX kuma yana loda fayil ɗin sakamako zuwa ajiya.

Za a iya sauke samfurin fayilolin PDF da aka yi amfani da su a cikin fayil ɗin misali na sama daga asscidatatablessample.pdf.

Fitar da PDF zuwa Littafin Aikin Excel tare da Umarnin CURL

Ga waɗanda ke neman ingantacciyar hanyar rubutu da rubutu zuwa PDF zuwa fassarar Excel, Aspose.PDF Cloud tare da umarnin cURL yana ba da ingantaccen bayani. Ko abin da ake buƙata shine ‘canza PDF zuwa Excel’, ‘canza PDF zuwa XLS’, ko ‘Fitar da PDF zuwa Excel’, an tsara wannan hanyar don sauya bayanai mara sumul. Ta amfani da umarnin cURL, zaku iya sarrafa tsarin kuma ku haɗa shi cikin aikinku ba tare da matsala ba.

Don fara amfani da wannan hanyar, mataki na farko shine ƙirƙirar 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"

Yanzu da aka samar da alamar JWT, muna buƙatar aiwatar da umarni mai zuwa don fitar da PDF zuwa Excel akan layi. Bayan an yi jujjuyawar, ana adana takaddun aikin Excel na sakamakon a kan faifan gida.

curl -v "https://api.aspose.cloud/v3.0/pdf/{sourceFile}/convert/xlsx?minimizeTheNumberOfWorksheets=true&uniformWorksheets=true" \
-X GET \
-H  "accept: multipart/form-data" \
-H  "authorization: Bearer {accessToken}" \
-o "{resultantWorkbook}"

Sauya ‘sourceFile’ tare da sunan shigar da fayil ɗin PDF da ake samu a cikin ma’ajiyar gajimare, ‘resultantWorkbook’ tare da sunan sakamakon aikin Excel kuma maye gurbin ‘accessToken’ tare da alamar samun damar JWT da aka samar a sama.

Kammalawa

A ƙarshe, an ƙaddamar da neman canza PDF zuwa Excel ta hanyoyi biyu daban-daban amma masu ƙarfi. The Aspose.PDF Cloud SDK for .NET yana ba da cikakkiyar bayani kuma mai haɓakawa mai haɓakawa, yana sauƙaƙe abin da ake buƙata na ‘PDF zuwa fassarar Excel’ yayin da yake ƙara ƙarfinsa fiye da juzu’i kawai. A gefe guda, ga waɗanda ke neman hanya mai mahimmanci, hanyar rubutu, haɗuwa da umarnin Aspose.PDF Cloud da cURL suna ba da aikin aiki mai sarrafa kansa don sauya bayanan da ba su dace ba. Dukansu hanyoyin, kowannensu yana da irin ƙarfinsa na musamman, yana da nufin daidaita haɓaka bayanai da bincike, canza shi zuwa tsari mai tsari da inganci.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: