Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello,

I am importing multiple XML files using
C#
Directory.GetFiles("Your_Path", "Sample*")
and now I want to convert every file in the folder to a PDF.

Each PDF will start with "PDF_***.pdf".

Please help.

Regards
Aman Chaurasia

What I have tried:

I have just imported and I thought of using
C#
foreach
loop but I dont know how to proceed.
Posted
Updated 17-May-18 19:24pm
Comments
[no name] 18-May-18 1:37am    
What is the actual question? How to loop over the files? How to open an XML file? How to convert XML to PDF? etc.
Just a code block with 'foreach' is not enough information to show what you have tried.
Primo Chalice 18-May-18 4:10am    
Umm, I have to import multiple XML files from a particular location and then convert each file to separate pdf files.
Richard Deeming 18-May-18 9:25am    
You still haven't told us which part of that requirement you're struggling with.

foreach (string filePath in Directory.EnumerateFiles("...source path...", "Sample*.xml"))
{
    XDocument document = XDocument.Load(filePath);
    ... convert the document to a PDF file here ...
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900