Question
Getting "The provided token is malformed or otherwise invalid"
I followed the .Net example for "ExportPdfToDocx" using the Adobe.PDFServiceSDK.
It throw the "The provided token is malformed or otherwise invalid" when calling exportPdfOperation.Excute(executionContext).
Code snipple:
Credentials credentials = Credentials.ServiceAccountCredentialsBuilder()
.FromFile(@"..\pdfservices-api-credentials.json")
.Build();
//Create an ExecutionContext using credentials and create a new operation instance.
ExecutionContext executionContext = ExecutionContext.Create(credentials);
ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew(ExportPDFTargetFormat.DOCX);
// Set operation input from a local PDF file
FileRef sourceFileRef = FileRef.CreateFromLocalFile(inputFile);
exportPdfOperation.SetInput(sourceFileRef);
// Execute the operation.
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
FileRef result = exportPdfOperation.Execute(executionContext);
// Save the result to the specified location.
result.SaveAs(newFile);Anyone encounter this and have solution?
