PDF zuwa PDF/A

Maida PDF zuwa PDF/A tare da .NET REST API.

Mun fahimci cewa PDF takaddun wani bangare ne na rayuwarmu ta yau da kullun, domin suna aiki a matsayin amintaccen hanyar musayar bayanai da adana mahimman bayanai. Koyaya, lokacin da buƙatun adana takardu suka zama masu ƙarfi, adanawa na dogon lokaci da bin fayilolin PDF ya zama mahimmanci. Wannan shine inda ake buƙatar jujjuyawar PDF zuwa PDF/A. Don haka, yi amfani da ƙarfin Aspose.PDF Cloud SDK don NET kuma ba tare da ɓata lokaci ba don canza takaddun PDF ɗinku zuwa PDF/A kuma buɗe fa’idodin kiyayewa mai ƙarfi da bin ƙa’idodin adana kayan tarihi.

API ɗin REST don Gudanar da PDF

Tare da Aspose.PDF Cloud SDK for .NET, tsarin canza PDF zuwa PDF/A yana daidaitawa kuma ya zama mai inganci. Wannan API mai ƙarfi yana ba da haɗin kai mara kyau tare da aikace-aikacen NET ɗinku, yana ba ku damar jujjuya fayilolin PDF zuwa tsarin PDF/A. Don haka, ɗauki fa’idar wannan fasalin SDK mai arziƙi, kuma tabbatar da cewa takaddun ku sun bi ƙa’idodin adana kayan tarihi kuma ana iya adana su na dogon lokaci.

Don haka, don fara amfani da SDK, kawai 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.

Maida PDF zuwa PDF/A ta amfani da C# .NET

Da fatan za a gwada yin amfani da snippet code na gaba, wanda ke ba da hanya mai sauri da dacewa don haɓaka PDF zuwa PDF/A Converter.

// 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";

// Canza PDF zuwa PDF/Takardar yarda
var response = pdfApi.GetPdfAInStorageToPdf(inputFile, dontOptimize: true);

// Ajiye sakamakon PDF/A akan faifan gida
saveToDisk(response, "/Users/nayyer/Downloads/Converted-pdfa.pdf");

// 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();
}

Ƙayyadaddun da ke ƙasa akwai cikakkun bayanai masu sauri game da snippet na lambar da aka bayyana a sama.

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.

var response = pdfApi.GetPdfAInStorageToPdf(inputFile, dontOptimize: true);

Hujja ta farko a cikin hanyar da ke sama ita ce sunan shigar da fayil ɗin PDF da ake samu a cikin ma’ajin gajimare kuma hujja ta biyu ta bayyana cewa sakamakon PDF/A ba za a inganta shi ba in ba haka ba akwai damar lalata fayil.

saveToDisk(response, "/Users/nayyer/Downloads/Converted-pdfa.pdf");

Wannan hanyar al’ada tana adana sakamakon PDF/A akan tuƙi na gida.

Za a iya sauke takardun shigar da PDF da aka yi amfani da shi a cikin misalin da ke sama daga Binder1.pdf.

PDF zuwa PDF/A Juyawa ta amfani da Umarnin CURL

Wani zaɓi mai ban mamaki shine ta amfani da umarnin cURL a hade tare da Aspose.PDF Cloud. Ta wannan hanyar, zaku iya canza fayilolin PDF ɗinku yadda yakamata zuwa tsarin PDF/A. Lura cewa wannan haɗin mai ƙarfi yana ba da damar sassauƙa da tsarin tushen umarni don juyawa. Ko kuna buƙatar canza PDF guda ɗaya ko aiwatar da babban tsari na fayiloli, wannan hanyar tana ba da juzu’i da haɓakar da ake buƙata don buƙatun ku.

Yanzu, tare da wannan hanyar, matakin farko 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"

Da zarar an ƙirƙiri alamar JWT, da fatan za a aiwatar da wannan umarni zuwa PDF zuwa PDF/A. Fayil ɗin sakamakon ana ajiye shi a kan faifan gida ta amfani da hujjar -o.

curl -v "https://api.aspose.cloud/v3.0/pdf/create/pdfa?srcPath={myInputFile}&dontOptimize=true" 
\ -X GET \
-H  "accept: multipart/form-data" \
-H  "authorization: Bearer {accessToken}" \
-o "Converted.pdf"

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

Kammalawa

A ƙarshe, jujjuya PDF zuwa tsarin PDF/A tsari ne mai mahimmanci don tabbatar da adana dogon lokaci da bin takaddun dijital. Tare da iko mai ƙarfi na Aspose.PDF Cloud SDK don NET da umarnin cURL, wannan aikin ya zama maras kyau da inganci. Mun kuma koyi cewa Aspose.PDF Cloud ya tabbatar da zama abin dogara da ingantaccen bayani don canza fayilolin PDF zuwa tsarin PDF / A. Bugu da ƙari, sauran iyawarta don kiyaye amincin daftarin aiki, cire rubutu, hotuna, da metadata da sauransu, ya sa ya zama kayan aiki mai mahimmanci ga kowace ƙungiya.

Hanyoyin haɗi masu amfani

Labarai masu alaka

Muna ba da shawarar ziyartar shafukan yanar gizo masu zuwa: