Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
I have the same problem. I also follow the examples and gets "The provided token is malformed or otherwise invalid" when calling exportPdfOperation.Excute(executionContext). Anyone have a solution for this? Is seems that the token field is null in executionContext.. I have double checked all the credential values.