How can I convert xml files to jpeg?

How can I convert xml files to jpeg?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
I have no idea.  I'm just curious why you would want to convert a data file to an image file.  How would you use it?
DoctorK12008Author Commented:
I need to save it as part of a medical record.
Olaf DoschkeSoftware DeveloperCommented:
What hinders you to save the XML files as is?

Bye, Olaf.
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

DoctorK12008Author Commented:
The practice management software does not accept XML files.   If I can convert them to JPEG, I can import them.
David Johnson, CD, MVPOwnerCommented:
If you convert the xml data file into an image file then you lose the ability to use the data in the xml file.  Why don't you just import the xml file
Olaf DoschkeSoftware DeveloperCommented:
What is the software doing to the files? Is it copying them to some folder, put them into a database? I'd go to the vendor and ask for a change. You could try simply adding the file extension jpg, so you have data.xml.jpg and can select the file, but when it doesn't come back as it was when you remove the jpg extension from the file you get back, that's not an option.

SQL Server, for example, has certain data types, of which an old one was the image data type, intended for image storage only. Today we rather have blob for binary large object, which can store any file (no matter if large or not). So it wouldn't be impossible to modify the software for the vendor/developer to allow adding all kinds of file types.

But there is no conversion of any file type to any other file type. Only certain conversions make sense, eg text in different character encodings (ASCII, ANSI, Unicode) or images of certain formats, or videos, but not in between file categories. And even those conversion don't always work 1:1, eg Unicode has characters you won't find in ASCII, so if the original is ASCII you can surely convert it and also get it back, but if the original is Unicode you won't be able to have the same ASCII text in most cases.

It doesn't make sense to convert a text file to an image file. That's a one-way conversion unless you shoot with cannons on sparrows to convert the image back to text via OCR (optical character recognition). And you want your file back as it was, when you later retrieve it back, don't you?

The ideal way is to store files as is, to get them back as is, so the capabilities of your software have to change.

Bye, Olaf.
Olaf DoschkeSoftware DeveloperCommented:
There is another big chance, you get a file open dialog, which only defaults to selecting JEPG files, but can be changed to all file types like this:
picking file type
Lookout for such a control on the dialog you have for selecting pictures to store. Your software might already be able to store anything, just defaulting to picture files, as it's the most common files to store.

Bye, Olaf.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaun VermaakTechnical SpecialistCommented:
You are probably referring to blob data within the XML file. Pretty standard to read image to and from byte array but here is an article
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.