Click here to Skip to main content
14,241,248 members
Rate this:
Please Sign up or sign in to vote.
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;

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

Rate this:
Please Sign up or sign in to vote.

Solution 1

Try Following use + before and after
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>
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100