Skip to main content

Notifications

Announcements

No record found.

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

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,556 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,625 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans