Skip to main content

Notifications

Business Central forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Problem with pdf Document Content business central API

Posted on by

Hi,

When i tried to called pdfDocument API endpoint

I will get response back, which is like this

%PDF-1.7
%���

And then I tried with my C# code to convert string to bytes :

string responsePdfContent = getSalesInvoicePdf.Content.ReadAsStringAsync().Result;

var bytes = System.Convert.FromBase64String(responsePdfContent); BUT at this line i will get error : The input is not a valid Base-64 string, as it contains a character that is not a base-64 character, more than two fill characters, or an invalid character among the fill characters.


Is there anyone have some sample code in c# or can anyone please help me! :)

Thanks.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans