Click here to Skip to main content
15,898,999 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have a variable that contains a name that I recover the database. and I want my pdf file is created with the name that is in my variable.

how I put the variable name in the file path ?
knowing that I program with c #.


string name;

C#
try
          {
              PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream("c:/Users/User/Desktop/Application/"pdf_name".pdf", FileMode.Create));

              doc.Open();


thanks
Posted
Comments
Andrei Straut 26-Sep-12 5:34am    
Try:
PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream("c:/Users/User/Desktop/Application/" + pdf_name + ".pdf", FileMode.Create));
Sushil Mate 26-Sep-12 5:35am    
what's the problem?
kahina_france 26-Sep-12 6:09am    
thanks
I tried it but it does nothing
kahina_france 26-Sep-12 6:14am    
is solved!
thank you all

1 solution

Try Following use + before and after
XML
pdf_name

<pre lang="cs">try
          {
              PdfWriter wri = PdfWriter.GetInstance(doc, new FileStream(&quot;c:/Users/User/Desktop/Application/&quot;+pdf_name+&quot;.pdf&quot;, FileMode.Create));

              doc.Open();</pre>
 
Share this answer
 
Comments
kahina_france 26-Sep-12 6:14am    
is solved!
thank you all

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