• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Getting "The provided token is malformed or otherwise invalid"

New Here ,
Nov 17, 2022 Nov 17, 2022

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?

TOPICS
.NET SDK

Views

81

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources