16,022,971 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Gary SC59 (Top 3 by date)
Gary SC59
7-Dec-23 19:22pm
View
I am accepting your solution because your comment pointed me in the right direction, even if the specifics were a bit different. Thanks for the input.
Gary SC59
7-Dec-23 19:20pm
View
UPDATE: I was approaching it the wrong way. The Base64 string I have merely needs to be decoded back to a file, not an image or a pdf. I stripped away the header "data:application/pdf;base64," and then I was able to convert the remaining base64 string to a file on the hard drive using System.IO.File. I was making it more difficult than it needed to be.
Gary SC59
7-Dec-23 19:17pm
View
Thank You for replying.
Yes, I have tried that. In order to get the byte[] array object to accept the string I have to remove the "data:application/pdf,Base64," header from the string (which comes that way from an SQL table), otherwise I get an error about non-Base64 characters in the string. But then I never get an image to show up in the pdf body. I opened the pdf in Acrobat and it did show me a big square that looked like a sea of QR codes all pasted together where the image was supposed to be, nothing recognizable as an image. So it's putting something there, but browsers and FoxIt apparently will not render it. I was surprised to see Acrobat show it to me at all.
It is apparently putting something there, but it is not recognized as an image.
I am trying to use iText7, since itextsharp is deprecated and no longer recommended.
using System directives do not have any methods for working with pdf as far as I can tell.